spessasynth_lib 3.24.10 → 3.24.11
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.
package/package.json
CHANGED
|
@@ -71,7 +71,7 @@ export function _playTo(time, ticks = undefined)
|
|
|
71
71
|
|
|
72
72
|
while (true)
|
|
73
73
|
{
|
|
74
|
-
// find next event
|
|
74
|
+
// find the next event
|
|
75
75
|
let trackIndex = this._findFirstEventIndex();
|
|
76
76
|
let event = this.tracks[trackIndex][this.eventIndex[trackIndex]];
|
|
77
77
|
if (ticks !== undefined)
|
|
@@ -91,12 +91,20 @@ export function _playTo(time, ticks = undefined)
|
|
|
91
91
|
|
|
92
92
|
// skip note ons
|
|
93
93
|
const info = getEvent(event.messageStatusByte);
|
|
94
|
-
// Keep in mind midi ports to determine channel
|
|
94
|
+
// Keep in mind midi ports to determine the channel!
|
|
95
95
|
const channel = info.channel + (this.midiPortChannelOffsets[this.midiPorts[trackIndex]] || 0);
|
|
96
96
|
switch (info.status)
|
|
97
97
|
{
|
|
98
98
|
// skip note messages
|
|
99
99
|
case messageTypes.noteOn:
|
|
100
|
+
// track portamento control as last note
|
|
101
|
+
if (savedControllers[channel] === undefined)
|
|
102
|
+
{
|
|
103
|
+
savedControllers[channel] = Array.from(defaultControllerArray);
|
|
104
|
+
}
|
|
105
|
+
savedControllers[channel][midiControllers.portamentoControl] = event.messageData[0];
|
|
106
|
+
break;
|
|
107
|
+
|
|
100
108
|
case messageTypes.noteOff:
|
|
101
109
|
case messageTypes.keySignature:
|
|
102
110
|
break;
|
|
@@ -120,7 +128,7 @@ export function _playTo(time, ticks = undefined)
|
|
|
120
128
|
let ccV = event.messageData[1];
|
|
121
129
|
if (controllerNumber === midiControllers.bankSelect)
|
|
122
130
|
{
|
|
123
|
-
// add the bank to saved
|
|
131
|
+
// add the bank to be saved
|
|
124
132
|
programs[channel].bank = ccV;
|
|
125
133
|
break;
|
|
126
134
|
}
|
|
@@ -153,7 +161,7 @@ export function _playTo(time, ticks = undefined)
|
|
|
153
161
|
}
|
|
154
162
|
|
|
155
163
|
this.eventIndex[trackIndex]++;
|
|
156
|
-
// find next event
|
|
164
|
+
// find the next event
|
|
157
165
|
trackIndex = this._findFirstEventIndex();
|
|
158
166
|
let nextEvent = this.tracks[trackIndex][this.eventIndex[trackIndex]];
|
|
159
167
|
if (nextEvent === undefined)
|
|
@@ -239,7 +247,7 @@ export function _playTo(time, ticks = undefined)
|
|
|
239
247
|
|
|
240
248
|
/**
|
|
241
249
|
* Starts the playback
|
|
242
|
-
* @param resetTime {boolean} If true, time is set to
|
|
250
|
+
* @param resetTime {boolean} If true, time is set to 0 s
|
|
243
251
|
* @this {WorkletSequencer}
|
|
244
252
|
*/
|
|
245
253
|
export function play(resetTime = false)
|
|
@@ -249,7 +257,7 @@ export function play(resetTime = false)
|
|
|
249
257
|
return;
|
|
250
258
|
}
|
|
251
259
|
|
|
252
|
-
// reset the time if
|
|
260
|
+
// reset the time if necessary
|
|
253
261
|
if (resetTime)
|
|
254
262
|
{
|
|
255
263
|
this.pausedTime = undefined;
|
|
@@ -108,7 +108,7 @@ export function loadNewSequence(parsedMidi, autoPlay = true)
|
|
|
108
108
|
this.tracks = this.midiData.tracks;
|
|
109
109
|
|
|
110
110
|
// copy over the port data
|
|
111
|
-
this.midiPorts = this.midiData.midiPorts;
|
|
111
|
+
this.midiPorts = this.midiData.midiPorts.slice();
|
|
112
112
|
|
|
113
113
|
// clear last port data
|
|
114
114
|
this.midiPortChannelOffset = 0;
|