ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
BrainModularBrainModular Users Forum2008-10-23T05:58:35+02:00https://www.brainmodular.com/forums/app.php/feed/topic/10272008-10-23T05:58:35+02:002008-10-23T05:58:35+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5842#p5842 Wow, that's a total education! Thanks SO MUCH, Bsork. Now I know how to create and call procedures, create data types, use booleans, do multiline comments, etc, etc.
I'm very excited to be able to do this kind of work in a scripting environment, and keeping the cabling from getting totally crazy ala reaktor.
Can't wait! No sleep tonight!
-e
Statistics: Posted by woodslanding — 23 Oct 2008, 05:58
]]>2008-10-22T08:35:44+02:002008-10-22T08:35:44+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5820#p5820 Didn't know if the scripting language even had booleans. That's good to know. Did figure out logic ('&' and '|' weren't compiling)
I need to search through these archives for more samples.... the examples are all really basic scripts, but don't contain much logic.
Found midi codes at the back of the Usine manual!
Thanks, as always! -eric
Statistics: Posted by woodslanding — 22 Oct 2008, 08:35
]]>2008-10-22T08:02:23+02:002008-10-22T08:02:23+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5819#p5819 I think I might have pointed you in the wrong direction when I used that script as an example. It is relatively new, it does something similar, and it's quite short and shouldn't be too hard to understand, so I thought it was a good idea to start there. Sorry.
The script I'm doing uses arrays of booleans to keep track of the status of every note in every channel. It also keeps track of the min/max note number used per channel to reduce the CPU drain when the offs are sent. I don't have it here (at work...), or else I could've posted it in it's present state.
AFAIK, the list of constants that I'm sure is part of Usine's source code, isn't available within scripts, so either create your own constants or just use the figures. You're probably aware of this already, but tables of MIDI messages can be found at http://www.midi.org/techspecs/midimessages.php, and I guess some thousands of other places on the net.
]]>2008-10-22T07:00:48+02:002008-10-22T07:00:48+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5816#p5816 How would I modify this to work with a full data stream, not just note offs? What does the test for a note-off look like??
midiIn.msg = NOTEOFF //???
Constants for the msg types would be helpful in the help file, but I can't find anywhere in the scripts where anybody is testing for it--and I would expect a test for notes in both the transpose and the splitting scripts.
Thanks for any tips! -eric
Statistics: Posted by woodslanding — 22 Oct 2008, 07:00
]]>2008-10-02T11:51:12+02:002008-10-02T11:51:12+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5496#p5496Statistics: Posted by senso — 02 Oct 2008, 11:51
VAR pIn, pOut, pFlush : tParameter;VAR tmp : tMidi;VAR arr : ARRAY OF tMidi;VAR len, num, i : integer;PROCEDURE init;BEGIN pIn := CreateParam('midi in', ptMidi); SetIsOutput(pIn, FALSE); pOut := CreateParam('midi out', ptMidi); SetIsInput(pOut, FALSE); pFlush := CreateParam('flush', ptButton); SetIsOutput(pFlush, FALSE); SetArrayLength(arr, 512);END;// mainBEGIN len := GetLength(pIn); FOR i := 0 TO (len - 1) DO BEGIN GetMidiArrayValue(pIn, i, tmp); arr[num] := tmp; num := num + 1; END; IF (GetValue(pFlush) = 1) THEN BEGIN SetLength(pOut, num); FOR i := 0 TO (num - 1) DO SetMidiArrayValue(pOut, i, arr[i]); num := 0; SetValue(pFlush, 0); END ELSE BEGIN SetLength(pOut, 0); END;END.
In your case, you should only send NoteOffs to the script, and connect the end-of-bar trigger to the flush input. It has NOT been tested much...
]]>2008-10-02T07:59:51+02:002008-10-02T07:59:51+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5489#p5489 BTW, about the question of not sending a 0: The "block" switch on the math/logical modules should do just that, if I have understood things correctly. I can't really remember that I have ever used it though. When you're creating triggers (akin to buttons), the best thing in my experience is always to produce a 1 when the trigger is supposed to - ahem - trigger, immediately (ie in the next execution block) followed by a 0.
]]>2008-10-01T18:11:03+02:002008-10-01T18:11:03+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5487#p5487The first part I figured out. The second part is my big problem. If i don't release a key, the last midi note off is still send at the end of the bar ! Bugger...
]]>2008-10-01T17:43:03+02:002008-10-01T17:43:03+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5486#p5486Then at the end of bar, send a 1 value into the create pin of the Create midi message module. The last note off send should be sent at the end of your bar. Of course, your midi message is MONO !
Be careful because if you don't send midi note off message, the last midi note off message will be send each time the end of bar is reach. So you have to find a solution. But I don't know what you want exactly so...it's up to you.
Sorry for my english;
Statistics: Posted by moody33 — 01 Oct 2008, 17:43
]]>2008-10-01T14:04:27+02:002008-10-01T14:04:27+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5485#p5485Only one litle detail doesn't work.
But I have perhaps complicated the problem to much....
Here is what I have : - The mechanisme of detecting the end of bar, sends out a 1 when the end of a bar is reached. This works. - A midi filter which filters the 'note off' messages from my keyboard to the Vsti, works
- Now the problem is that when I receive a note off from my keyboard, I want to delay this note off message until the end of the actual bar is reached.
]]>2008-10-01T13:47:25+02:002008-10-01T13:47:25+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5484#p5484 If you want to pass data only when 1, perhaps you could use a pass event flow module.....
Statistics: Posted by ethnix73 — 01 Oct 2008, 13:47
]]>2008-10-01T13:27:18+02:002008-10-01T13:27:18+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5483#p5483 I'm having a litle problem to which I don't find a solution.
I have a togle component, which obviously is changing between 0 and 1. At the back of the togle I want to pass only the 1 state to something else. When the output of the togle is 0, I don't want to pass that 0.
]]>BrainModularBrainModular Users Forum2008-10-23T05:58:35+02:00https://www.brainmodular.com/forums/app.php/feed/topic/10272008-10-23T05:58:35+02:002008-10-23T05:58:35+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5842#p5842 Wow, that's a total education! Thanks SO MUCH, Bsork. Now I know how to create and call procedures, create data types, use booleans, do multiline comments, etc, etc.
I'm very excited to be able to do this kind of work in a scripting environment, and keeping the cabling from getting totally crazy ala reaktor.
Can't wait! No sleep tonight!
-e
Statistics: Posted by woodslanding — 23 Oct 2008, 05:58
]]>2008-10-22T08:35:44+02:002008-10-22T08:35:44+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5820#p5820 Didn't know if the scripting language even had booleans. That's good to know. Did figure out logic ('&' and '|' weren't compiling)
I need to search through these archives for more samples.... the examples are all really basic scripts, but don't contain much logic.
Found midi codes at the back of the Usine manual!
Thanks, as always! -eric
Statistics: Posted by woodslanding — 22 Oct 2008, 08:35
]]>2008-10-22T08:02:23+02:002008-10-22T08:02:23+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5819#p5819 I think I might have pointed you in the wrong direction when I used that script as an example. It is relatively new, it does something similar, and it's quite short and shouldn't be too hard to understand, so I thought it was a good idea to start there. Sorry.
The script I'm doing uses arrays of booleans to keep track of the status of every note in every channel. It also keeps track of the min/max note number used per channel to reduce the CPU drain when the offs are sent. I don't have it here (at work...), or else I could've posted it in it's present state.
AFAIK, the list of constants that I'm sure is part of Usine's source code, isn't available within scripts, so either create your own constants or just use the figures. You're probably aware of this already, but tables of MIDI messages can be found at http://www.midi.org/techspecs/midimessages.php, and I guess some thousands of other places on the net.
]]>2008-10-22T07:00:48+02:002008-10-22T07:00:48+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5816#p5816 How would I modify this to work with a full data stream, not just note offs? What does the test for a note-off look like??
midiIn.msg = NOTEOFF //???
Constants for the msg types would be helpful in the help file, but I can't find anywhere in the scripts where anybody is testing for it--and I would expect a test for notes in both the transpose and the splitting scripts.
Thanks for any tips! -eric
Statistics: Posted by woodslanding — 22 Oct 2008, 07:00
]]>2008-10-02T11:51:12+02:002008-10-02T11:51:12+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5496#p5496Statistics: Posted by senso — 02 Oct 2008, 11:51
]]>2008-10-02T11:31:41+02:002008-10-02T11:31:41+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5495#p5495
We aim to please...
Beside the software itself, propably the best thing about Usine, the support here is great !
VAR pIn, pOut, pFlush : tParameter;VAR tmp : tMidi;VAR arr : ARRAY OF tMidi;VAR len, num, i : integer;PROCEDURE init;BEGIN pIn := CreateParam('midi in', ptMidi); SetIsOutput(pIn, FALSE); pOut := CreateParam('midi out', ptMidi); SetIsInput(pOut, FALSE); pFlush := CreateParam('flush', ptButton); SetIsOutput(pFlush, FALSE); SetArrayLength(arr, 512);END;// mainBEGIN len := GetLength(pIn); FOR i := 0 TO (len - 1) DO BEGIN GetMidiArrayValue(pIn, i, tmp); arr[num] := tmp; num := num + 1; END; IF (GetValue(pFlush) = 1) THEN BEGIN SetLength(pOut, num); FOR i := 0 TO (num - 1) DO SetMidiArrayValue(pOut, i, arr[i]); num := 0; SetValue(pFlush, 0); END ELSE BEGIN SetLength(pOut, 0); END;END.
In your case, you should only send NoteOffs to the script, and connect the end-of-bar trigger to the flush input. It has NOT been tested much...
]]>2008-10-02T07:59:51+02:002008-10-02T07:59:51+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5489#p5489 BTW, about the question of not sending a 0: The "block" switch on the math/logical modules should do just that, if I have understood things correctly. I can't really remember that I have ever used it though. When you're creating triggers (akin to buttons), the best thing in my experience is always to produce a 1 when the trigger is supposed to - ahem - trigger, immediately (ie in the next execution block) followed by a 0.
]]>2008-10-01T18:11:03+02:002008-10-01T18:11:03+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5487#p5487The first part I figured out. The second part is my big problem. If i don't release a key, the last midi note off is still send at the end of the bar ! Bugger...
]]>2008-10-01T17:43:03+02:002008-10-01T17:43:03+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5486#p5486Then at the end of bar, send a 1 value into the create pin of the Create midi message module. The last note off send should be sent at the end of your bar. Of course, your midi message is MONO !
Be careful because if you don't send midi note off message, the last midi note off message will be send each time the end of bar is reach. So you have to find a solution. But I don't know what you want exactly so...it's up to you.
Sorry for my english;
Statistics: Posted by moody33 — 01 Oct 2008, 17:43
]]>2008-10-01T14:04:27+02:002008-10-01T14:04:27+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5485#p5485Only one litle detail doesn't work.
But I have perhaps complicated the problem to much....
Here is what I have : - The mechanisme of detecting the end of bar, sends out a 1 when the end of a bar is reached. This works. - A midi filter which filters the 'note off' messages from my keyboard to the Vsti, works
- Now the problem is that when I receive a note off from my keyboard, I want to delay this note off message until the end of the actual bar is reached.
]]>2008-10-01T13:47:25+02:002008-10-01T13:47:25+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5484#p5484 If you want to pass data only when 1, perhaps you could use a pass event flow module.....
Statistics: Posted by ethnix73 — 01 Oct 2008, 13:47
]]>2008-10-01T13:27:18+02:002008-10-01T13:27:18+02:00https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5483#p5483 I'm having a litle problem to which I don't find a solution.
I have a togle component, which obviously is changing between 0 and 1. At the back of the togle I want to pass only the 1 state to something else. When the output of the togle is 0, I don't want to pass that 0.