|
Post by John Tennison on Oct 18, 2017 15:58:45 GMT
Dear Nic,
I need a module that will convert specific incoming Note-On events on a particular MIDI channel to outgoing Program change commands specified by a lookup table.
I need the lookup table to specify not only the particular program change command that will result from a particular incoming note-on, but also specificy the channel of the outgoing program change command that will be sent, which might be a different channel than that of the incoming Note-On.
For example, although although the module would only be listening to relevant Note-On commands on one MIDI channel, I might want the program change command generated by middle C (C3) to be a value of 64 on channel 7, while having the Program change command generated by C#3 to be a value of 48 on channel 12, etc, etc.
So I'm assuming that my lookup table will need 256 elements - 128 Program Change values, and another 128 elements to specify the particular MIDI channel that a particular program change command is to be sent out on in response to an incoming Note-On.
Note Offs should be blocked.
Nic, as always, thanks for your expertise in helping to create this functionality.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 19, 2017 11:50:59 GMT
Two lookup tables and some logic:
IF LOAD # lookup table for PC number ASS L00 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L10 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L20 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L30 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L40 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L50 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L60 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L70 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12
# lookup table for channel ASS I00 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I10 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I20 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I30 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I40 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I50 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I60 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS I70 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 END
# force note on/vel 0 to off 9X XX 00 = 8X
# trap all note ons IF M0 >= 90 IF M0 <= 9F
# determine PC+channel MAT J0 = C0 + IM1
# send PC from lookup SND J0 LM1
END END
# block all incoming events XX = XX +B
Regards, Nic.
|
|
gary
Oracle
SuperPower
Posts: 130
|
Post by gary on Oct 19, 2017 12:40:51 GMT
Hey Nic,
I have a question I’ve wondered about for some time regarding the lookup tables.
You have two here in this instance, using two local var arrays. I don’t understand the ASS values you give hex 10 hex 12. This has always been the case when you’re setting up a table and you use those hex numbers.
Can you explain please what’s happening here regarding the tables and/ or lookup tables in general with this population of values?
Thanks much Nic!
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 19, 2017 13:00:59 GMT
Hi @gary,
They are just purely arbitrary values I made up to save myself some typing.
The idea is that you modify the lookup table values to suit yourself.
Regards, Nic.
|
|
|
Post by John Tennison on Oct 19, 2017 13:13:57 GMT
Thanks!
|
|
gary
Oracle
SuperPower
Posts: 130
|
Post by gary on Oct 19, 2017 14:57:01 GMT
thanks nic, that clarity will be helpful for many whom come across it whilst learning! g~
|
|
|
Post by John Tennison on Oct 23, 2017 0:52:11 GMT
Nic,
I'm having a blast with the Note-On to Program Change table module! I was wanting to use this Stream Byter module to convert a MIDI keyboard controller's note-ons to PC commands to trigger scene changes in MIDIFire, but I'm wondering if this is possible. When I choose MIDIFire as a destination and send it the PC generated by the note played on the MIDI keyboard, MIDIFire does not change to the scene to which the program change I was mapped.
As a test, I sent the same PC from an external hardware source to the iPad running MIDIFire, and it changed scenes perfectly as expected.
So I am wondering if there is something about the current architecture of MIDIFire such that it cannot process a note-on into a PC, which is then used to change its scene.
If so, is there a workaround or some different routing that I should be using? (I could potentially run another instance of MIDIFire on another device, do the Note-On to PC conversionmon that device, and then send that PC to the iPad running MIDIfire for which I want to change scenes.)
|
|
|
Post by John Tennison on Oct 23, 2017 1:12:32 GMT
Perhaps one desirable approach would be adding an option for MDIfire to change scenes as a result of receiving not only PC commands, but also Note-On commands from an external source.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 23, 2017 12:23:16 GMT
You can switch MidiFire scenes with a note on via the Stream Byter. The trick here is to use the +I flag with a SND rule: (assuming your notes and scene channel are channel 1)
9X XX 00 = 8X IF M0 == 90 SND C0 M1 +I END
Feed your controller into this (leave output unconnected) and a note on will cause the scene to switch to the corresponding program change.
Regards, Nic.
|
|
|
Post by John Tennison on Oct 23, 2017 12:57:58 GMT
Thank you.
|
|