ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2008-10-23T05:58:35+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/1027 2008-10-23T05:58:35+02:00 2008-10-23T05:58:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5842#p5842 <![CDATA[Pass data only when 1 ?]]>
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-23T01:10:53+02:00 2008-10-23T01:10:53+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5839#p5839 <![CDATA[Pass data only when 1 ?]]>
-e

Statistics: Posted by woodslanding — 23 Oct 2008, 01:10


]]>
2008-10-22T23:20:35+02:00 2008-10-22T23:20:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5835#p5835 <![CDATA[Pass data only when 1 ?]]>

Statistics: Posted by bsork — 22 Oct 2008, 23:20


]]>
2008-10-22T08:35:44+02:00 2008-10-22T08:35:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5820#p5820 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-22T08:02:23+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5819#p5819 <![CDATA[Pass data only when 1 ?]]>
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.

Statistics: Posted by bsork — 22 Oct 2008, 08:02


]]>
2008-10-22T07:00:48+02:00 2008-10-22T07:00:48+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5816#p5816 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-02T11:51:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5496#p5496 <![CDATA[Pass data only when 1 ?]]> Statistics: Posted by senso — 02 Oct 2008, 11:51


]]>
2008-10-02T11:31:41+02:00 2008-10-02T11:31:41+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5495#p5495 <![CDATA[Pass data only when 1 ?]]>
:cool: We aim to please... ;)
Beside the software itself, propably the best thing about Usine, the support here is great !

k

Statistics: Posted by kara — 02 Oct 2008, 11:31


]]>
2008-10-02T10:48:07+02:00 2008-10-02T10:48:07+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5494#p5494 <![CDATA[Pass data only when 1 ?]]> We aim to please... ;)

Statistics: Posted by bsork — 02 Oct 2008, 10:48


]]>
2008-10-02T10:34:06+02:00 2008-10-02T10:34:06+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5493#p5493 <![CDATA[Pass data only when 1 ?]]> It works exactly as I wanted

Great, thanks !

k

Statistics: Posted by kara — 02 Oct 2008, 10:34


]]>
2008-10-02T08:54:11+02:00 2008-10-02T08:54:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5491#p5491 <![CDATA[Pass data only when 1 ?]]>

CODE:

VAR pIn, pOut, pFlush &#58; tParameter;VAR tmp &#58; tMidi;VAR arr &#58; ARRAY OF tMidi;VAR len, num, i &#58; integer;PROCEDURE init;BEGIN   pIn &#58;= CreateParam&#40;'midi in', ptMidi&#41;; SetIsOutput&#40;pIn, FALSE&#41;;   pOut &#58;= CreateParam&#40;'midi out', ptMidi&#41;; SetIsInput&#40;pOut, FALSE&#41;;   pFlush &#58;= CreateParam&#40;'flush', ptButton&#41;; SetIsOutput&#40;pFlush, FALSE&#41;;   SetArrayLength&#40;arr, 512&#41;;END;// mainBEGIN  len &#58;= GetLength&#40;pIn&#41;;  FOR i &#58;= 0 TO &#40;len - 1&#41; DO BEGIN     GetMidiArrayValue&#40;pIn, i, tmp&#41;;     arr&#91;num&#93; &#58;= tmp;     num &#58;= num + 1;  END;  IF &#40;GetValue&#40;pFlush&#41; = 1&#41; THEN BEGIN     SetLength&#40;pOut, num&#41;;     FOR i &#58;= 0 TO &#40;num - 1&#41; DO       SetMidiArrayValue&#40;pOut, i, arr&#91;i&#93;&#41;;     num &#58;= 0;     SetValue&#40;pFlush, 0&#41;;  END  ELSE BEGIN     SetLength&#40;pOut, 0&#41;;  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...

Statistics: Posted by bsork — 02 Oct 2008, 08:54


]]>
2008-10-02T07:59:51+02:00 2008-10-02T07:59:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5489#p5489 <![CDATA[Pass data only when 1 ?]]>
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.

Statistics: Posted by bsork — 02 Oct 2008, 07:59


]]>
2008-10-01T18:11:03+02:00 2008-10-01T18:11:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5487#p5487 <![CDATA[Pass data only when 1 ?]]> The 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...

k

Statistics: Posted by kara — 01 Oct 2008, 18:11


]]>
2008-10-01T17:43:03+02:00 2008-10-01T17:43:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5486#p5486 <![CDATA[Pass data only when 1 ?]]> Then 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:00 2008-10-01T14:04:27+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5485#p5485 <![CDATA[Pass data only when 1 ?]]> Only 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.

Perhaps you have better idea to do this ?

thx
k

Statistics: Posted by kara — 01 Oct 2008, 14:04


]]>
2008-10-01T13:47:25+02:00 2008-10-01T13:47:25+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5484#p5484 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-01T13:27:18+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5483#p5483 <![CDATA[Pass data only when 1 ?]]>
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.

Any solutions for that ?

k

