Post by nic on May 22, 2014 12:59:54 GMT
I have been working with a customer recently and thought I might share some of the techniques (and a handy tool) that we have been exploring together.
The customer is pushing his EWI merged with a footpedal controller through MidiBridge and wanted to be able to trigger custom chords that he would define himself when he plays a certain note or if triggered by his footpedal controller which sends only program change events.
First of all, here is how you would define a custom chord to sound when you play a certain 'trigger' note on the instrument:
# Chord Generator - C Major triggered by Bb -1 MIDI note
NX 16 = XX 48 +C
NX 16 = XX 4C +C
NX 16 = XX 4F +C
NX 16 = XX 54 +C
NX 16 = XX +B # block trigger note
# - end C Major chord
That rule works best on a Stream Byter on an output/destination (ports on the right hand side) in MidiBridge. This is because you might want to include trigger notes in your chords and not have them trigger a chord when they are played. The rules clone the component chord notes from the trigger note and (optionally) block the actual trigger note from sounding.
That is pretty straight forward - a complication presents itself with the requirement to trigger these chords when a footpedal button is pressed. Remembering that the footpedal sends program change events, we have to a little more logic to carefully remap these to the trigger notes. Here I am going to hijack program change number 106 to trigger my custom chord:
# send all notes off on any footpedal trigger
CX 00-7F = BX 7B 00 +C
# Chord Generator - C Major triggered by Bb -1 MIDI note
CX 6A = 9X 16 50 # map PC 106 to note on
NX 16 = XX 48 +C
NX 16 = XX 4C +C
NX 16 = XX 4F +C
NX 16 = XX 54 +C
NX 16 = XX +B # block trigger note
CX 6A = XX +B # block trigger PC
# - end C Major chord
That first rule stops any currently sounded notes whenever any program change is received since our footpedal trigger is only generating note on events. The receiving synth app/external controller *must* honour the 'all notes off' message for this to work. It also takes care of turning off the currently playing chord when you press a footpedal button that is not mapped to a chord trigger. Note how I specified a program change number range for this (00-7F) so that if you want to only use a certain range for your footpedal triggers then you can adjust that range to suit your own situation. You only need that first rule once and then you can follow it with as many different chord definitions as you like.
Writing all those rules is really quite tedious so to make life simpler I created an online perl script to generate Stream Byter rules for defining the chords and (optionally) handling the program change triggers. The tool is available here and hopefully it is self-explanatory how to drive it. You just fill in your parameters for a chord, press the 'generate' button and then copy/paste the generated rules from that section of the the web page into the appropriate Stream Byter. Remember to press the 'Install Rules' button in the Stream Byter to deploy the rules!
Hopefully this tip will be of use to others. As always, any comments/questions, please post in this thread.
Regards, Nic.
The customer is pushing his EWI merged with a footpedal controller through MidiBridge and wanted to be able to trigger custom chords that he would define himself when he plays a certain note or if triggered by his footpedal controller which sends only program change events.
First of all, here is how you would define a custom chord to sound when you play a certain 'trigger' note on the instrument:
# Chord Generator - C Major triggered by Bb -1 MIDI note
NX 16 = XX 48 +C
NX 16 = XX 4C +C
NX 16 = XX 4F +C
NX 16 = XX 54 +C
NX 16 = XX +B # block trigger note
# - end C Major chord
That rule works best on a Stream Byter on an output/destination (ports on the right hand side) in MidiBridge. This is because you might want to include trigger notes in your chords and not have them trigger a chord when they are played. The rules clone the component chord notes from the trigger note and (optionally) block the actual trigger note from sounding.
That is pretty straight forward - a complication presents itself with the requirement to trigger these chords when a footpedal button is pressed. Remembering that the footpedal sends program change events, we have to a little more logic to carefully remap these to the trigger notes. Here I am going to hijack program change number 106 to trigger my custom chord:
# send all notes off on any footpedal trigger
CX 00-7F = BX 7B 00 +C
# Chord Generator - C Major triggered by Bb -1 MIDI note
CX 6A = 9X 16 50 # map PC 106 to note on
NX 16 = XX 48 +C
NX 16 = XX 4C +C
NX 16 = XX 4F +C
NX 16 = XX 54 +C
NX 16 = XX +B # block trigger note
CX 6A = XX +B # block trigger PC
# - end C Major chord
That first rule stops any currently sounded notes whenever any program change is received since our footpedal trigger is only generating note on events. The receiving synth app/external controller *must* honour the 'all notes off' message for this to work. It also takes care of turning off the currently playing chord when you press a footpedal button that is not mapped to a chord trigger. Note how I specified a program change number range for this (00-7F) so that if you want to only use a certain range for your footpedal triggers then you can adjust that range to suit your own situation. You only need that first rule once and then you can follow it with as many different chord definitions as you like.
Writing all those rules is really quite tedious so to make life simpler I created an online perl script to generate Stream Byter rules for defining the chords and (optionally) handling the program change triggers. The tool is available here and hopefully it is self-explanatory how to drive it. You just fill in your parameters for a chord, press the 'generate' button and then copy/paste the generated rules from that section of the the web page into the appropriate Stream Byter. Remember to press the 'Install Rules' button in the Stream Byter to deploy the rules!
Hopefully this tip will be of use to others. As always, any comments/questions, please post in this thread.
Regards, Nic.