-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and update MIDI implementation with it
- Loading branch information
Showing
22 changed files
with
180 additions
and
148 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/spessasynth_lib/synthetizer/worklet_system/message_protocol/message_sending.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/spessasynth_lib/synthetizer/worklet_system/worklet_methods/controller_control.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/spessasynth_lib/synthetizer/worklet_system/worklet_methods/tuning_control.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/controller_tables.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { midiControllers } from "../../../midi_parser/midi_message.js"; | ||
import { modulatorSources } from "../../../soundfont/basic_soundfont/modulator.js"; | ||
|
||
/* | ||
* A bit of explanation: | ||
* The controller table is stored as an int16 array, it stores 14-bit values. | ||
* This controller table is then extedned with the modulatorSources section, | ||
* for example pitch range and pitch range depth. | ||
* This allows us for precise control range and supports full pitch wheel resolution. | ||
*/ | ||
export const NON_CC_INDEX_OFFSET = 128; | ||
export const CONTROLLER_TABLE_SIZE = 147; | ||
|
||
|
||
// an array with preset default values so we can quickly use set() to reset the controllers | ||
export const resetArray = new Int16Array(CONTROLLER_TABLE_SIZE).fill(0); | ||
export const setResetValue = (i, v) => resetArray[i] = v << 7; | ||
|
||
// values come from Falcosoft MidiPlayer 6 | ||
setResetValue(midiControllers.mainVolume, 100); | ||
setResetValue(midiControllers.balance, 64); | ||
setResetValue(midiControllers.expressionController, 127); | ||
setResetValue(midiControllers.pan, 64); | ||
|
||
setResetValue(midiControllers.timbreHarmonicContent, 64); | ||
setResetValue(midiControllers.releaseTime, 64); | ||
setResetValue(midiControllers.attackTime, 64); | ||
setResetValue(midiControllers.brightness, 64); | ||
|
||
setResetValue(midiControllers.soundController6, 64); | ||
setResetValue(midiControllers.soundController7, 64); | ||
setResetValue(midiControllers.soundController8, 64); | ||
setResetValue(midiControllers.soundController9, 64); | ||
setResetValue(midiControllers.generalPurposeController6, 64); | ||
setResetValue(midiControllers.generalPurposeController8, 64); | ||
|
||
// pitch wheel | ||
setResetValue(NON_CC_INDEX_OFFSET + modulatorSources.pitchWheel, 64); | ||
setResetValue(NON_CC_INDEX_OFFSET + modulatorSources.pitchWheelRange, 2); | ||
|
||
export const customControllers = { | ||
channelTuning: 0, // cents, RPN for fine tuning | ||
channelTransposeFine: 1, // cents, only the decimal tuning, (e.g. transpose is 4.5, then shift by 4 keys + tune by 50 cents) | ||
modulationMultiplier: 2, // cents, set by moduldation depth RPN | ||
masterTuning: 3, // cents, set by system exclusive | ||
channelTuningSemitones: 4 // semitones, for RPN coarse tuning | ||
}; | ||
export const CUSTOM_CONTROLLER_TABLE_SIZE = Object.keys(customControllers).length; | ||
export const customResetArray = new Float32Array(CUSTOM_CONTROLLER_TABLE_SIZE); | ||
customResetArray[customControllers.modulationMultiplier] = 1; | ||
/** | ||
* @enum {number} | ||
*/ | ||
export const dataEntryStates = { | ||
Idle: 0, | ||
RPCoarse: 1, | ||
RPFine: 2, | ||
NRPCoarse: 3, | ||
NRPFine: 4, | ||
DataCoarse: 5, | ||
DataFine: 6 | ||
}; |
2 changes: 1 addition & 1 deletion
2
src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/worklet_modulator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.