rex_JSMidiParser
Plugin, ACE table, Discussion thread
Dependence: rex_timeline plugin (optional)
Dependence: rex_timeline plugin (optional)
Introduction
Convert a midi binary data to JSON to get note events.
To play note events, it needs rex_timeline plugin.
Convert a midi binary data to JSON to get note events.
To play note events, it needs rex_timeline plugin.
Usage
Load & convert midi to JSON
Call "Action:Load & Convert midi" to load midi from URL and convert it to JSON. "Condition:On convert completed" will be triggered while converting completed, otherwise "Condition:On convert error" will be triggered.
JSON string of converting result could be got by "Expression:Midi2JSON".
Call "Action:Load & Convert midi" to load midi from URL and convert it to JSON. "Condition:On convert completed" will be triggered while converting completed, otherwise "Condition:On convert error" will be triggered.
JSON string of converting result could be got by "Expression:Midi2JSON".
Retrieve all notes
Sample capx
Uses "Condition:For each note" to retrieve all notes sorted by note start time. Get properties of triggered note by these expressions -
Sample capx
Uses "Condition:For each note" to retrieve all notes sorted by note start time. Get properties of triggered note by these expressions -
- Expression:CurTime, Expression:CurTick : playing time of this triggered note
- Expression:CurPitch, Expression:CurPitchKey = (Expression:CurPitchKeyName + Expression:CurPitchKeyOctave) : pitch of triggered note
- Expression:CurVelocity : velocity of triggered note
- Expression:CurDuration, Expression:CurDurationTick : duration of triggered note, i.e. end time - start time of this triggered note.
Play notes
Sample capx
Use official audio's "action: Schedule next play" to play a note sound under "Condition:For each note".
Sample capx
Use official audio's "action: Schedule next play" to play a note sound under "Condition:For each note".
Play note events
Sample capx , Sample capx 2
Sample capx , Sample capx 2
Playing
Call "Action:Start" to start to play note events - "Condition:On note on" or "Condition:On note off" will be triggered at respondent time.
Call "Action:Start" to start to play note events - "Condition:On note on" or "Condition:On note off" will be triggered at respondent time.
Action: Start -> Condition: On note on/ On note off -> Expression: CurPitchKey
Get properties of triggered note by these expressions -
"Condition:On ended" will be triggered when all notes playing finished.
- Expression:CurTime, Expression:CurTick : playing time of this triggered note
- Expression:CurPitch, Expression:CurPitchKey = (Expression:CurPitchKeyName + Expression:CurPitchKeyOctave) : pitch of triggered note
- Expression:CurVelocity : velocity of triggered note
- Expression:CurDuration, Expression:CurDurationTick : duration of triggered note, i.e. end time - start time of this triggered note.
"Condition:On ended" will be triggered when all notes playing finished.
Stop playing
Call "Action:Stop" to stop playing notes.
Call "Action:Stop" to stop playing notes.
Pause or resume
Sample capx
Call "Action:Pause" to pause current playing, or call "Action:Resume" to continue playing.
Sample capx
Call "Action:Pause" to pause current playing, or call "Action:Resume" to continue playing.
Pitch keys mapping
The pitch keys mapping lists below -
The pitch keys mapping lists below -
The "octave" is start from -2. User could add "Octave offset" which set in property table to move up or down this mapping table.
Properties of midi
There are some properties of midi could be retrieved -
There are some properties of midi could be retrieved -
- Expression:EndTime : total length of this midi
Official save & load feature
This plugin support official save load feature.
This plugin support official save load feature.