Skip to content

Commit

Permalink
fix initial pan jumping from middle to the correct value
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Jun 26, 2024
1 parent 5fa33db commit 9652c55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SpessaSynth",
"version": "3.2.16",
"version": "3.2.17",
"dependencies": {
"express": "^4.18.2",
"open": "^9.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export function noteOn(channel, midiNote, velocity, enableDebugging = false)
}
computeModulators(voice, this.workletProcessorChannels[channel].midiControllers);
voice.currentAttenuationDb = 100;
})
// set initial pan to avoid split second changing from middle to the correct value
voice.currentPan = ( (Math.max(-500, Math.min(500, voice.modulatedGenerators[generatorTypes.pan] )) + 500) / 1000) // 0 to 1
});

this.totalVoicesAmount += voices.length;
// cap the voices
Expand Down

0 comments on commit 9652c55

Please sign in to comment.