Statistics: Posted by kara — 01 Oct 2008, 13:27


]]>
BrainModular BrainModular Users Forum 2008-10-23T05:58:35+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/1027 2008-10-23T05:58:35+02:00 2008-10-23T05:58:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5842#p5842 <![CDATA[Pass data only when 1 ?]]>
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-23T01:10:53+02:00 2008-10-23T01:10:53+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5839#p5839 <![CDATA[Pass data only when 1 ?]]>
-e

Statistics: Posted by woodslanding — 23 Oct 2008, 01:10


]]>
2008-10-22T23:20:35+02:00 2008-10-22T23:20:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5835#p5835 <![CDATA[Pass data only when 1 ?]]>

Statistics: Posted by bsork — 22 Oct 2008, 23:20


]]>
2008-10-22T08:35:44+02:00 2008-10-22T08:35:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5820#p5820 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-22T08:02:23+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5819#p5819 <![CDATA[Pass data only when 1 ?]]>
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.

Statistics: Posted by bsork — 22 Oct 2008, 08:02


]]>
2008-10-22T07:00:48+02:00 2008-10-22T07:00:48+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5816#p5816 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-02T11:51:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5496#p5496 <![CDATA[Pass data only when 1 ?]]> Statistics: Posted by senso — 02 Oct 2008, 11:51


]]>
2008-10-02T11:31:41+02:00 2008-10-02T11:31:41+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5495#p5495 <![CDATA[Pass data only when 1 ?]]>
:cool: We aim to please... ;)
Beside the software itself, propably the best thing about Usine, the support here is great !

k

Statistics: Posted by kara — 02 Oct 2008, 11:31


]]>
2008-10-02T10:48:07+02:00 2008-10-02T10:48:07+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5494#p5494 <![CDATA[Pass data only when 1 ?]]> We aim to please... ;)

Statistics: Posted by bsork — 02 Oct 2008, 10:48


]]>
2008-10-02T10:34:06+02:00 2008-10-02T10:34:06+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5493#p5493 <![CDATA[Pass data only when 1 ?]]> It works exactly as I wanted

Great, thanks !

k

Statistics: Posted by kara — 02 Oct 2008, 10:34


]]>
2008-10-02T08:54:11+02:00 2008-10-02T08:54:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5491#p5491 <![CDATA[Pass data only when 1 ?]]>

CODE:

VAR pIn, pOut, pFlush &#58; tParameter;VAR tmp &#58; tMidi;VAR arr &#58; ARRAY OF tMidi;VAR len, num, i &#58; integer;PROCEDURE init;BEGIN   pIn &#58;= CreateParam&#40;'midi in', ptMidi&#41;; SetIsOutput&#40;pIn, FALSE&#41;;   pOut &#58;= CreateParam&#40;'midi out', ptMidi&#41;; SetIsInput&#40;pOut, FALSE&#41;;   pFlush &#58;= CreateParam&#40;'flush', ptButton&#41;; SetIsOutput&#40;pFlush, FALSE&#41;;   SetArrayLength&#40;arr, 512&#41;;END;// mainBEGIN  len &#58;= GetLength&#40;pIn&#41;;  FOR i &#58;= 0 TO &#40;len - 1&#41; DO BEGIN     GetMidiArrayValue&#40;pIn, i, tmp&#41;;     arr&#91;num&#93; &#58;= tmp;     num &#58;= num + 1;  END;  IF &#40;GetValue&#40;pFlush&#41; = 1&#41; THEN BEGIN     SetLength&#40;pOut, num&#41;;     FOR i &#58;= 0 TO &#40;num - 1&#41; DO       SetMidiArrayValue&#40;pOut, i, arr&#91;i&#93;&#41;;     num &#58;= 0;     SetValue&#40;pFlush, 0&#41;;  END  ELSE BEGIN     SetLength&#40;pOut, 0&#41;;  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...

Statistics: Posted by bsork — 02 Oct 2008, 08:54


]]>
2008-10-02T07:59:51+02:00 2008-10-02T07:59:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5489#p5489 <![CDATA[Pass data only when 1 ?]]>
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.

Statistics: Posted by bsork — 02 Oct 2008, 07:59


]]>
2008-10-01T18:11:03+02:00 2008-10-01T18:11:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5487#p5487 <![CDATA[Pass data only when 1 ?]]> The 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...

k

Statistics: Posted by kara — 01 Oct 2008, 18:11


]]>
2008-10-01T17:43:03+02:00 2008-10-01T17:43:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5486#p5486 <![CDATA[Pass data only when 1 ?]]> Then 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:00 2008-10-01T14:04:27+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5485#p5485 <![CDATA[Pass data only when 1 ?]]> Only 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.

Perhaps you have better idea to do this ?

thx
k

Statistics: Posted by kara — 01 Oct 2008, 14:04


]]>
2008-10-01T13:47:25+02:00 2008-10-01T13:47:25+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5484#p5484 <![CDATA[Pass data only when 1 ?]]>
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:00 2008-10-01T13:27:18+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=1027&p=5483#p5483 <![CDATA[Pass data only when 1 ?]]>
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.

Any solutions for that ?

k

Statistics: Posted by kara — 01 Oct 2008, 13:27


]]>