spessasynth_lib 3.24.26 → 3.24.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import {
7
7
  customResetArray,
8
8
  dataEntryStates,
9
9
  NON_CC_INDEX_OFFSET,
10
+ PORTAMENTO_CONTROL_UNSET,
10
11
  resetArray
11
12
  } from "../../worklet_utilities/controller_tables.js";
12
13
  import { midiControllers } from "../../../../midi_parser/midi_message.js";
@@ -130,8 +131,14 @@ export function resetControllers()
130
131
  const resetValue = resetArray[i];
131
132
  if (this.midiControllers[i] !== resetValue && i < 127)
132
133
  {
133
- // reset if reset
134
- this.controllerChange(i, resetValue >> 7);
134
+ if (i === midiControllers.portamentoControl)
135
+ {
136
+ this.midiControllers[i] = PORTAMENTO_CONTROL_UNSET;
137
+ }
138
+ else
139
+ {
140
+ this.controllerChange(i, resetValue >> 7);
141
+ }
135
142
  }
136
143
  else
137
144
  {
@@ -201,7 +208,14 @@ export function resetControllersRP15Compliant()
201
208
  const resetValue = resetArray[i];
202
209
  if (!nonResetableCCs.has(i) && resetValue !== this.midiControllers[i])
203
210
  {
204
- this.controllerChange(i, resetValue);
211
+ if (i === midiControllers.portamentoControl)
212
+ {
213
+ this.midiControllers[i] = PORTAMENTO_CONTROL_UNSET;
214
+ }
215
+ else
216
+ {
217
+ this.controllerChange(i, resetValue >> 7);
218
+ }
205
219
  }
206
220
  }
207
221
  }
@@ -42,11 +42,12 @@ setResetValue(midiControllers.NRPNLsb, 127);
42
42
  setResetValue(midiControllers.NRPNMsb, 127);
43
43
 
44
44
 
45
+ export const PORTAMENTO_CONTROL_UNSET = 1;
45
46
  // special case: portamento control
46
47
  // since it is only 7-bit, only the values at multiple of 128 are allowed.
47
48
  // a value of just 1 indicates no key set, hence no portamento.
48
49
  // this is the "initial unset portamento key" flag.
49
- resetArray[midiControllers.portamentoControl] = 1;
50
+ resetArray[midiControllers.portamentoControl] = PORTAMENTO_CONTROL_UNSET;
50
51
 
51
52
  // pitch wheel
52
53
  setResetValue(NON_CC_INDEX_OFFSET + modulatorSources.pitchWheel, 64);
@@ -483,7 +483,7 @@ export function getWorkletVoices(channel,
483
483
  SpessaSynthTable([{
484
484
  Sample: sampleAndGenerators.sample.sampleName,
485
485
  Generators: generators,
486
- Modulators: sampleAndGenerators.modulators.map(m => m.debugString()),
486
+ Modulators: sampleAndGenerators.modulators.map(m => Modulator.debugString(m)),
487
487
  Velocity: velocity,
488
488
  TargetKey: targetKey,
489
489
  MidiNote: midiNote,