User Tools

Site Tools


midi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
midi [2008/12/13 09:43]
pegasus Fixed sed command
midi [2008/12/17 16:16]
pegasus
Line 6: Line 6:
  
 Scope of required changes: Scope of required changes:
-  - Changes to the current and new MIDI mapping file formats +  - <del>Changes to the current and new MIDI mapping file formats</​del>​ 
-  - Additional script option MIDI event type handlers (configobject.cpp midiobject.cpp) +  - <del>Additional script option MIDI event type handlers (configobject.cpp midiobject.cpp)</​del>​ 
-  - A script file loaded at start-up that contains a library of functions, add all those functions will need to be parsed and made available to midi learning. +  - <del>A script file loaded at start-up that contains a library of functions, add all those functions will need to be parsed and made available to midi learning.</​del>​ 
-  - Interface definition for arguments passed to mapped script methods (to include the raw MIDI event details, which channel, and any options associated with the mapping)+  - Interface definition for arguments passed to mapped script methods (to include the raw MIDI event details, which channel, and any options associated with the mapping.) **Partially complete**. Currently passing channel, control/​note,​ value, and device as parameters. The channel # and device name belong in MidiObject (instead of dlgprefmidibindings.)
  
 ===== Example of Hercules Mk2 FX/Cue/Loop mode switch button ===== ===== Example of Hercules Mk2 FX/Cue/Loop mode switch button =====
Line 162: Line 162:
  
 Steps to loading: Steps to loading:
-  - read file '​midi-mappings-scripts.js'​ into a QString (refered to from here on as //​scriptFile//​) +  - <del>read file '​midi-mappings-scripts.js'​ into a QString (refered to from here on as //​scriptFile//​)</​del>​ 
-  - parse all lines matching mappable function signatures into a QStringList (refered to from here on as //​functionsMap//​). ​ Pure regex equivalent of this: <code shell>​grep '​function'​ midi-mappings-scripts.js|grep -i '​(msg)'​|sed -e '​s/​function \(.*\)(msg).*/​\1/​i'​ -e 's/[= ]//​g'</​code>​ should just about do it. +  - <del>parse all lines matching mappable function signatures into a QStringList (refered to from here on as //​functionsMap//​).</​del> ​ Pure regex equivalent of this: <code shell>​grep '​function'​ midi-mappings-scripts.js|grep -i '​(msg)'​|sed -e '​s/​function \(.*\)(msg).*/​\1/​i'​ -e 's/[= ]//​g'</​code>​ should just about do it. 
-  - Load mapping file, verify that all //<​script-binding/>//​ references are present in //​functionsMap//,​ else pop-up an error message indicating unmapped option. (don't assert, otherwise app dies and it will be impossible to correct inside the learning prefs screen). +  - <del>Load mapping file, verify that all //<​script-binding/>//​ references are present in //​functionsMap//,​ else pop-up an error message indicating unmapped option.</​del> ​(don't assert, otherwise app dies and it will be impossible to correct inside the learning prefs screen). 
-  - QtScriptEngine works by accepting a string argument. ​  Pass //​scriptFile//,​ check //​canEvaluate//​ -> false throw a pop-up indicating a scripting error...  +  - QtScriptEngine works by accepting a string argument. ​  <del>Pass //​scriptFile//,​ check //​canEvaluate//​ -> false throw a pop-up indicating a scripting error...</​del>​ Using a qDebug() for now
-  - Whenever a mapping with a //<​script-binding/>//​ option is triggered, evaluate that method in the QtScript, passing in the msg (w/ with channel data and data from raw midi event that triggered it).+  - <del>Whenever a mapping with a //<​script-binding/>//​ option is triggered, evaluate that method in the QtScript, passing in the msg (w/ with channel data and data from raw midi event that triggered it).</​del>​ Channel # and MIDI device name need to be in the MidiObject for script access in the future. (The init() and shutdown() functions depend on it.)
  
 Phase 2: a //<​script>//​ block will be added to the XML to hold controller specific QtScript functions. ​ There are considerations such as function name collisions and remapping to consider, global functions generic to all controllers will still be loaded from the //​mid-mapping-script.js//​ file as well. Phase 2: a //<​script>//​ block will be added to the XML to hold controller specific QtScript functions. ​ There are considerations such as function name collisions and remapping to consider, global functions generic to all controllers will still be loaded from the //​mid-mapping-script.js//​ file as well.
- 
  
midi.txt · Last modified: 2008/12/17 16:16 by pegasus