spessasynth_core 4.3.6 → 4.3.7
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/dist/index.d.ts +612 -453
- package/dist/index.js +752 -343
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1416,10 +1416,6 @@ interface InsertionProcessorSnapshot {
|
|
|
1416
1416
|
* 20 parameters for the effect, 255 means "no change" + 3 effect sends (index 20, 21, 22)
|
|
1417
1417
|
*/
|
|
1418
1418
|
params: Uint8Array;
|
|
1419
|
-
/**
|
|
1420
|
-
* A boolean list for channels that have the insertion effect enabled.
|
|
1421
|
-
*/
|
|
1422
|
-
channels: boolean[];
|
|
1423
1419
|
}
|
|
1424
1420
|
type InsertionProcessorConstructor = new (sampleRate: number, maxBufferSize: number) => InsertionProcessor;
|
|
1425
1421
|
//#endregion
|
|
@@ -1628,578 +1624,627 @@ declare const NonRegisteredLSB: {
|
|
|
1628
1624
|
readonly envelopeReleaseTime: 102;
|
|
1629
1625
|
};
|
|
1630
1626
|
//#endregion
|
|
1631
|
-
//#region src/synthesizer/audio_engine/channel/
|
|
1632
|
-
interface
|
|
1633
|
-
/**
|
|
1634
|
-
* The current pressure (aftertouch) of this channel.
|
|
1635
|
-
*/
|
|
1636
|
-
pressure: number;
|
|
1627
|
+
//#region src/synthesizer/audio_engine/channel/awe32_nrpn.d.ts
|
|
1628
|
+
interface ChannelGenerators {
|
|
1637
1629
|
/**
|
|
1638
|
-
*
|
|
1630
|
+
* An array of offsets generators for SF2 NRPN support.
|
|
1631
|
+
* A value of 0 means no change; -10 means 10 lower, etc.
|
|
1639
1632
|
*/
|
|
1640
|
-
|
|
1633
|
+
offsets: Int16Array;
|
|
1641
1634
|
/**
|
|
1642
|
-
*
|
|
1635
|
+
* A small optimization that disables applying offsets until at least one is set.
|
|
1643
1636
|
*/
|
|
1644
|
-
|
|
1637
|
+
offsetsEnabled: boolean;
|
|
1645
1638
|
/**
|
|
1646
|
-
*
|
|
1647
|
-
*
|
|
1648
|
-
*
|
|
1649
|
-
* but it may vary for different sound banks.
|
|
1650
|
-
* For example, if a MIDI requests a modulation depth of 100 cents,
|
|
1651
|
-
* the multiplier will be 2,
|
|
1652
|
-
* which, for a preset with a depth of 50,
|
|
1653
|
-
* will create a total modulation depth of 100 cents.
|
|
1639
|
+
* An array of overrides generators for AWE32 NRPN support.
|
|
1640
|
+
* A value of GENERATOR_OVERRIDE_NO_CHANGE_VALUE (-32,767) means no change;
|
|
1641
|
+
* other values replace current generators.
|
|
1654
1642
|
*/
|
|
1655
|
-
|
|
1643
|
+
overrides: Int16Array;
|
|
1656
1644
|
/**
|
|
1657
|
-
*
|
|
1658
|
-
* This allows triggering multiple parts (channels) with a single note message.
|
|
1659
|
-
* @remarks
|
|
1660
|
-
* Only used when customChannelNumbers is enabled.
|
|
1645
|
+
* A small optimization that disables applying overrides until at least one is set.
|
|
1661
1646
|
*/
|
|
1662
|
-
|
|
1647
|
+
overridesEnabled: boolean;
|
|
1648
|
+
}
|
|
1649
|
+
//#endregion
|
|
1650
|
+
//#region src/synthesizer/enums.d.ts
|
|
1651
|
+
/**
|
|
1652
|
+
* The available interpolation types of the synthesizer.
|
|
1653
|
+
*/
|
|
1654
|
+
declare const InterpolationTypes: {
|
|
1655
|
+
readonly linear: 0;
|
|
1656
|
+
readonly nearestNeighbor: 1;
|
|
1657
|
+
readonly hermite: 2;
|
|
1658
|
+
};
|
|
1659
|
+
type InterpolationType = (typeof InterpolationTypes)[keyof typeof InterpolationTypes];
|
|
1660
|
+
//#endregion
|
|
1661
|
+
//#region src/synthesizer/audio_engine/channel/parameters/system.d.ts
|
|
1662
|
+
/**
|
|
1663
|
+
* The system parameters of the channel.
|
|
1664
|
+
* These can only be changed via the API.
|
|
1665
|
+
*/
|
|
1666
|
+
interface ChannelSystemParameter {
|
|
1663
1667
|
/**
|
|
1664
|
-
* If the
|
|
1665
|
-
* - `true` - POLY ON - regular playback.
|
|
1666
|
-
* - `false` - MONO ON - one note per channel,
|
|
1667
|
-
* highest still pressed note is restored after releasing the currently playing one.
|
|
1668
|
+
* If the preset is locked, preventing any program changes from being sent.
|
|
1668
1669
|
*/
|
|
1669
|
-
|
|
1670
|
+
presetLock: boolean;
|
|
1670
1671
|
/**
|
|
1671
|
-
*
|
|
1672
|
-
*
|
|
1672
|
+
* If the channel should not produce any sound
|
|
1673
|
+
* and ignore incoming Note On messages.
|
|
1673
1674
|
*/
|
|
1674
|
-
|
|
1675
|
+
isMuted: boolean;
|
|
1675
1676
|
/**
|
|
1676
|
-
*
|
|
1677
|
-
*
|
|
1677
|
+
* The gain for the channel.
|
|
1678
|
+
* From 0 to any number. 1 is 100% volume.
|
|
1678
1679
|
*/
|
|
1679
|
-
|
|
1680
|
+
gain: number;
|
|
1680
1681
|
/**
|
|
1681
|
-
*
|
|
1682
|
+
* The panning of the channel.
|
|
1683
|
+
* -1 (left) to 1 (right). 0 is center.
|
|
1682
1684
|
*/
|
|
1683
|
-
|
|
1685
|
+
pan: number;
|
|
1684
1686
|
/**
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
* This is initialized to a mode suitable for each Part, so for general purposes there is no need to change this.
|
|
1688
|
-
*
|
|
1689
|
-
* - 0 - Single: If the same note is played multiple times in succession, the previously-sounding note will be completely silenced, and then the new note will be sounded.
|
|
1690
|
-
* - 1 - LimitedMulti: If the same note is played multiple times in succession, the previously-sounding note will be continued to a certain extent even after the new note is sounded. (Default setting)
|
|
1691
|
-
* - 2 - FullMulti: If the same note is played multiple times in succession, the previously-sounding note(s) will continue sounding for their natural length even after the new note is sounded.
|
|
1692
|
-
*
|
|
1693
|
-
* SpessaSynth treats LimitedMulti like FullMulti.
|
|
1694
|
-
* Essentially Limited and Full are normal
|
|
1695
|
-
* and Single is like `monophonicRetrigger` system parameter.
|
|
1687
|
+
* The channel key shift in semitones.
|
|
1688
|
+
* Drum channels DO NOT ignore this value.
|
|
1696
1689
|
*/
|
|
1697
|
-
|
|
1690
|
+
keyShift: number;
|
|
1698
1691
|
/**
|
|
1699
|
-
*
|
|
1692
|
+
* The channel tuning in cents.
|
|
1693
|
+
* Drum channels DO NOT ignore this value.
|
|
1700
1694
|
*/
|
|
1701
|
-
|
|
1695
|
+
fineTune: number;
|
|
1702
1696
|
/**
|
|
1703
|
-
*
|
|
1704
|
-
*
|
|
1705
|
-
*
|
|
1697
|
+
* The interpolation type used for sample playback.
|
|
1698
|
+
*
|
|
1699
|
+
* Overrides the global parameter if set.
|
|
1706
1700
|
*/
|
|
1707
|
-
|
|
1701
|
+
interpolationType: InterpolationType | null;
|
|
1708
1702
|
/**
|
|
1709
|
-
*
|
|
1710
|
-
*
|
|
1711
|
-
*
|
|
1703
|
+
* If the channel should prevent changing any parameters via NRPN.
|
|
1704
|
+
*
|
|
1705
|
+
* Overrides the global parameter if set.
|
|
1712
1706
|
*/
|
|
1713
|
-
|
|
1707
|
+
nrpnParamLock: boolean | null;
|
|
1714
1708
|
/**
|
|
1715
|
-
*
|
|
1716
|
-
*
|
|
1717
|
-
*
|
|
1709
|
+
* Indicates whether the channel is in monophonic retrigger mode.
|
|
1710
|
+
* This emulates the behavior of Microsoft GS Wavetable Synth,
|
|
1711
|
+
* Where a new note will kill the previous one if it is still playing.
|
|
1718
1712
|
*
|
|
1719
|
-
*
|
|
1713
|
+
* Overrides the global parameter if set.
|
|
1720
1714
|
*/
|
|
1721
|
-
|
|
1715
|
+
monophonicRetrigger: boolean | null;
|
|
1722
1716
|
}
|
|
1723
|
-
declare const
|
|
1717
|
+
declare const DEFAULT_CHANNEL_SYSTEM_PARAMETERS: ChannelSystemParameter;
|
|
1718
|
+
/**
|
|
1719
|
+
* Sets a system parameter of the channel
|
|
1720
|
+
* @param parameter The type of the system parameter to set.
|
|
1721
|
+
* @param value The value to set for the system parameter.
|
|
1722
|
+
*/
|
|
1723
|
+
declare function setSystemParameterInternal<P extends keyof ChannelSystemParameter>(this: MIDIChannel, parameter: P, value: ChannelSystemParameter[P]): void;
|
|
1724
1724
|
//#endregion
|
|
1725
|
-
//#region src/synthesizer/audio_engine/channel/
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
channel: number;
|
|
1731
|
-
/** The velocity of the note. */
|
|
1732
|
-
velocity: number;
|
|
1733
|
-
}
|
|
1734
|
-
interface NoteOffCallback {
|
|
1735
|
-
/** The MIDI note number. */
|
|
1736
|
-
midiNote: number;
|
|
1737
|
-
/** The MIDI channel number. */
|
|
1738
|
-
channel: number;
|
|
1739
|
-
}
|
|
1740
|
-
interface ProgramChangeCallback extends MIDIPatchFull {
|
|
1741
|
-
/** The MIDI channel number. */
|
|
1742
|
-
channel: number;
|
|
1743
|
-
}
|
|
1744
|
-
interface ControllerChangeCallback {
|
|
1745
|
-
/** The MIDI channel number. */
|
|
1746
|
-
channel: number;
|
|
1747
|
-
/** The controller number. */
|
|
1748
|
-
controller: MIDIController;
|
|
1749
|
-
/** The value of the controller. */
|
|
1750
|
-
value: number;
|
|
1751
|
-
}
|
|
1752
|
-
interface PolyPressureCallback {
|
|
1753
|
-
/** The MIDI channel number. */
|
|
1754
|
-
channel: number;
|
|
1755
|
-
/** The MIDI note number. */
|
|
1756
|
-
midiNote: number;
|
|
1757
|
-
/** The pressure value. */
|
|
1758
|
-
pressure: number;
|
|
1759
|
-
}
|
|
1760
|
-
interface StopAllCallback {
|
|
1725
|
+
//#region src/synthesizer/audio_engine/channel/midi_channel.d.ts
|
|
1726
|
+
/**
|
|
1727
|
+
* This class represents a single MIDI Channel within the synthesizer.
|
|
1728
|
+
*/
|
|
1729
|
+
declare class MIDIChannel {
|
|
1761
1730
|
/**
|
|
1762
|
-
* The MIDI channel
|
|
1731
|
+
* The currently selected MIDI patch of the channel.
|
|
1732
|
+
* Note that the exact matching preset may not be available, but this represents exactly what MIDI asks for.
|
|
1763
1733
|
*/
|
|
1764
|
-
|
|
1734
|
+
readonly patch: MIDIPatch;
|
|
1765
1735
|
/**
|
|
1766
|
-
*
|
|
1736
|
+
* The preset currently assigned to the channel.
|
|
1737
|
+
* Note that this may be undefined in some cases.
|
|
1767
1738
|
*/
|
|
1768
|
-
|
|
1769
|
-
}
|
|
1770
|
-
type ChannelMIDIParameterChange = { [P in keyof ChannelMIDIParameter]: {
|
|
1739
|
+
preset?: BasicPreset;
|
|
1771
1740
|
/**
|
|
1772
|
-
* The channel
|
|
1741
|
+
* The channel's number (0-based index)
|
|
1773
1742
|
*/
|
|
1774
|
-
channel: number;
|
|
1743
|
+
readonly channel: number;
|
|
1775
1744
|
/**
|
|
1776
|
-
*
|
|
1745
|
+
* Sets a system parameter of the channel.
|
|
1746
|
+
* @param parameter The type of the system parameter to set.
|
|
1747
|
+
* @param value The value to set for the system parameter.
|
|
1777
1748
|
*/
|
|
1778
|
-
|
|
1749
|
+
readonly setSystemParameter: typeof setSystemParameterInternal;
|
|
1779
1750
|
/**
|
|
1780
|
-
*
|
|
1751
|
+
* Locks or unlocks a given Channel MIDI Parameter.
|
|
1752
|
+
* This prevents any changes to it until it's unlocked.
|
|
1753
|
+
* @param parameter The Channel MIDI Parameter to lock.
|
|
1754
|
+
* @param isLocked If the parameter should be locked.
|
|
1781
1755
|
*/
|
|
1782
|
-
|
|
1783
|
-
} }[keyof ChannelMIDIParameter];
|
|
1784
|
-
//#endregion
|
|
1785
|
-
//#region src/synthesizer/enums.d.ts
|
|
1786
|
-
/**
|
|
1787
|
-
* The available interpolation types of the synthesizer.
|
|
1788
|
-
*/
|
|
1789
|
-
declare const InterpolationTypes: {
|
|
1790
|
-
readonly linear: 0;
|
|
1791
|
-
readonly nearestNeighbor: 1;
|
|
1792
|
-
readonly hermite: 2;
|
|
1793
|
-
};
|
|
1794
|
-
type InterpolationType = (typeof InterpolationTypes)[keyof typeof InterpolationTypes];
|
|
1795
|
-
//#endregion
|
|
1796
|
-
//#region src/synthesizer/audio_engine/parameters/system.d.ts
|
|
1797
|
-
/**
|
|
1798
|
-
* The global parameters of the synthesizer.
|
|
1799
|
-
* These can only be changed via the API.
|
|
1800
|
-
*/
|
|
1801
|
-
interface GlobalSystemParameter {
|
|
1756
|
+
readonly lockMIDIParameter: typeof lockMIDIParameterInternal;
|
|
1802
1757
|
/**
|
|
1803
|
-
*
|
|
1758
|
+
* An array of MIDI controllers for the channel.
|
|
1759
|
+
* This array is used to store the state of various MIDI controllers
|
|
1760
|
+
* such as volume, pan, modulation, etc.
|
|
1761
|
+
* @remarks
|
|
1762
|
+
* A bit of an explanation:
|
|
1763
|
+
* The controller table is stored as an int16 array, it stores 14-bit values, allowing for full 14-bit LSB resolution.
|
|
1764
|
+
* The only exception from this are the Registered and Non-Registered Parameter Numbers.
|
|
1765
|
+
* Data entries do store it!
|
|
1804
1766
|
*/
|
|
1805
|
-
|
|
1767
|
+
protected readonly _midiControllers: Int16Array;
|
|
1806
1768
|
/**
|
|
1807
|
-
*
|
|
1769
|
+
* An array of octave tuning values for each note on the channel.
|
|
1770
|
+
* Each index corresponds to a note (0 = C, 1 = C#, ..., 11 = B).
|
|
1771
|
+
* Note: Repeated every 12 notes.
|
|
1808
1772
|
*/
|
|
1809
|
-
|
|
1773
|
+
protected readonly octaveTuning: Int8Array;
|
|
1774
|
+
protected readonly _midiParameters: Readonly<ChannelMIDIParameter>;
|
|
1810
1775
|
/**
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
1814
|
-
*
|
|
1815
|
-
* Decreasing it does not cause memory usage change, so it's fine to use.
|
|
1776
|
+
* Note On message tracking, for grouping voices for specific Note On messages.
|
|
1777
|
+
* Used for overlapping Note Ons.
|
|
1778
|
+
* MIDI note: current note on ID
|
|
1779
|
+
* @protected
|
|
1816
1780
|
*/
|
|
1817
|
-
|
|
1781
|
+
protected readonly noteOnID: number[];
|
|
1818
1782
|
/**
|
|
1819
|
-
*
|
|
1820
|
-
*
|
|
1821
|
-
*
|
|
1783
|
+
* Note Off message tracking, for grouping voices for specific Note On messages.
|
|
1784
|
+
* Used for overlapping Note Ons.
|
|
1785
|
+
* MIDI note: current note on ID
|
|
1786
|
+
* @protected
|
|
1822
1787
|
*/
|
|
1823
|
-
|
|
1788
|
+
protected readonly noteOffID: number[];
|
|
1824
1789
|
/**
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1790
|
+
* If the last Parameter was RPN.
|
|
1791
|
+
* If false then the last parameter was NRPN.
|
|
1792
|
+
* @protected
|
|
1827
1793
|
*/
|
|
1828
|
-
|
|
1794
|
+
protected lastParameterIsRegistered: boolean;
|
|
1829
1795
|
/**
|
|
1830
|
-
*
|
|
1831
|
-
*
|
|
1832
|
-
* the recommended use case would be setting
|
|
1833
|
-
* the reverb parameters then locking it to prevent changes by MIDI files.
|
|
1796
|
+
* Per-note pitch wheel mode uses the pitchWheels table as source
|
|
1797
|
+
* instead of the regular entry in the midiControllers table.
|
|
1834
1798
|
*/
|
|
1835
|
-
|
|
1799
|
+
protected perNotePitch: boolean;
|
|
1836
1800
|
/**
|
|
1837
|
-
*
|
|
1838
|
-
*
|
|
1801
|
+
* Current pan in range [-500;500]
|
|
1802
|
+
* Updated in `updateInternalParams`.
|
|
1803
|
+
* This is used to avoid a big addition for every voice rendering call.
|
|
1839
1804
|
*/
|
|
1840
|
-
|
|
1805
|
+
protected currentPan: number;
|
|
1841
1806
|
/**
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
1845
|
-
* the chorus parameters then locking it to prevent changes by MIDI files.
|
|
1807
|
+
* Current tuning in cents.
|
|
1808
|
+
* Updated in `updateInternalParams`.
|
|
1809
|
+
* This is used to avoid a big addition for every voice rendering call.
|
|
1846
1810
|
*/
|
|
1847
|
-
|
|
1811
|
+
protected currentTuning: number;
|
|
1848
1812
|
/**
|
|
1849
|
-
*
|
|
1850
|
-
*
|
|
1813
|
+
* Current key-shift.
|
|
1814
|
+
* Updated in `updateInternalParams`.
|
|
1851
1815
|
*/
|
|
1852
|
-
|
|
1816
|
+
protected currentKeyShift: number;
|
|
1853
1817
|
/**
|
|
1854
|
-
*
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
* the delay parameters then locking it to prevent changes by MIDI files.
|
|
1818
|
+
* Current gain.
|
|
1819
|
+
* Updated in `updateInternalParams`.
|
|
1820
|
+
* This is used to avoid a big multiplication for every voice rendering call.
|
|
1858
1821
|
*/
|
|
1859
|
-
|
|
1822
|
+
protected currentGain: number;
|
|
1860
1823
|
/**
|
|
1861
|
-
*
|
|
1862
|
-
*
|
|
1863
|
-
*
|
|
1864
|
-
*
|
|
1824
|
+
* The last pressed note on this channel for portamento tracking.
|
|
1825
|
+
* -1 means none.
|
|
1826
|
+
* This is not a `ChannelMIDIParameter` and is strictly internal,
|
|
1827
|
+
* mostly because we don't want to send events for every note on message.
|
|
1828
|
+
* It can be set with Portamento Control CC anyway.
|
|
1829
|
+
* @protected
|
|
1865
1830
|
*/
|
|
1866
|
-
|
|
1831
|
+
protected lastPortamentoNote: number;
|
|
1867
1832
|
/**
|
|
1868
|
-
* If the
|
|
1869
|
-
*
|
|
1870
|
-
*
|
|
1871
|
-
*
|
|
1833
|
+
* If the portamento should be executed once regardless of Portamento on/off.
|
|
1834
|
+
* Adhering to the MIDI spec, CC#84 ignores on/off.
|
|
1835
|
+
* This is also not a `ChannelMIDIParameter` for the same reason as `lastPortamentoNote`
|
|
1836
|
+
* @protected
|
|
1872
1837
|
*/
|
|
1873
|
-
|
|
1838
|
+
protected portamentoForce: boolean;
|
|
1874
1839
|
/**
|
|
1875
|
-
*
|
|
1840
|
+
* The last pressed note on this channel in mono mode.
|
|
1841
|
+
* Used for tracking and releasing this note on a new Note On event.
|
|
1842
|
+
* -1 means none.
|
|
1843
|
+
* @protected
|
|
1876
1844
|
*/
|
|
1877
|
-
|
|
1845
|
+
protected lastMonoNote: number;
|
|
1878
1846
|
/**
|
|
1879
|
-
*
|
|
1847
|
+
* The last pressed note's velocity on this channel in mono mode.
|
|
1848
|
+
* @protected
|
|
1880
1849
|
*/
|
|
1881
|
-
|
|
1850
|
+
protected lastMonoVelocity: number;
|
|
1882
1851
|
/**
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1852
|
+
* For Mono Mode restoring notes.
|
|
1853
|
+
* playingNotes[midiNote]
|
|
1854
|
+
* @protected
|
|
1885
1855
|
*/
|
|
1886
|
-
|
|
1856
|
+
protected readonly playingNotes: boolean[];
|
|
1857
|
+
protected readonly generators: ChannelGenerators;
|
|
1858
|
+
protected readonly computeModulator: (voice: Voice, pitchWheel: number, modulatorIndex: number) => number;
|
|
1859
|
+
protected readonly computeModulators: (voice: Voice, sourceUsesCC?: 0 | 1 | -1 | undefined, sourceIndex?: number | undefined) => void;
|
|
1887
1860
|
/**
|
|
1888
|
-
*
|
|
1889
|
-
* From -1 (left) to 1 (right). 0 is center.
|
|
1861
|
+
* Current amount of voices that are playing on this channel.
|
|
1890
1862
|
*/
|
|
1891
|
-
|
|
1863
|
+
protected _voiceCount: number;
|
|
1892
1864
|
/**
|
|
1893
|
-
*
|
|
1894
|
-
* Drum channels ignore this value.
|
|
1865
|
+
* Current amount of voices that are playing on this channel.
|
|
1895
1866
|
*/
|
|
1896
|
-
|
|
1867
|
+
get voiceCount(): number;
|
|
1897
1868
|
/**
|
|
1898
|
-
*
|
|
1899
|
-
* Drum channels ignore this value.
|
|
1869
|
+
* Indicates whether this channel is a drum channel.
|
|
1900
1870
|
*/
|
|
1901
|
-
|
|
1871
|
+
protected _drumChannel: boolean;
|
|
1902
1872
|
/**
|
|
1903
|
-
*
|
|
1873
|
+
* Indicates whether this channel is a drum channel.
|
|
1904
1874
|
*/
|
|
1905
|
-
|
|
1875
|
+
get drumChannel(): boolean;
|
|
1906
1876
|
/**
|
|
1907
|
-
*
|
|
1877
|
+
* An array of MIDI controllers for the channel.
|
|
1878
|
+
* This array is used to store the state of various MIDI controllers
|
|
1879
|
+
* such as volume, pan, modulation, etc.
|
|
1880
|
+
* @remarks
|
|
1881
|
+
* A bit of an explanation:
|
|
1882
|
+
* The controller table is stored as an int16 array, it stores 14-bit values, allowing for full 14-bit LSB resolution.
|
|
1883
|
+
* The only exception from this are the Registered and Non-Registered Parameter Numbers.
|
|
1884
|
+
* Data entries do store it!
|
|
1908
1885
|
*/
|
|
1909
|
-
|
|
1886
|
+
get midiControllers(): Readonly<Int16Array>;
|
|
1910
1887
|
/**
|
|
1911
|
-
*
|
|
1912
|
-
*
|
|
1913
|
-
* Where a new note will kill the previous one if it is still playing.
|
|
1888
|
+
* The channel system parameters of this channel.
|
|
1889
|
+
* These are only editable via the API.
|
|
1914
1890
|
*/
|
|
1915
|
-
|
|
1916
|
-
}
|
|
1917
|
-
declare const DEFAULT_GLOBAL_SYSTEM_PARAMETERS: GlobalSystemParameter;
|
|
1918
|
-
//#endregion
|
|
1919
|
-
//#region src/synthesizer/audio_engine/channel/awe32_nrpn.d.ts
|
|
1920
|
-
interface ChannelGenerators {
|
|
1891
|
+
get systemParameters(): Readonly<ChannelSystemParameter>;
|
|
1921
1892
|
/**
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1893
|
+
* The channel MIDI parameters of this channel.
|
|
1894
|
+
* These are only editable via MIDI messages.
|
|
1924
1895
|
*/
|
|
1925
|
-
|
|
1896
|
+
get midiParameters(): Readonly<ChannelMIDIParameter>;
|
|
1897
|
+
protected get channelSystem(): MIDISystem;
|
|
1926
1898
|
/**
|
|
1927
|
-
*
|
|
1899
|
+
* Locks or unlocks a given controller.
|
|
1900
|
+
* This prevents any changes to it until it's unlocked.
|
|
1901
|
+
* @param controller The MIDI controller number (0-127).
|
|
1902
|
+
* @param isLocked If the controller should be locked.
|
|
1928
1903
|
*/
|
|
1929
|
-
|
|
1904
|
+
lockController(this: MIDIChannel, controller: MIDIController, isLocked: boolean): void;
|
|
1930
1905
|
/**
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1906
|
+
* Changes the preset to, or from drums.
|
|
1907
|
+
* Note that this executes a program change.
|
|
1908
|
+
* @param isDrum If the channel should be a drum preset or not.
|
|
1934
1909
|
*/
|
|
1935
|
-
|
|
1910
|
+
setDrums(isDrum: boolean): void;
|
|
1936
1911
|
/**
|
|
1937
|
-
*
|
|
1912
|
+
* Stops all notes on the channel.
|
|
1913
|
+
* @param force If true, stops all notes immediately, otherwise applies release time.
|
|
1938
1914
|
*/
|
|
1939
|
-
|
|
1915
|
+
stopAllNotes(force?: boolean): void;
|
|
1916
|
+
protected resetGeneratorOverrides(): void;
|
|
1917
|
+
protected setGeneratorOverride(gen: GeneratorType, value: number, realtime?: boolean): void;
|
|
1918
|
+
protected resetGeneratorOffsets(): void;
|
|
1919
|
+
protected setGeneratorOffset(gen: GeneratorType, value: number): void;
|
|
1920
|
+
protected resetDrumParams(): void;
|
|
1921
|
+
protected computeModulatorsAll(sourceUsesCC: -1 | 0 | 1, sourceIndex: number): void;
|
|
1922
|
+
protected setBankMSB(bankMSB: number): void;
|
|
1923
|
+
protected setBankLSB(bankLSB: number): void;
|
|
1924
|
+
/**
|
|
1925
|
+
* Sets drums on channel.
|
|
1926
|
+
*/
|
|
1927
|
+
protected setDrumFlag(isDrum: boolean): void;
|
|
1940
1928
|
}
|
|
1941
1929
|
//#endregion
|
|
1942
|
-
//#region src/synthesizer/audio_engine/channel/parameters/
|
|
1943
|
-
|
|
1944
|
-
* The system parameters of the channel.
|
|
1945
|
-
* These can only be changed via the API.
|
|
1946
|
-
*/
|
|
1947
|
-
interface ChannelSystemParameter {
|
|
1930
|
+
//#region src/synthesizer/audio_engine/channel/parameters/midi.d.ts
|
|
1931
|
+
interface ChannelMIDIParameter {
|
|
1948
1932
|
/**
|
|
1949
|
-
*
|
|
1933
|
+
* The current pressure (aftertouch) of this channel.
|
|
1950
1934
|
*/
|
|
1951
|
-
|
|
1935
|
+
pressure: number;
|
|
1952
1936
|
/**
|
|
1953
|
-
*
|
|
1954
|
-
* and ignore incoming Note On messages.
|
|
1937
|
+
* The current pitch wheel value (0-16,383) of this channel.
|
|
1955
1938
|
*/
|
|
1956
|
-
|
|
1939
|
+
pitchWheel: number;
|
|
1957
1940
|
/**
|
|
1958
|
-
* The
|
|
1959
|
-
* From 0 to any number. 1 is 100% volume.
|
|
1941
|
+
* The current pitch wheel range, in semitones.
|
|
1960
1942
|
*/
|
|
1961
|
-
|
|
1943
|
+
pitchWheelRange: number;
|
|
1962
1944
|
/**
|
|
1963
|
-
* The
|
|
1964
|
-
*
|
|
1945
|
+
* The modulation depth in cents.
|
|
1946
|
+
* This is internally converted to a multiplier by dividing by 50.
|
|
1947
|
+
*
|
|
1948
|
+
* The MIDI specification assumes the default modulation depth is 50 cents,
|
|
1949
|
+
* but it may vary for different sound banks.
|
|
1950
|
+
* For example, if a MIDI requests a modulation depth of 100 cents,
|
|
1951
|
+
* the multiplier will be 2,
|
|
1952
|
+
* which, for a preset with a depth of 50,
|
|
1953
|
+
* will create a total modulation depth of 100 cents.
|
|
1965
1954
|
*/
|
|
1966
|
-
|
|
1955
|
+
modulationDepth: number;
|
|
1967
1956
|
/**
|
|
1968
|
-
* The channel
|
|
1969
|
-
*
|
|
1957
|
+
* The channel's receiving number (0-based index).
|
|
1958
|
+
* This allows triggering multiple parts (channels) with a single note message.
|
|
1959
|
+
* @remarks
|
|
1960
|
+
* Only used when customChannelNumbers is enabled.
|
|
1961
|
+
*/
|
|
1962
|
+
rxChannel: number;
|
|
1963
|
+
/**
|
|
1964
|
+
* If the channel is in the poly mode.
|
|
1965
|
+
* - `true` - POLY ON - regular playback.
|
|
1966
|
+
* - `false` - MONO ON - one note per channel,
|
|
1967
|
+
* highest still pressed note is restored after releasing the currently playing one.
|
|
1968
|
+
*/
|
|
1969
|
+
polyMode: boolean;
|
|
1970
|
+
/**
|
|
1971
|
+
* The key shift of the channel (in semitones).
|
|
1972
|
+
* Drum channels ignore this value.
|
|
1970
1973
|
*/
|
|
1971
1974
|
keyShift: number;
|
|
1972
1975
|
/**
|
|
1973
|
-
*
|
|
1974
|
-
* Drum channels
|
|
1976
|
+
* Cents, RPN/SysEx for fine-tuning.
|
|
1977
|
+
* Drum channels ignore this value.
|
|
1975
1978
|
*/
|
|
1976
1979
|
fineTune: number;
|
|
1977
1980
|
/**
|
|
1978
|
-
*
|
|
1979
|
-
*
|
|
1980
|
-
* Overrides the global parameter if set.
|
|
1981
|
+
* Enables random panning for every note played on this channel.
|
|
1981
1982
|
*/
|
|
1982
|
-
|
|
1983
|
+
randomPan: boolean;
|
|
1983
1984
|
/**
|
|
1984
|
-
*
|
|
1985
|
+
* Assign mode for the channel.
|
|
1986
|
+
* `ASSIGN MODE` is the parameter that determines how voice assignment will be handled when sounds overlap on identical note numbers in the same channel (i.e., repeatedly struck notes).
|
|
1987
|
+
* This is initialized to a mode suitable for each Part, so for general purposes there is no need to change this.
|
|
1985
1988
|
*
|
|
1986
|
-
*
|
|
1989
|
+
* - 0 - Single: If the same note is played multiple times in succession, the previously-sounding note will be completely silenced, and then the new note will be sounded.
|
|
1990
|
+
* - 1 - LimitedMulti: If the same note is played multiple times in succession, the previously-sounding note will be continued to a certain extent even after the new note is sounded. (Default setting)
|
|
1991
|
+
* - 2 - FullMulti: If the same note is played multiple times in succession, the previously-sounding note(s) will continue sounding for their natural length even after the new note is sounded.
|
|
1992
|
+
*
|
|
1993
|
+
* SpessaSynth treats LimitedMulti like FullMulti.
|
|
1994
|
+
* Essentially Limited and Full are normal
|
|
1995
|
+
* and Single is like `monophonicRetrigger` system parameter.
|
|
1987
1996
|
*/
|
|
1988
|
-
|
|
1997
|
+
assignMode: number;
|
|
1989
1998
|
/**
|
|
1990
|
-
* Indicates whether
|
|
1991
|
-
* This emulates the behavior of Microsoft GS Wavetable Synth,
|
|
1992
|
-
* Where a new note will kill the previous one if it is still playing.
|
|
1993
|
-
*
|
|
1994
|
-
* Overrides the global parameter if set.
|
|
1999
|
+
* Indicates whether this channel uses the insertion EFX processor.
|
|
1995
2000
|
*/
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1998
|
-
declare const DEFAULT_CHANNEL_SYSTEM_PARAMETERS: ChannelSystemParameter;
|
|
1999
|
-
/**
|
|
2000
|
-
* Sets a system parameter of the channel
|
|
2001
|
-
* @param parameter The type of the system parameter to set.
|
|
2002
|
-
* @param value The value to set for the system parameter.
|
|
2003
|
-
*/
|
|
2004
|
-
declare function setSystemParameterInternal<P extends keyof ChannelSystemParameter>(this: MIDIChannel, parameter: P, value: ChannelSystemParameter[P]): void;
|
|
2005
|
-
//#endregion
|
|
2006
|
-
//#region src/synthesizer/audio_engine/channel/midi_channel.d.ts
|
|
2007
|
-
/**
|
|
2008
|
-
* This class represents a single MIDI Channel within the synthesizer.
|
|
2009
|
-
*/
|
|
2010
|
-
declare class MIDIChannel {
|
|
2001
|
+
efxAssign: boolean;
|
|
2011
2002
|
/**
|
|
2012
|
-
*
|
|
2013
|
-
*
|
|
2003
|
+
* CC1 for GS controller matrix.
|
|
2004
|
+
* An arbitrary MIDI controller, which can be bound to any synthesis parameter.
|
|
2005
|
+
* Default is 16.
|
|
2014
2006
|
*/
|
|
2015
|
-
|
|
2007
|
+
cc1: MIDIController;
|
|
2016
2008
|
/**
|
|
2017
|
-
*
|
|
2018
|
-
*
|
|
2009
|
+
* CC2 for GS controller matrix.
|
|
2010
|
+
* An arbitrary MIDI controller, which can be bound to any synthesis parameter.
|
|
2011
|
+
* Default is 17.
|
|
2019
2012
|
*/
|
|
2020
|
-
|
|
2013
|
+
cc2: MIDIController;
|
|
2021
2014
|
/**
|
|
2022
|
-
*
|
|
2015
|
+
* Drum map for GS system exclusive tracking.
|
|
2016
|
+
* Only used for selecting the correct channel when setting drum parameters through sysEx,
|
|
2017
|
+
* as those don't specify the channel, but the drum number.
|
|
2018
|
+
*
|
|
2019
|
+
* The only values that are allowed are 0 (melodic) 1 or 2.
|
|
2023
2020
|
*/
|
|
2024
|
-
|
|
2021
|
+
drumMap: number;
|
|
2025
2022
|
/**
|
|
2026
|
-
*
|
|
2027
|
-
*
|
|
2028
|
-
*
|
|
2023
|
+
* The relation between the input and the actual velocity.
|
|
2024
|
+
*
|
|
2025
|
+
* If Velo Depth is increased, small differences in your playing dynamics will make a large difference in the loudness of the sound.
|
|
2026
|
+
* If Velo Depth is decreased, even large differences in your playing dynamics will make only a small difference in the loudness of the sound.
|
|
2027
|
+
*
|
|
2028
|
+
* Examples (with offset being set to normal):
|
|
2029
|
+
*
|
|
2030
|
+
* - 64 is normal.
|
|
2031
|
+
* - 32 is half velocity at max volume.
|
|
2032
|
+
* - 127 is max velocity at half volume.
|
|
2033
|
+
*
|
|
2034
|
+
* Refer to [SC-8850 Owner's Manual](https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf), page 56.
|
|
2029
2035
|
*/
|
|
2030
|
-
|
|
2036
|
+
velocitySenseDepth: number;
|
|
2031
2037
|
/**
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2035
|
-
*
|
|
2036
|
-
*
|
|
2037
|
-
*
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2038
|
+
* The offset to add to the input velocity.
|
|
2039
|
+
*
|
|
2040
|
+
* If Velo Offset is set higher than 64, even softly played notes (i.e., notes with a low velocity)
|
|
2041
|
+
* will be sounded loudly. If Velo Offset is set lower than 64,
|
|
2042
|
+
* even strongly played notes (i.e., notes with a high velocity) will be sounded softly.
|
|
2043
|
+
*
|
|
2044
|
+
* Examples (with depth set to normal):
|
|
2045
|
+
*
|
|
2046
|
+
* - 64 is normal.
|
|
2047
|
+
* - 32 is silent until half velocity, max velocity is half volume.
|
|
2048
|
+
* - 96 starts at half volume and reaches max volume at half velocity.
|
|
2049
|
+
* - 127 always forces velocity to max.
|
|
2050
|
+
*
|
|
2051
|
+
* Refer to [SC-8850 Owner's Manual](https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf), page 56.
|
|
2040
2052
|
*/
|
|
2041
|
-
|
|
2053
|
+
velocitySenseOffset: number;
|
|
2054
|
+
}
|
|
2055
|
+
declare const DEFAULT_CHANNEL_MIDI_PARAMETERS: ChannelMIDIParameter;
|
|
2056
|
+
/**
|
|
2057
|
+
* Locks or unlocks a given Channel MIDI Parameter.
|
|
2058
|
+
* This prevents any changes to it until it's unlocked.
|
|
2059
|
+
* @param parameter The Channel MIDI Parameter to lock.
|
|
2060
|
+
* @param isLocked If the parameter should be locked.
|
|
2061
|
+
*/
|
|
2062
|
+
declare function lockMIDIParameterInternal<P extends keyof ChannelMIDIParameter>(this: MIDIChannel, parameter: P, isLocked: boolean): void;
|
|
2063
|
+
//#endregion
|
|
2064
|
+
//#region src/synthesizer/audio_engine/channel/types.d.ts
|
|
2065
|
+
interface NoteOnCallback {
|
|
2066
|
+
/** The MIDI note number. */
|
|
2067
|
+
midiNote: number;
|
|
2068
|
+
/** The MIDI channel number. */
|
|
2069
|
+
channel: number;
|
|
2070
|
+
/** The velocity of the note. */
|
|
2071
|
+
velocity: number;
|
|
2072
|
+
}
|
|
2073
|
+
interface NoteOffCallback {
|
|
2074
|
+
/** The MIDI note number. */
|
|
2075
|
+
midiNote: number;
|
|
2076
|
+
/** The MIDI channel number. */
|
|
2077
|
+
channel: number;
|
|
2078
|
+
}
|
|
2079
|
+
interface ProgramChangeCallback extends MIDIPatchFull {
|
|
2080
|
+
/** The MIDI channel number. */
|
|
2081
|
+
channel: number;
|
|
2082
|
+
}
|
|
2083
|
+
interface ControllerChangeCallback {
|
|
2084
|
+
/** The MIDI channel number. */
|
|
2085
|
+
channel: number;
|
|
2086
|
+
/** The controller number. */
|
|
2087
|
+
controller: MIDIController;
|
|
2088
|
+
/** The value of the controller. */
|
|
2089
|
+
value: number;
|
|
2090
|
+
}
|
|
2091
|
+
interface PolyPressureCallback {
|
|
2092
|
+
/** The MIDI channel number. */
|
|
2093
|
+
channel: number;
|
|
2094
|
+
/** The MIDI note number. */
|
|
2095
|
+
midiNote: number;
|
|
2096
|
+
/** The pressure value. */
|
|
2097
|
+
pressure: number;
|
|
2098
|
+
}
|
|
2099
|
+
interface StopAllCallback {
|
|
2042
2100
|
/**
|
|
2043
|
-
*
|
|
2044
|
-
* Each index corresponds to a note (0 = C, 1 = C#, ..., 11 = B).
|
|
2045
|
-
* Note: Repeated every 12 notes.
|
|
2101
|
+
* The MIDI channel number.
|
|
2046
2102
|
*/
|
|
2047
|
-
|
|
2048
|
-
protected readonly _midiParameters: Readonly<ChannelMIDIParameter>;
|
|
2103
|
+
channel: number;
|
|
2049
2104
|
/**
|
|
2050
|
-
*
|
|
2051
|
-
* Used for overlapping Note Ons.
|
|
2052
|
-
* MIDI note: current note on ID
|
|
2053
|
-
* @protected
|
|
2105
|
+
* If the channel was force stopped. (no release time)
|
|
2054
2106
|
*/
|
|
2055
|
-
|
|
2107
|
+
force: boolean;
|
|
2108
|
+
}
|
|
2109
|
+
type ChannelMIDIParameterChange = { [P in keyof ChannelMIDIParameter]: {
|
|
2056
2110
|
/**
|
|
2057
|
-
*
|
|
2058
|
-
* Used for overlapping Note Ons.
|
|
2059
|
-
* MIDI note: current note on ID
|
|
2060
|
-
* @protected
|
|
2111
|
+
* The channel that was affected.
|
|
2061
2112
|
*/
|
|
2062
|
-
|
|
2113
|
+
channel: number;
|
|
2063
2114
|
/**
|
|
2064
|
-
*
|
|
2065
|
-
* If false then the last parameter was NRPN.
|
|
2066
|
-
* @protected
|
|
2115
|
+
* The parameter that was changed.
|
|
2067
2116
|
*/
|
|
2068
|
-
|
|
2117
|
+
parameter: P;
|
|
2118
|
+
/**
|
|
2119
|
+
* The new value of this parameter.
|
|
2120
|
+
*/
|
|
2121
|
+
value: ChannelMIDIParameter[P];
|
|
2122
|
+
} }[keyof ChannelMIDIParameter];
|
|
2123
|
+
//#endregion
|
|
2124
|
+
//#region src/synthesizer/audio_engine/parameters/system.d.ts
|
|
2125
|
+
/**
|
|
2126
|
+
* The global parameters of the synthesizer.
|
|
2127
|
+
* These can only be changed via the API.
|
|
2128
|
+
*/
|
|
2129
|
+
interface GlobalSystemParameter {
|
|
2069
2130
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
* instead of the regular entry in the midiControllers table.
|
|
2131
|
+
* If the synthesizer processes the audio effects.
|
|
2072
2132
|
*/
|
|
2073
|
-
|
|
2133
|
+
effectsEnabled: boolean;
|
|
2074
2134
|
/**
|
|
2075
|
-
*
|
|
2076
|
-
* Updated in `updateInternalParams`.
|
|
2077
|
-
* This is used to avoid a big addition for every voice rendering call.
|
|
2135
|
+
* If the event system is enabled.
|
|
2078
2136
|
*/
|
|
2079
|
-
|
|
2137
|
+
eventsEnabled: boolean;
|
|
2080
2138
|
/**
|
|
2081
|
-
*
|
|
2082
|
-
*
|
|
2083
|
-
*
|
|
2139
|
+
* The maximum number of voices that can be played at once.
|
|
2140
|
+
*
|
|
2141
|
+
* Increasing this value causes memory allocation for more voices.
|
|
2142
|
+
* It is recommended to set it at the beginning, before rendering audio to avoid GC.
|
|
2143
|
+
* Decreasing it does not cause memory usage change, so it's fine to use.
|
|
2084
2144
|
*/
|
|
2085
|
-
|
|
2145
|
+
voiceCap: number;
|
|
2086
2146
|
/**
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2147
|
+
* Enabling this parameter will cause a new voice allocation when the voice cap is hit, rather than stealing existing voices.
|
|
2148
|
+
*
|
|
2149
|
+
* This is not recommended in real-time environments.
|
|
2089
2150
|
*/
|
|
2090
|
-
|
|
2151
|
+
autoAllocateVoices: boolean;
|
|
2091
2152
|
/**
|
|
2092
|
-
*
|
|
2093
|
-
*
|
|
2094
|
-
* This is used to avoid a big multiplication for every voice rendering call.
|
|
2153
|
+
* The reverb effect gain.
|
|
2154
|
+
* From 0 to any number. 1 is 100% reverb.
|
|
2095
2155
|
*/
|
|
2096
|
-
|
|
2156
|
+
reverbGain: number;
|
|
2097
2157
|
/**
|
|
2098
|
-
*
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
2101
|
-
*
|
|
2102
|
-
* It can be set with Portamento Control CC anyway.
|
|
2103
|
-
* @protected
|
|
2158
|
+
* If the synthesizer should prevent editing of the reverb parameters.
|
|
2159
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
2160
|
+
* the recommended use case would be setting
|
|
2161
|
+
* the reverb parameters then locking it to prevent changes by MIDI files.
|
|
2104
2162
|
*/
|
|
2105
|
-
|
|
2163
|
+
reverbLock: boolean;
|
|
2106
2164
|
/**
|
|
2107
|
-
*
|
|
2108
|
-
*
|
|
2109
|
-
* This is also not a `ChannelMIDIParameter` for the same reason as `lastPortamentoNote`
|
|
2110
|
-
* @protected
|
|
2165
|
+
* The chorus effect gain.
|
|
2166
|
+
* From 0 to any number. 1 is 100% chorus.
|
|
2111
2167
|
*/
|
|
2112
|
-
|
|
2168
|
+
chorusGain: number;
|
|
2113
2169
|
/**
|
|
2114
|
-
*
|
|
2115
|
-
*
|
|
2116
|
-
*
|
|
2117
|
-
*
|
|
2170
|
+
* If the synthesizer should prevent editing of the chorus parameters.
|
|
2171
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
2172
|
+
* the recommended use case would be setting
|
|
2173
|
+
* the chorus parameters then locking it to prevent changes by MIDI files.
|
|
2118
2174
|
*/
|
|
2119
|
-
|
|
2175
|
+
chorusLock: boolean;
|
|
2120
2176
|
/**
|
|
2121
|
-
* The
|
|
2122
|
-
*
|
|
2177
|
+
* The delay effect gain.
|
|
2178
|
+
* From 0 to any number. 1 is 100% delay.
|
|
2123
2179
|
*/
|
|
2124
|
-
|
|
2180
|
+
delayGain: number;
|
|
2125
2181
|
/**
|
|
2126
|
-
*
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2182
|
+
* If the synthesizer should prevent editing of the delay parameters.
|
|
2183
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
2184
|
+
* the recommended use case would be setting
|
|
2185
|
+
* the delay parameters then locking it to prevent changes by MIDI files.
|
|
2129
2186
|
*/
|
|
2130
|
-
|
|
2131
|
-
protected readonly generators: ChannelGenerators;
|
|
2132
|
-
protected readonly computeModulator: (voice: Voice, pitchWheel: number, modulatorIndex: number) => number;
|
|
2133
|
-
protected readonly computeModulators: (voice: Voice, sourceUsesCC?: 0 | 1 | -1 | undefined, sourceIndex?: number | undefined) => void;
|
|
2187
|
+
delayLock: boolean;
|
|
2134
2188
|
/**
|
|
2135
|
-
*
|
|
2189
|
+
* If the synthesizer should prevent changing the insertion effect type and parameters.
|
|
2190
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
2191
|
+
* the recommended use case would be setting
|
|
2192
|
+
* the insertion effect type and parameters then locking it to prevent changes by MIDI files.
|
|
2193
|
+
*
|
|
2194
|
+
* To lock the channel insertion assign, lock the `efxAssign` parameter instead.
|
|
2136
2195
|
*/
|
|
2137
|
-
|
|
2196
|
+
insertionEffectLock: boolean;
|
|
2138
2197
|
/**
|
|
2139
|
-
*
|
|
2198
|
+
* If the synthesizer should prevent editing of the drum parameters.
|
|
2199
|
+
* These params are modified using MIDI system exclusive messages or NRPN, so
|
|
2200
|
+
* the recommended use case would be setting
|
|
2201
|
+
* the drum parameters then locking it to prevent changes by MIDI files.
|
|
2140
2202
|
*/
|
|
2141
|
-
|
|
2203
|
+
drumLock: boolean;
|
|
2142
2204
|
/**
|
|
2143
|
-
*
|
|
2205
|
+
* Forces note killing instead of releasing. Improves performance in black MIDIs.
|
|
2144
2206
|
*/
|
|
2145
|
-
|
|
2207
|
+
blackMIDIMode: boolean;
|
|
2146
2208
|
/**
|
|
2147
|
-
*
|
|
2209
|
+
* Synthesizer's device ID for system exclusive messages. Set to -1 to accept all.
|
|
2148
2210
|
*/
|
|
2149
|
-
|
|
2211
|
+
deviceID: number;
|
|
2150
2212
|
/**
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2153
|
-
* such as volume, pan, modulation, etc.
|
|
2154
|
-
* @remarks
|
|
2155
|
-
* A bit of an explanation:
|
|
2156
|
-
* The controller table is stored as an int16 array, it stores 14-bit values, allowing for full 14-bit LSB resolution.
|
|
2157
|
-
* The only exception from this are the Registered and Non-Registered Parameter Numbers.
|
|
2158
|
-
* Data entries do store it!
|
|
2213
|
+
* The master gain.
|
|
2214
|
+
* From 0 to any number. 1 is 100% volume.
|
|
2159
2215
|
*/
|
|
2160
|
-
|
|
2216
|
+
gain: number;
|
|
2161
2217
|
/**
|
|
2162
|
-
* The
|
|
2163
|
-
*
|
|
2218
|
+
* The master pan.
|
|
2219
|
+
* From -1 (left) to 1 (right). 0 is center.
|
|
2164
2220
|
*/
|
|
2165
|
-
|
|
2221
|
+
pan: number;
|
|
2166
2222
|
/**
|
|
2167
|
-
* The
|
|
2168
|
-
*
|
|
2223
|
+
* The global key shift in semitones.
|
|
2224
|
+
* Drum channels ignore this value.
|
|
2169
2225
|
*/
|
|
2170
|
-
|
|
2171
|
-
protected get channelSystem(): MIDISystem;
|
|
2226
|
+
keyShift: number;
|
|
2172
2227
|
/**
|
|
2173
|
-
*
|
|
2174
|
-
*
|
|
2175
|
-
* @param controller The MIDI controller number (0-127).
|
|
2176
|
-
* @param isLocked If the controller should be locked.
|
|
2228
|
+
* The global tuning in cents.
|
|
2229
|
+
* Drum channels ignore this value.
|
|
2177
2230
|
*/
|
|
2178
|
-
|
|
2231
|
+
fineTune: number;
|
|
2179
2232
|
/**
|
|
2180
|
-
*
|
|
2181
|
-
* Note that this executes a program change.
|
|
2182
|
-
* @param isDrum If the channel should be a drum preset or not.
|
|
2233
|
+
* The interpolation type used for sample playback.
|
|
2183
2234
|
*/
|
|
2184
|
-
|
|
2235
|
+
interpolationType: InterpolationType;
|
|
2185
2236
|
/**
|
|
2186
|
-
*
|
|
2187
|
-
* @param force If true, stops all notes immediately, otherwise applies release time.
|
|
2237
|
+
* If the synthesizer should prevent changing any parameters via NRPN.
|
|
2188
2238
|
*/
|
|
2189
|
-
|
|
2190
|
-
protected resetGeneratorOverrides(): void;
|
|
2191
|
-
protected setGeneratorOverride(gen: GeneratorType, value: number, realtime?: boolean): void;
|
|
2192
|
-
protected resetGeneratorOffsets(): void;
|
|
2193
|
-
protected setGeneratorOffset(gen: GeneratorType, value: number): void;
|
|
2194
|
-
protected resetDrumParams(): void;
|
|
2195
|
-
protected computeModulatorsAll(sourceUsesCC: -1 | 0 | 1, sourceIndex: number): void;
|
|
2196
|
-
protected setBankMSB(bankMSB: number): void;
|
|
2197
|
-
protected setBankLSB(bankLSB: number): void;
|
|
2239
|
+
nrpnParamLock: boolean;
|
|
2198
2240
|
/**
|
|
2199
|
-
*
|
|
2241
|
+
* Indicates whether the synthesizer is in monophonic retrigger mode.
|
|
2242
|
+
* This emulates the behavior of Microsoft GS Wavetable Synth,
|
|
2243
|
+
* Where a new note will kill the previous one if it is still playing.
|
|
2200
2244
|
*/
|
|
2201
|
-
|
|
2245
|
+
monophonicRetrigger: boolean;
|
|
2202
2246
|
}
|
|
2247
|
+
declare const DEFAULT_GLOBAL_SYSTEM_PARAMETERS: GlobalSystemParameter;
|
|
2203
2248
|
//#endregion
|
|
2204
2249
|
//#region src/synthesizer/audio_engine/sound_bank_manager.d.ts
|
|
2205
2250
|
declare class SoundBankManager {
|
|
@@ -2482,12 +2527,13 @@ interface ChannelSnapshot {
|
|
|
2482
2527
|
pitchWheels: Int16Array;
|
|
2483
2528
|
generators: ChannelGenerators;
|
|
2484
2529
|
midiParameters: ChannelMIDIParameter;
|
|
2530
|
+
lockedMIDIParameters: Record<keyof ChannelMIDIParameter, boolean>;
|
|
2485
2531
|
systemParameters: ChannelSystemParameter;
|
|
2486
2532
|
octaveTuning: Int8Array;
|
|
2487
2533
|
perNotePitch: boolean;
|
|
2488
2534
|
drumParams: DrumParameterSnapshot[];
|
|
2489
2535
|
drumChannel: boolean;
|
|
2490
|
-
|
|
2536
|
+
channel: number;
|
|
2491
2537
|
}
|
|
2492
2538
|
//#endregion
|
|
2493
2539
|
//#region src/synthesizer/audio_engine/synthesizer_snapshot.d.ts
|
|
@@ -2497,8 +2543,9 @@ interface SynthesizerSnapshot {
|
|
|
2497
2543
|
* Key modifiers.
|
|
2498
2544
|
*/
|
|
2499
2545
|
keyMappings: (KeyModifier | undefined)[][];
|
|
2500
|
-
systemParameters: GlobalSystemParameter;
|
|
2501
2546
|
midiParameters: GlobalMIDIParameter;
|
|
2547
|
+
lockedMIDIParameters: Record<keyof GlobalMIDIParameter, boolean>;
|
|
2548
|
+
systemParameters: GlobalSystemParameter;
|
|
2502
2549
|
reverbProcessor: ReverbProcessorSnapshot;
|
|
2503
2550
|
chorusProcessor: ChorusProcessorSnapshot;
|
|
2504
2551
|
delayProcessor: DelayProcessorSnapshot;
|
|
@@ -2612,7 +2659,7 @@ declare class SpessaSynthProcessor {
|
|
|
2612
2659
|
*/
|
|
2613
2660
|
private readonly synthCore;
|
|
2614
2661
|
/**
|
|
2615
|
-
*
|
|
2662
|
+
* For applying the snapshot after an override sound bank too.
|
|
2616
2663
|
*/
|
|
2617
2664
|
private savedSnapshot?;
|
|
2618
2665
|
/**
|
|
@@ -2671,12 +2718,19 @@ declare class SpessaSynthProcessor {
|
|
|
2671
2718
|
* @returns If a BasicPreset instance is returned, it will be used by the channel.
|
|
2672
2719
|
*/
|
|
2673
2720
|
onMissingPreset: (patch: MIDIPatch, system: MIDISystem) => BasicPreset | undefined;
|
|
2721
|
+
/**
|
|
2722
|
+
* Locks or unlocks a given Global MIDI Parameter.
|
|
2723
|
+
* This prevents any changes to it until it's unlocked.
|
|
2724
|
+
* @param parameter The Global MIDI Parameter to lock.
|
|
2725
|
+
* @param isLocked If the parameter should be locked.
|
|
2726
|
+
*/
|
|
2727
|
+
lockMIDIParameter<P extends keyof GlobalMIDIParameter>(parameter: P, isLocked: boolean): void;
|
|
2674
2728
|
/**
|
|
2675
2729
|
* Sets a system parameter of the synthesizer.
|
|
2676
|
-
* @param
|
|
2730
|
+
* @param parameter The type of the system parameter to set.
|
|
2677
2731
|
* @param value The value to set for the system parameter.
|
|
2678
2732
|
*/
|
|
2679
|
-
setSystemParameter<P extends keyof GlobalSystemParameter>(
|
|
2733
|
+
setSystemParameter<P extends keyof GlobalSystemParameter>(parameter: P, value: GlobalSystemParameter[P]): void;
|
|
2680
2734
|
/**
|
|
2681
2735
|
* Executes a full synthesizer reset.
|
|
2682
2736
|
* This will reset all controllers to their default values,
|
|
@@ -3230,7 +3284,7 @@ declare class ModulatorSource {
|
|
|
3230
3284
|
* If this field is set to false, the controller should be mapped with a minimum value of 0 and a maximum value of 1. This is also
|
|
3231
3285
|
* called Unipolar. Thus, it behaves similar to the Modulation Wheel controller of the MIDI specification.
|
|
3232
3286
|
*
|
|
3233
|
-
* If this field is set to true, the controller
|
|
3287
|
+
* If this field is set to true, the controller should be mapped with a minimum value of -1 and a maximum value of 1. This is also
|
|
3234
3288
|
* called Bipolar. Thus, it behaves similar to the Pitch Wheel controller of the MIDI specification.
|
|
3235
3289
|
*/
|
|
3236
3290
|
isBipolar: boolean;
|
|
@@ -3744,6 +3798,50 @@ declare class MIDIMessage {
|
|
|
3744
3798
|
* @param data the message's binary data.
|
|
3745
3799
|
*/
|
|
3746
3800
|
constructor(ticks: number, byte: MIDIMessageType, data: Uint8Array<ArrayBuffer>);
|
|
3801
|
+
/**
|
|
3802
|
+
* Returns a new MIDI Pitch Wheel message.
|
|
3803
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3804
|
+
* @param channel the channel number of this message.
|
|
3805
|
+
* @param value the new value, between 0 and 16383, where 8192 is the center (no pitch change).
|
|
3806
|
+
*/
|
|
3807
|
+
static pitchWheel(ticks: number, channel: number, value: number): MIDIMessage;
|
|
3808
|
+
/**
|
|
3809
|
+
* Returns a new MIDI Channel Pressure message.
|
|
3810
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3811
|
+
* @param channel the channel number of this message.
|
|
3812
|
+
* @param value the new value, between 0 and 127.
|
|
3813
|
+
*/
|
|
3814
|
+
static channelPressure(ticks: number, channel: number, value: number): MIDIMessage;
|
|
3815
|
+
/**
|
|
3816
|
+
* Returns a new MIDI Program Change message.
|
|
3817
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3818
|
+
* @param channel the channel number of this message.
|
|
3819
|
+
* @param program the new MIDI program number, between 0 and 127.
|
|
3820
|
+
*/
|
|
3821
|
+
static programChange(ticks: number, channel: number, program: number): MIDIMessage;
|
|
3822
|
+
/**
|
|
3823
|
+
* Returns a new MIDI Controller Change message.
|
|
3824
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3825
|
+
* @param channel the channel number of this message.
|
|
3826
|
+
* @param controller the MIDI controller.
|
|
3827
|
+
* @param value the new value.
|
|
3828
|
+
*/
|
|
3829
|
+
static controllerChange(ticks: number, channel: number, controller: MIDIController, value: number): MIDIMessage;
|
|
3830
|
+
/**
|
|
3831
|
+
* Returns a new MIDI System Exclusive message.
|
|
3832
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3833
|
+
* @param data the data of the system exclusive message,
|
|
3834
|
+
* excluding the starting 0xF0 byte.
|
|
3835
|
+
*/
|
|
3836
|
+
static systemExclusive(ticks: number, data: number[]): MIDIMessage;
|
|
3837
|
+
/**
|
|
3838
|
+
* Returns a new MIDI Registered Parameter message. Sends both data MSB and LSB.
|
|
3839
|
+
* @param ticks time of this message in absolute MIDI ticks.
|
|
3840
|
+
* @param channel the channel number of this message.
|
|
3841
|
+
* @param parameter the 14-bit MIDI registered parameter number.
|
|
3842
|
+
* @param value the 14-bit new value.
|
|
3843
|
+
*/
|
|
3844
|
+
static registeredParameter(ticks: number, channel: number, parameter: number, value: number): MIDIMessage[];
|
|
3747
3845
|
}
|
|
3748
3846
|
//#endregion
|
|
3749
3847
|
//#region src/midi/midi_tools/modify_midi.d.ts
|
|
@@ -3770,15 +3868,30 @@ interface ChannelModification {
|
|
|
3770
3868
|
* - `MIDIPatch` - clear + sets the new patch according to the MIDI system at the start of the sequence.
|
|
3771
3869
|
*/
|
|
3772
3870
|
patch?: ClearableParameter<MIDIPatch>;
|
|
3871
|
+
/**
|
|
3872
|
+
* The new MIDI parameters of this channel.
|
|
3873
|
+
* - Key: the MIDI parameter name.
|
|
3874
|
+
* - value:
|
|
3875
|
+
* - `"clear"` - all changes for this parameter are removed.
|
|
3876
|
+
* - `specific value` - clear + sets the new parameter at the start of the song, effectively locking them to the set value.
|
|
3877
|
+
*/
|
|
3878
|
+
midiParams?: { [P in keyof ChannelMIDIParameter]?: ClearableParameter<ChannelMIDIParameter[P]> };
|
|
3773
3879
|
/**
|
|
3774
3880
|
* The channel key shift in semitones.
|
|
3775
3881
|
* Note on/off numbers are shifted.
|
|
3882
|
+
*
|
|
3883
|
+
* This differs from the `keyShift` MIDI Parameter in that it shifts the actual note numbers,
|
|
3884
|
+
* and doesn't delete or overwrite existing shifts.
|
|
3776
3885
|
*/
|
|
3777
3886
|
keyShift?: number;
|
|
3778
3887
|
/**
|
|
3779
3888
|
* The channel tuning in cents.
|
|
3780
3889
|
* Tuned using RPN Fine Tune.
|
|
3781
3890
|
* Range is `[-100; 99.986]` cents.
|
|
3891
|
+
*
|
|
3892
|
+
* This differs from the `fineTune` MIDI Parameter
|
|
3893
|
+
* in that it is relative to the tuning applied in the MIDI file,
|
|
3894
|
+
* and it does not overwrite it.
|
|
3782
3895
|
*/
|
|
3783
3896
|
fineTune?: number;
|
|
3784
3897
|
}
|
|
@@ -3797,6 +3910,17 @@ interface ModifyMIDIOptions {
|
|
|
3797
3910
|
* - `never` - not yet implemented.
|
|
3798
3911
|
*/
|
|
3799
3912
|
drumSetupParams?: ClearableParameter<never>;
|
|
3913
|
+
/**
|
|
3914
|
+
* The global MIDI parameter changes.
|
|
3915
|
+
* - Key: the MIDI parameter name.
|
|
3916
|
+
* - value:
|
|
3917
|
+
* - `"clear"` - all changes for this parameter are removed.
|
|
3918
|
+
* - `specific value` - clear + sets the new parameter at the start of the song, effectively locking them to the set value.
|
|
3919
|
+
*
|
|
3920
|
+
* Please note that `"clear"` is not supported for the `system` parameter,
|
|
3921
|
+
* as it may cause issues with the MIDI system detection and reset insertion.
|
|
3922
|
+
*/
|
|
3923
|
+
midiParams?: { [P in keyof GlobalMIDIParameter]?: ClearableParameter<GlobalMIDIParameter[P]> };
|
|
3800
3924
|
/**
|
|
3801
3925
|
* The desired GS reverb parameters.
|
|
3802
3926
|
* - `"clear"` - all existing parameter change MIDI messages are removed.
|
|
@@ -3985,7 +4109,7 @@ declare class BasicMIDI {
|
|
|
3985
4109
|
* It supports Standard MIDI Files (SMF), RIFF MIDI (RMIDI), and Extensible Music Format (XMF).
|
|
3986
4110
|
* It also handles embedded soundbanks in RMIDI files.
|
|
3987
4111
|
* If the file is an RMIDI file, it will extract the embedded soundbank and store
|
|
3988
|
-
* it in the `
|
|
4112
|
+
* it in the `embeddedSoundBank` property of the BasicMIDI instance.
|
|
3989
4113
|
* If the file is an XMF file, it will parse the XMF structure and extract the MIDI data.
|
|
3990
4114
|
*/
|
|
3991
4115
|
static fromArrayBuffer(arrayBuffer: ArrayBuffer, fileName?: string): BasicMIDI;
|
|
@@ -4064,7 +4188,9 @@ declare class BasicMIDI {
|
|
|
4064
4188
|
modify(opts: Partial<ModifyMIDIOptions>): void;
|
|
4065
4189
|
/**
|
|
4066
4190
|
* Modifies the sequence *in-place* according to the locked presets and controllers in the given snapshot.
|
|
4067
|
-
*
|
|
4191
|
+
*
|
|
4192
|
+
* Note that System Parameters `fineTune` and `keyShift` are passed to the relative tuning parameters of the channels.
|
|
4193
|
+
* Only locked MIDI parameters and controllers are applied.
|
|
4068
4194
|
* @param snapshot the snapshot to apply.
|
|
4069
4195
|
*/
|
|
4070
4196
|
applySnapshot(snapshot: SynthesizerSnapshot): void;
|
|
@@ -4235,19 +4361,28 @@ declare class MIDIBuilder extends BasicMIDI {
|
|
|
4235
4361
|
}
|
|
4236
4362
|
//#endregion
|
|
4237
4363
|
//#region src/midi/midi_tools/midi_utils.d.ts
|
|
4238
|
-
type
|
|
4364
|
+
type GlobalMIDIParameterMessage = { [P in keyof GlobalMIDIParameter]: {
|
|
4365
|
+
type: "Global MIDI Param";
|
|
4366
|
+
parameter: P;
|
|
4367
|
+
value: GlobalMIDIParameter[P];
|
|
4368
|
+
} }[keyof GlobalMIDIParameter];
|
|
4369
|
+
type ChannelMIDIParameterMessage = { [P in keyof ChannelMIDIParameter]: {
|
|
4370
|
+
type: "Channel MIDI Param";
|
|
4371
|
+
parameter: P;
|
|
4372
|
+
value: ChannelMIDIParameter[P];
|
|
4373
|
+
channel: number;
|
|
4374
|
+
} }[keyof ChannelMIDIParameter];
|
|
4375
|
+
type AnalyzedParameter = {
|
|
4239
4376
|
type: "Other";
|
|
4240
4377
|
} | {
|
|
4241
|
-
type: "
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
type: "GS Reset";
|
|
4250
|
-
} | {
|
|
4378
|
+
type: "Controller Change";
|
|
4379
|
+
controller: MIDIController;
|
|
4380
|
+
value: number;
|
|
4381
|
+
channel: number;
|
|
4382
|
+
} | ChannelMIDIParameterMessage | {
|
|
4383
|
+
type: "Drum Setup";
|
|
4384
|
+
};
|
|
4385
|
+
type AnalyzedMIDIMessage = AnalyzedParameter | {
|
|
4251
4386
|
type: "Reverb Param";
|
|
4252
4387
|
} | {
|
|
4253
4388
|
type: "Chorus Param";
|
|
@@ -4261,32 +4396,13 @@ type AnalyzedMIDIMessage = {
|
|
|
4261
4396
|
type: "Drums On";
|
|
4262
4397
|
channel: number;
|
|
4263
4398
|
isDrum: boolean;
|
|
4264
|
-
} | {
|
|
4265
|
-
type: "Drum Setup";
|
|
4266
4399
|
} | {
|
|
4267
4400
|
type: "Program Change";
|
|
4268
4401
|
channel: number;
|
|
4269
4402
|
value: number;
|
|
4270
4403
|
} | {
|
|
4271
|
-
type: "
|
|
4272
|
-
|
|
4273
|
-
value: number;
|
|
4274
|
-
channel: number;
|
|
4275
|
-
} | {
|
|
4276
|
-
type: "Master Key Shift";
|
|
4277
|
-
value: number;
|
|
4278
|
-
} | {
|
|
4279
|
-
type: "Key Shift";
|
|
4280
|
-
value: number;
|
|
4281
|
-
channel: number;
|
|
4282
|
-
} | {
|
|
4283
|
-
type: "Master Fine Tune";
|
|
4284
|
-
value: number;
|
|
4285
|
-
} | {
|
|
4286
|
-
type: "Fine Tune";
|
|
4287
|
-
value: number;
|
|
4288
|
-
channel: number;
|
|
4289
|
-
};
|
|
4404
|
+
type: "Display Data";
|
|
4405
|
+
} | GlobalMIDIParameterMessage;
|
|
4290
4406
|
/**
|
|
4291
4407
|
* A general purpose class for handling MIDI messages.
|
|
4292
4408
|
*/
|
|
@@ -4304,7 +4420,7 @@ declare class MIDIUtils {
|
|
|
4304
4420
|
* @param rpn The 14-bit RPN number.
|
|
4305
4421
|
* @param value The 14-bit value for that number.
|
|
4306
4422
|
*/
|
|
4307
|
-
static analyzeRPN(channel: number, rpn: number, value: number):
|
|
4423
|
+
static analyzeRPN(channel: number, rpn: number, value: number): AnalyzedParameter;
|
|
4308
4424
|
/**
|
|
4309
4425
|
* Analyzes a MIDI Non-Registered Parameter Number
|
|
4310
4426
|
* and returns an identification and data for it.
|
|
@@ -4312,7 +4428,27 @@ declare class MIDIUtils {
|
|
|
4312
4428
|
* @param nrpn The 14-bit NRPN number.
|
|
4313
4429
|
* @param value The 14-bit value for that number.
|
|
4314
4430
|
*/
|
|
4315
|
-
static analyzeNRPN(channel: number, nrpn: number, value: number):
|
|
4431
|
+
static analyzeNRPN(channel: number, nrpn: number, value: number): AnalyzedParameter;
|
|
4432
|
+
/**
|
|
4433
|
+
* Returns a list of MIDI events needed to set the given parameter.
|
|
4434
|
+
* @param ticks The ticks for all events.
|
|
4435
|
+
* @param system If the message has multiple ways of setting it,
|
|
4436
|
+
* this selects the preferred way. Otherwise, it prefers Universal (GM).
|
|
4437
|
+
* @param parameter The parameter to set.
|
|
4438
|
+
* @param value The value to set it to.
|
|
4439
|
+
*/
|
|
4440
|
+
static setGlobalMIDIParameter<P extends keyof GlobalMIDIParameter>(ticks: number, system: MIDISystem, parameter: P, value: GlobalMIDIParameter[P]): MIDIMessage[];
|
|
4441
|
+
/**
|
|
4442
|
+
* Returns a list of MIDI events needed to set the given parameter.
|
|
4443
|
+
* @param ticks The ticks for all events.
|
|
4444
|
+
* @param channel The channel number.
|
|
4445
|
+
* @param system If the message has multiple ways of setting it,
|
|
4446
|
+
* this selects the preferred way. Otherwise, it prefers Universal (GM).
|
|
4447
|
+
* @param parameter The parameter to set.
|
|
4448
|
+
* @param value The value to set it to.
|
|
4449
|
+
* @returns The list of `MIDIMessage`s that set the parameter.
|
|
4450
|
+
*/
|
|
4451
|
+
static setChannelMIDIParameter<P extends keyof ChannelMIDIParameter>(ticks: number, channel: number, system: MIDISystem, parameter: P, value: ChannelMIDIParameter[P]): MIDIMessage[];
|
|
4316
4452
|
/**
|
|
4317
4453
|
* Converts GS/XG "part number" to MIDI channel number.
|
|
4318
4454
|
* @param part The part number.
|
|
@@ -4330,7 +4466,7 @@ declare class MIDIUtils {
|
|
|
4330
4466
|
* @param a3 Address 3
|
|
4331
4467
|
* @param data Data, can be multiple bytes.
|
|
4332
4468
|
*/
|
|
4333
|
-
static
|
|
4469
|
+
static gs(a1: number, a2: number, a3: number, data: number[]): number[];
|
|
4334
4470
|
/**
|
|
4335
4471
|
* Gets a GS System Exclusive MIDI message.
|
|
4336
4472
|
* @param ticks The tick time of the message.
|
|
@@ -4341,18 +4477,41 @@ declare class MIDIUtils {
|
|
|
4341
4477
|
*/
|
|
4342
4478
|
static gsMessage(ticks: number, a1: number, a2: number, a3: number, data: number[]): MIDIMessage;
|
|
4343
4479
|
/**
|
|
4344
|
-
* Gets
|
|
4480
|
+
* Gets raw XG System Exclusive message bytes, without the 0xF0 status byte.
|
|
4481
|
+
* @param a1 Address 1
|
|
4482
|
+
* @param a2 Address 2
|
|
4483
|
+
* @param a3 Address 3
|
|
4484
|
+
* @param data Data, can be multiple bytes.
|
|
4485
|
+
*/
|
|
4486
|
+
static xg(a1: number, a2: number, a3: number, data: number[]): number[];
|
|
4487
|
+
/**
|
|
4488
|
+
* Gets a XG System Exclusive MIDI message.
|
|
4345
4489
|
* @param ticks The tick time of the message.
|
|
4346
|
-
* @param
|
|
4347
|
-
* @param
|
|
4348
|
-
*
|
|
4490
|
+
* @param a1 Address 1
|
|
4491
|
+
* @param a2 Address 2
|
|
4492
|
+
* @param a3 Address 3
|
|
4493
|
+
* @param data Data, can be multiple bytes.
|
|
4494
|
+
*/
|
|
4495
|
+
static xgMessage(ticks: number, a1: number, a2: number, a3: number, data: number[]): MIDIMessage;
|
|
4496
|
+
/**
|
|
4497
|
+
* Gets a raw Device Control System Exclusive message bytes, without the 0xF0 status byte.
|
|
4498
|
+
* @param subID The sub ID.
|
|
4499
|
+
* @param data Data, can be multiple bytes.
|
|
4500
|
+
*/
|
|
4501
|
+
static deviceControl(subID: number, data: number[]): number[];
|
|
4502
|
+
/**
|
|
4503
|
+
* Gets a Device Control System Exclusive MIDI message.
|
|
4504
|
+
* @param ticks The tick time of the message.
|
|
4505
|
+
* @param subID The sub ID.
|
|
4506
|
+
* @param data Data, can be multiple bytes.
|
|
4349
4507
|
*/
|
|
4350
|
-
static
|
|
4508
|
+
static deviceControlMessage(ticks: number, subID: number, data: number[]): MIDIMessage;
|
|
4351
4509
|
/**
|
|
4352
|
-
* Gets a
|
|
4510
|
+
* Gets a selected reset System Exclusive MIDI message.
|
|
4353
4511
|
* @param ticks The tick time of the message.
|
|
4512
|
+
* @param system The system to reset into.
|
|
4354
4513
|
*/
|
|
4355
|
-
static
|
|
4514
|
+
static reset(ticks: number, system: MIDISystem): MIDIMessage;
|
|
4356
4515
|
private static analyzeGM;
|
|
4357
4516
|
private static analyzeXG;
|
|
4358
4517
|
private static analyzeGS;
|