spessasynth_lib 3.16.4 → 3.16.5
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/@types/midi_parser/rmidi_writer.d.ts +2 -1
- package/@types/soundfont/basic_soundfont/basic_soundfont.d.ts +5 -4
- package/@types/synthetizer/worklet_system/worklet_utilities/worklet_processor_channel.d.ts +2 -2
- package/midi_parser/midi_loader.js +9 -0
- package/midi_parser/rmidi_writer.js +225 -244
- package/package.json +1 -1
- package/soundfont/basic_soundfont/basic_soundfont.js +25 -10
- package/synthetizer/worklet_processor.min.js +5 -5
- package/synthetizer/worklet_system/worklet_methods/program_control.js +6 -17
- package/synthetizer/worklet_system/worklet_utilities/worklet_processor_channel.js +1 -1
|
@@ -31,8 +31,8 @@ export function programChange(channel, programNumber, userChange=false)
|
|
|
31
31
|
// check if override
|
|
32
32
|
if(this.overrideSoundfont)
|
|
33
33
|
{
|
|
34
|
-
const bankWithOffset = bank === 128 ? 128 :
|
|
35
|
-
const p = this.overrideSoundfont.
|
|
34
|
+
const bankWithOffset = bank === 128 ? 128 : bank - this.soundfontBankOffset;
|
|
35
|
+
const p = this.overrideSoundfont.getPresetNoFallback(bankWithOffset, programNumber);
|
|
36
36
|
if(p)
|
|
37
37
|
{
|
|
38
38
|
sentBank = bank;
|
|
@@ -40,12 +40,6 @@ export function programChange(channel, programNumber, userChange=false)
|
|
|
40
40
|
channelObject.presetUsesOverride = true;
|
|
41
41
|
}
|
|
42
42
|
else
|
|
43
|
-
if(this.soundfontBankOffset === 0)
|
|
44
|
-
{
|
|
45
|
-
preset = this.overrideSoundfont.getPreset(0, programNumber);
|
|
46
|
-
sentBank = preset.bank;
|
|
47
|
-
}
|
|
48
|
-
else
|
|
49
43
|
{
|
|
50
44
|
preset = this.soundfontManager.getPreset(bank, programNumber);
|
|
51
45
|
sentBank = preset.bank;
|
|
@@ -71,24 +65,19 @@ export function programChange(channel, programNumber, userChange=false)
|
|
|
71
65
|
* @this {SpessaSynthProcessor}
|
|
72
66
|
* @param program {number}
|
|
73
67
|
* @param bank {number}
|
|
74
|
-
* @returns {
|
|
68
|
+
* @returns {BasicPreset}
|
|
75
69
|
*/
|
|
76
70
|
export function getPreset(bank, program)
|
|
77
71
|
{
|
|
78
72
|
if(this.overrideSoundfont)
|
|
79
73
|
{
|
|
80
74
|
// if overriden soundfont
|
|
81
|
-
const bankWithOffset = bank === 128 ? 128 :
|
|
82
|
-
const preset = this.overrideSoundfont.
|
|
75
|
+
const bankWithOffset = bank === 128 ? 128 : bank - this.soundfontBankOffset;
|
|
76
|
+
const preset = this.overrideSoundfont.getPresetNoFallback(bankWithOffset, program);
|
|
83
77
|
if(preset)
|
|
84
78
|
{
|
|
85
79
|
return preset;
|
|
86
80
|
}
|
|
87
|
-
else
|
|
88
|
-
if(this.soundfontBankOffset === 0)
|
|
89
|
-
{
|
|
90
|
-
return this.overrideSoundfont.getPreset(0, program);
|
|
91
|
-
}
|
|
92
81
|
}
|
|
93
82
|
return this.soundfontManager.getPreset(bank, program);
|
|
94
83
|
}
|
|
@@ -97,7 +86,7 @@ export function getPreset(bank, program)
|
|
|
97
86
|
|
|
98
87
|
/**
|
|
99
88
|
* @param channel {number}
|
|
100
|
-
* @param preset {
|
|
89
|
+
* @param preset {BasicPreset}
|
|
101
90
|
* @this {SpessaSynthProcessor}
|
|
102
91
|
*/
|
|
103
92
|
export function setPreset(channel, preset)
|
|
@@ -16,7 +16,7 @@ import { modulatorSources } from '../../../soundfont/read_sf2/modulators.js'
|
|
|
16
16
|
* @property {number} NRPFine - the current fine value of the Non-Registered Parameter
|
|
17
17
|
* @property {number} RPValue - the current value of the Registered Parameter
|
|
18
18
|
*
|
|
19
|
-
* @property {
|
|
19
|
+
* @property {BasicPreset} preset - the channel's preset
|
|
20
20
|
* @property {boolean} lockPreset - indicates whether the program on the channel is locked
|
|
21
21
|
* @property {boolean} presetUsesOverride - indcates if the channel uses a preset from the override soundfont.
|
|
22
22
|
*
|