Skip to content

Commit

Permalink
Fix ModLfoToVol again
Browse files Browse the repository at this point in the history
and add interpolation type to snapshot
and add negative multipliers
  • Loading branch information
spessasus committed Sep 4, 2024
1 parent ea7d1ea commit 16698c0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 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.20.10",
"version": "3.20.11",
"type": "module",
"scripts": {
"start": "node src/website/server/server.js"
Expand Down
4 changes: 2 additions & 2 deletions src/spessasynth_lib/synthetizer/worklet_processor.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @property {ChannelSnapshot[]} channelSnapshots - the individual channel snapshots
* @property {number} mainVolume - main synth volume (set by MIDI), from 0 to 1
* @property {number} pan - master stereo panning, from -1 to 1
* @property {interpolationTypes} interpolation - the synth's interpolation type
* @property {SynthSystem} system - the synths system. Values can be "gs", "gm", "gm2" or "xg"
* @property {number} transposition - the current synth transpositon in semitones. can be a float
*/
Expand Down Expand Up @@ -75,7 +76,8 @@ export function sendSynthesizerSnapshot()
mainVolume: this.midiVolume,
pan: this.pan,
transposition: this.transposition,
system: this.system
system: this.system,
interpolation: this.interpolationType
};

this.post({
Expand All @@ -98,6 +100,7 @@ export function applySynthesizerSnapshot(snapshot)
this.setMasterGain(snapshot.mainVolume);
this.setMasterPan(snapshot.pan);
this.transposeAllChannels(snapshot.transposition);
this.interpolationType = snapshot.interpolation;

// add channels if more needed
while(this.workletProcessorChannels.length < snapshot.channelSnapshots.length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export function renderVoice(
// use modulation multiplier (RPN modulation depth)
cents += modLfoValue * (modPitchDepth * channel.customControllers[customControllers.modulationMultiplier]);
// volenv volume offset
// the lfo returns from -1 to 1, we change it to 0-1 here because the volume excursion is only positive
modLfoCentibels = (modLfoValue / 2 + 0.5) * modVolDepth;
// negate the lfo value because audigy starts with increase rather than decrease
modLfoCentibels = -modLfoValue * modVolDepth;
// lowpass frequency
lowpassCents += modLfoValue * modFilterDepth;
}
Expand Down
2 changes: 1 addition & 1 deletion src/website/js/renderer/render_waveforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function renderWaveforms()

const relativeX = waveWidth * x;
const relativeY = waveHeight * y + waveHeight / 2;
const multiplier = this.waveMultiplier * waveHeight * this.waveSign;
const multiplier = this.waveMultiplier * waveHeight;

// draw
this.drawingContext.lineWidth = this.lineThickness;
Expand Down
1 change: 0 additions & 1 deletion src/website/js/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class Renderer
this._normalAnalyserFft = CHANNEL_ANALYSER_FFT;
this._drumAnalyserFft = DRUMS_ANALYSER_FFT;
this.waveMultiplier = WAVE_MULTIPLIER;
this.waveSign = 1;

/**
* @type {boolean}
Expand Down
2 changes: 1 addition & 1 deletion src/website/js/settings_ui/settings_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const settingsHtml = `
<spessarange min='5' max='15' value='10' class='settings_slider' input_id='analyser_fft_slider' units=''></spessarange>
<label translate-path-title='locale.settings.rendererSettings.waveformAmplifier'></label>
<spessarange min='1' max='20' value='2' class='settings_slider' input_id='wave_multiplier_slider' units=''></spessarange>
<spessarange min='-10' max='10' value='2' class='settings_slider' input_id='wave_multiplier_slider' units=''></spessarange>
<div class='switch_label'>
<label for='analyser_toggler' translate-path-title='locale.settings.rendererSettings.toggleWaveformsRendering'></label>
Expand Down
4 changes: 2 additions & 2 deletions src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit 16698c0

Please sign in to comment.