spessasynth_lib 3.25.9 → 3.25.10
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/midi_parser/midi_builder.js +20 -1
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ export class MIDIBuilder extends BasicMIDI
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Adds a new
|
|
30
|
+
* Adds a new Set Tempo event
|
|
31
31
|
* @param ticks {number} the tick number of the event
|
|
32
32
|
* @param tempo {number} the tempo in beats per minute (BPM)
|
|
33
33
|
*/
|
|
@@ -138,6 +138,25 @@ export class MIDIBuilder extends BasicMIDI
|
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Adds a new Program Change event
|
|
143
|
+
* @param ticks {number} the tick time of the event
|
|
144
|
+
* @param track {number} the track number to use
|
|
145
|
+
* @param channel {number} the channel to use
|
|
146
|
+
* @param programNumber {number} the MIDI program to use
|
|
147
|
+
*/
|
|
148
|
+
addProgramChange(ticks, track, channel, programNumber)
|
|
149
|
+
{
|
|
150
|
+
channel %= 16;
|
|
151
|
+
programNumber %= 128;
|
|
152
|
+
this.addEvent(
|
|
153
|
+
ticks,
|
|
154
|
+
track,
|
|
155
|
+
messageTypes.programChange | channel,
|
|
156
|
+
[programNumber]
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
141
160
|
/**
|
|
142
161
|
* Adds a new Controller Change event
|
|
143
162
|
* @param ticks {number} the tick time of the event
|