|
Post by spookyzoo on Jan 26, 2019 10:54:06 GMT
Hi Nic,
Is there an easy way to instantly create a lookup table from incoming midi data?
I realise that it has its own M array, but to be used in some workarounds with MidiDesigner I’d like to store the Midi array in a lookup table using an alternative variable.
Could I do this with a range if I know the incoming midi message length?
something like...
IF M0 == F0 00 20 29
ASS K0-7F = M0-M7F
END
Thanks in advance for any help.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 26, 2019 11:09:32 GMT
Hi spookyzoo , You mean you want to copy the current message into a local (or global) array? This code, copies current message into array L and uses the special variable 'ML' (message length) for the number of bytes to copy (max 128 bytes though) ASS I0 = 0 IF I0 < ML +L ASS LI0 = MI0 MAT I0 = I0 + 1 ENDRegards, Nic.
|
|
|
Post by spookyzoo on Jan 26, 2019 14:25:48 GMT
Great, thanks Nic!
|
|
|
Post by spookyzoo on Jan 31, 2019 21:40:36 GMT
Is there a way to do this for a greater number of bytes than 128?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 31, 2019 22:32:18 GMT
Hi spookyzoo, Multiple consecutive loops! Will give some code for this if you get stuck trying to follow my cryptic response. Will be a day or two tho. Regards, Nic.
|
|
slmnv
Converser
Posts: 22
|
Post by slmnv on Feb 3, 2019 14:31:28 GMT
Hi Nic, Is it possible to increase limit for loop from 128 cycles to 2^16 as variable length allows that and send notification if loop count exceed some number?
Also do you plan adding new commands to simplify coding ? First coming to my mind are "quit from the module", "else", use of brackets
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 4, 2019 15:19:55 GMT
Hi slmnv , > Is it possible to increase limit for loop from 128 cycles to 2^16 as variable length allows that > and send notification if loop count exceed some number?So the maximum loop count is done on purpose so it is not easy to create infinite loops and cause nasty app hangs. I chose 128 as that is most often the number of times you need to loop for notes, controllers etc. If you need 256 iterations you do: # loop 1, 0 to 127 ASS I0 = 0 IF I0 < 80 +L # ... do your stuff ASS I0 = I0 + 1 END
# loop 2, 128 to 255 # here, I0 should be 80 IF I0 < 100 +L # ... do your stuff ASS I0 = i0 + 1 END> Also do you plan adding new commands to simplify coding ? > First coming to my mind are "quit from the module", "else", use of bracketsAn ELSE clause is on my todo list. I have often wished for this myself. I can see an early termination would be useful too. Not sure where brackets would be of any use though? - indents already define a clause inside an IF/END These things *may* come with a future update, but I cannot make any promises. Regards, Nic.
|
|
slmnv
Converser
Posts: 22
|
Post by slmnv on Apr 11, 2019 4:10:48 GMT
I found one thing that is difficult in MIDIfire. I have 7 large stream bite modules that are different only by initial parameters in LOAD section. This would be similar to 7 bluevelvet modules for 7 different buttons.
I saved them all together in one scene, I do not want to merge them every time. Now if I correct a line below LOAD I need to do it in 7 places as code is repeated 7 times. I understand the need to edit 7 different LOAD sections but the code below is all the same and could be kept in one place. Something like #INCLUDE of code snipped would be good to have, and snippets may be kept in special scenes.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 11, 2019 9:50:48 GMT
Hi slmnv , That's a good point. I will think about this for the upcoming MidiFire update - I think this would indeed be useful. Not knowing what your 7 IF LOAD sections look like, but would using the Global (G) array assist with this at all? This bit of memory is shared with all StreamByters. You would setup an 'Init' StreamByter module (not connected to anything) just with its own IF LOAD clause, something like: IF LOAD ASS G0 = 12 ASS G1 = 45 ASS G2 = 7F ENDThen in each of the 7 other Stream Byters refer to G0, G1 or G2. Now, the trick is that you need the StreamByter that sets up the G values to have been added to the MidiFire canvas before the other ones as they are configured in that order. To do this, create a blank canvas, add the StreamByter to contain the globals and then merge the other scene into this one and save. That way the G array will be configured in the 1st StreamByter before the other ones are run up. Regards, Nic.
|
|