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.
@@ -27,7 +27,7 @@ export class MIDIBuilder extends BasicMIDI
27
27
  }
28
28
 
29
29
  /**
30
- * Adds a new "set tempo" message
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_lib",
3
- "version": "3.25.9",
3
+ "version": "3.25.10",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "browser": "index.js",
6
6
  "type": "module",