|
Post by zysgmn on Jan 25, 2021 18:33:07 GMT
hi nic ! first thanks a lot for your hard work ,midifire is a great app ,its very useful! but i dont konw how to program, so i need your help is there a way to record midi notes into lookup table? For example like i play midi keyboard c3 c3 g3 g3 a3 a3 g3 ...... then record into lookup table like K0 = 3c 3c 43 43 45 45 43 ...... and auto calculate recorded notes numbers in like K1 = $7 So i can copy to another use
Thanks in advance for any help.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 26, 2021 16:16:24 GMT
Hi zysgmn , Sure, just trap each note and add to the lookup table using an index. if load # L80 will be the current lookup table index assign L80 = 0 end
# trap all note on events if MT == 90 # add the note number into the lookup table assign LL80 = M1
# move to next index, and cycle back # to zero after 128 notes calc L80 = L80 + 1 if L80 == 80 assign L80 = 0 end end You probably want some sort of button for resetting the table too. eg. on button press assign L80 = 0 Regards, Nic.
|
|
|
Post by zysgmn on Jan 26, 2021 18:29:18 GMT
hi nic! thank you very much for your quick response, but please forgive my ignorance, I pasted it into stream byter and ran it, but I don't know where to see the notes I input like LL80 = 3c 3c 43 43 45 45 43... or do you mean I can use LL80 directly? but can I see these notes in that form ?please show me how to do,because I want to do some copy edit things, then paste to another stream byter module ,and can it calculate how many notes I input? please ,and thanks a lot again for your kind help
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 27, 2021 15:25:10 GMT
All your played note numbers are stored in the 'L' array from L0, with the value in L80 being the number of notes in the sequence.
If you want the notes to appear in other StreamByters, then use the 'G' array instead of the L array. You can update the label with the number of notes too. Here is the same script using the G array instead and showing the number of notes:
if load # G80 will be the current lookup table index assign G80 = 0 end
# trap all note on events if MT == 90 # add the note number into the lookup table assign GG80 = M1
# move to next index, and cycle back # to zero after 128 notes calc G80 = G80 + 1 if G80 == 80 assign G80 = 0 end
# update block label with note count set LB0 G80 +D end
Now, in your other StreamByter, you can look at the G array and play the notes. An example (press 'Install Rules' to hear the notes):
if load assign I0 = 0 0 while I0 < G80 send 90 GI0 40 +DI1 calc I1 = I1 + $1000 send 80 GI0 00 +DI1 calc I1 = I1 + $500
calc I0 = I0 + 1 end end
Regards, Nic
|
|
|
Post by zysgmn on Jan 27, 2021 19:17:37 GMT
Hi nic! Good news and bad news ,the good news is I use your G array code it works! (except theres always one more note when it's repeated don’t know why) but! the bad news is when i save it and reload the scene, all notes are gone ! I think it’s because All the notes in the G array are in memory, not save in the file, right? here is my original code(base on your code from another post) notes are example
IF LOAD ASS K0 = $60 $62 $64 $60 $60 $62 $64 $60 $64 $65 $67 $64 $65 $67 $67 $69 $67 $65 $64 $60 $67 $69 $67 $65 $64 $60 $60 $55 $60 $60 $55 $60 ASS K80 = $31 ASS L0 = 0 END 9X XX 00 = 8X IF M0 == 90 18 ASS M1 = KL0 END ASS M1 = KL0 END Then I follow your guide change to this
If load ASS L0 = 0 END 9X XX 00 = 8X
IF M0 == 90 18 ASS M1 = GL0 END ASS M1 = GL0 END And use your G array code as input notes code , it works, Except for there's always one more note when it's repeated
I think that’s why I feel it’s good to See notes like K0 = 3c 3c 43 43.... because it can be edit and save to file ,but type every note is too painful ahahaha
Please help me ! Thanks a lot again!
|
|
|
Post by uncledave on Jan 28, 2021 1:26:25 GMT
Just a suggestion. If you initialize the data you're going to use, followed by "+P", the updated values will be saved and restored in a host preset. For example, since you're using G,
if load ass G0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P ass G10 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P ass G80 = 0 +P end
Those updated values should be saved with a preset. Just be sure to initialize enough values to cover your longest note sequence.
|
|
|
Post by zysgmn on Jan 28, 2021 14:57:28 GMT
Thank you very much uncledave ! I use your code +p Behind nics G array input note code ass G80 = 0 +p and it worked! Input notes can save with scene now haha that’s a dream come true ! though still cant like k0 = 3c .... that form ,but input notes method is very easy now ,so happy ! Thanks a lot to you nic and uncledave again!
There’s another question nic , is there a way to record chords (at least two notes ) like notes into lookup table so I can use just one key to trigger in sequence ? and Can lookup table input more than 128 notes?
|
|
|
Post by zysgmn on Jan 28, 2021 16:09:52 GMT
Sad news guys ! When I close midifire and reopen reload the scene,all input notes are gone ! What happened? I test it several times and it’s the same , if don’t close midifire ,all seems fine ,but once you close midifire and reopen reload the scene , all input notes are gone!
|
|
|
Post by zysgmn on Jan 30, 2021 9:19:57 GMT
|
|