tweaks to tracking scheduling, and amplitude
This commit is contained in:
parent
7bbcb64819
commit
379fd543ff
|
@ -235,7 +235,7 @@ var startAudio = function (currentTime, fromCache) {
|
|||
eventQueue.push({
|
||||
event: event,
|
||||
source: MIDI.noteOff(channel, event.noteNumber, currentTime / 1000 + ctx.currentTime),
|
||||
interval: scheduleTracking(channel, note, queuedTime, offset - 10, 128)
|
||||
interval: scheduleTracking(channel, note, queuedTime, offset, 128)
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -89,10 +89,9 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
|
|||
source.connect(ctx.destination);
|
||||
///
|
||||
var gainNode = ctx.createGainNode();
|
||||
var value = -0.5 + (velocity / 100) * 2;
|
||||
var minus = (1 - masterVolume) * 2;
|
||||
var value = (velocity / 100) * masterVolume * 2 - 1;
|
||||
gainNode.connect(ctx.destination);
|
||||
gainNode.gain.value = Math.max(-1, value - minus);
|
||||
gainNode.gain.value = Math.max(-1, value);
|
||||
source.connect(gainNode);
|
||||
source.noteOn(delay || 0);
|
||||
return source;
|
||||
|
|
Loading…
Reference in a new issue