spessasynth_lib 3.13.1 → 3.14.1

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.
@@ -1,6 +1,6 @@
1
1
  import { WORKLET_PROCESSOR_NAME } from '../synthetizer.js'
2
2
  import { consoleColors } from '../../utils/other.js'
3
- import { SpessaSynthProcessor } from './main_processor.js'
3
+ import { SpessaSynthProcessor } from './combine_class.js'
4
4
  import { SpessaSynthInfo } from '../../utils/loggin.js'
5
5
 
6
6
 
@@ -18,9 +18,11 @@ export function getOscillatorData(voice, sampleData, outputBuffer)
18
18
 
19
19
  if(loop)
20
20
  {
21
- for (let i = 0; i < outputBuffer.length; i++) {
21
+ for (let i = 0; i < outputBuffer.length; i++)
22
+ {
22
23
  // check for loop
23
- while(cur >= voice.sample.loopEnd) {
24
+ while(cur >= voice.sample.loopEnd)
25
+ {
24
26
  cur -= loopLength;
25
27
  }
26
28
 
@@ -28,10 +30,16 @@ export function getOscillatorData(voice, sampleData, outputBuffer)
28
30
  const floor = ~~cur;
29
31
  let ceil = floor + 1;
30
32
 
31
- while(ceil >= voice.sample.loopEnd) {
33
+ while(ceil >= voice.sample.loopEnd)
34
+ {
32
35
  ceil -= loopLength;
33
36
  }
34
37
 
38
+ // nearest neighbor (uncomment to use)
39
+ // outputBuffer[i] = sampleData[ceil];
40
+ // cur += voice.sample.playbackStep * voice.currentTuningCalculated;
41
+ // continue;
42
+
35
43
  const fraction = cur - floor;
36
44
 
37
45
  // grab the samples and interpolate
@@ -69,8 +77,9 @@ export function getOscillatorData(voice, sampleData, outputBuffer)
69
77
  return;
70
78
  }
71
79
 
72
- // cur += voice.sample.playbackStep * voice.currentTuningCalculated;
80
+ // nearest neighbor (uncomment to use)
73
81
  // outputBuffer[i] = sampleData[ceil];
82
+ // cur += voice.sample.playbackStep * voice.currentTuningCalculated;
74
83
  // continue;
75
84
 
76
85
  const fraction = cur - floor;
@@ -7,6 +7,7 @@ import { modulatorSources } from '../../../soundfont/read/modulators.js'
7
7
  * @property {Float32Array} customControllers - array of custom (not sf2) control values such as RPN pitch tuning, transpose, modulation depth, etc.
8
8
  *
9
9
  * @property {number} channelTransposeKeyShift - key shift of the channel
10
+ * @property {Int8Array} channelOctaveTuning - the tuning for octave on this channel
10
11
  * @property {boolean} holdPedal - indicates whether the hold pedal is active
11
12
  * @property {boolean} drumChannel - indicates whether the channel is a drum channel
12
13
  *
@@ -57,6 +58,7 @@ export function createWorkletChannel(sendEvent = false)
57
58
  presetUsesOverride: false,
58
59
 
59
60
  channelTransposeKeyShift: 0,
61
+ channelOctaveTuning: new Int8Array(12),
60
62
  channelVibrato: {delay: 0, depth: 0, rate: 0},
61
63
  lockVibrato: false,
62
64
  holdPedal: false,