ArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2013-08-31T18:03:28+02:00 https://brainmodular.com/forums/app.php/feed/topic/4015 2013-08-31T18:03:28+02:00 2013-08-31T18:03:28+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27605#p27605 <![CDATA[Pass on change of array]]> Statistics: Posted by ceasless — 31 Aug 2013, 18:03


]]>
2013-08-27T22:11:26+02:00 2013-08-27T22:11:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27569#p27569 <![CDATA[Pass on change of array]]>
I've also uploaded this workspace.

Image

The second side to this drum sequencer will be that it has a customizable number of step sequencers which can be wired to parameters on a VST as well as saved in the pattern store. I'm thinking it may make sense to move the velocity stepper into that sub-patch as well, and have a combo box per voice that allows you to select whatever particular params you are wiring for that drum stepper.

If anyone with experience in scripting could take a look at this workspace (which, by the way, I think will start causing issues if it is re-tuned for polyphony), I'd really appreciate it. There are a handful of scripts* in there that I think others would appreciate, but I hesitate to share them while I am still experiencing breakdowns and other oddities with this patch.

* In this workspace: 'Midi Switch', 'Pass on Change (Array)', and 'Pattern Store'. Also developed for this project are 'MidiPlex' and 'MidiMux'. These come in handy with the polyphony mode. I'll make another workspace that includes them.

Statistics: Posted by ceasless — 27 Aug 2013, 22:11


]]>
2013-08-25T22:09:04+02:00 2013-08-25T22:09:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27550#p27550 <![CDATA[Pass on change of array]]>
Right now I am actually observing some frustrating behavior with regards to the array passing script I've posted above. In restarting this project I've run into a situation where step data is not passing back to itself through the script and thus you are unable to change any of the step values.

Hopefully these screenshots will help to explain.

This first one shows in the trace output of the patch cable that the array passing script works as expected, so long as it is not connected back into the step sequencer input.

Image

The second one shows that, after being connected, the value of the step I am trying to change is not reflecting back into the step sequencer. The new value I am inputting just disappears.

Image

I've uploaded this workspace which contains the sub patch featured in the screenshots above.

I've also been experiencing a lot of crashing when working on this stuff, but it generally happens when exiting the program (and after successfully saving). I've been basically running under the assumption that it has something to do with the scripts that I've been writing, but as far as I can tell from reading the documentation and looking at other scripts, they are written as they should be.

By the way, it works fine in the same sub-patch when working with sequenced switches instead of steps. Give the workspace a try and you should see what I mean.

Statistics: Posted by ceasless — 25 Aug 2013, 22:09


]]>
2013-08-25T06:50:54+02:00 2013-08-25T06:50:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27548#p27548 <![CDATA[Pass on change of array]]>
But it seems like Olivier is very good about streamlining conversion between types, whenever that is not ambiguous.... and whether an array has changed is not ambiguous......

Statistics: Posted by woodslanding — 25 Aug 2013, 06:50


]]>
2013-08-24T14:32:18+02:00 2013-08-24T14:32:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27543#p27543 <![CDATA[Pass on change of array]]> wiki: "Passes the input value only when it has changed. Otherwise, nothing passes through the module, as if the wire was deleted."

My use case however requires that it have a 'base signal' that is then overridden by an array that has changed.

I am definitely planning to share all the pieces I've put together so far, but I'm still working on the puzzle (crashes and other instabilities that most likely stem from some of the scripts I've written and/or the patching logic). Also, I've learned a lot since I began on this drum sequencer patch (especially with regards to polyphony), so a re-build is currently under way. I'll post it in this thread when I get a chance.

@woodslanding - Interesting mention of invisible conversion as a Usine philosophy. That actually runs a bit contrary to my patching/scripting experience so far but that is technical rather than philosophical. But from what I've seen I don't know how I'd have an input that takes both single values, arrays, midi, and text (for instance). I'd like to hear more!

Here is the 'Pass on Change (Array)' script:

CODE:

//////////////////////////// Pass On Change &#40;Array&#41;/////////////////////////// parameters declarationvar changer  &#58; tParameter;var constant &#58; tParameter;var outx     &#58; tParameter;// initialisation &#58; create parametersprocedure init;begin         changer &#58;= createParam&#40;'changer',ptArray&#41;;  setIsOutput&#40;changer,false&#41;;    constant &#58;= createParam&#40;'constant',ptArray&#41;;  setIsOutput&#40;constant,false&#41;;               outx &#58;= createParam&#40;'out',ptArray&#41;;  setIsInput&#40;outx,false&#41;;end;var i,len &#58; integer;                                     var v &#58; single;// Callback procedureProcedure Callback&#40;N&#58;integer&#41;; begin  case N of    changer&#58; begin      len &#58;= getLength&#40;changer&#41;;      for i&#58;=0 to len-1      do begin        v &#58;= getDataArrayValue&#40;changer,i&#41;;        setDataArrayValue&#40;outx,i,v&#41;;      end;       setLength&#40;outx,len&#41;;    end;        constant&#58; begin      len &#58;= getLength&#40;constant&#41;;       if len > 0      then begin        for i&#58;=0 to len-1        do begin          v &#58;= getDataArrayValue&#40;constant,i&#41;;          setDataArrayValue&#40;outx,i,v&#41;;        end;        setLength&#40;outx,len&#41;;         end;      end;      end;end;// Global variables//////////////////////////////// main proc//////////////////////////////Procedure Process;begin end;

Statistics: Posted by ceasless — 24 Aug 2013, 14:32


]]>
2013-08-23T22:12:53+02:00 2013-08-23T22:12:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27536#p27536 <![CDATA[Pass on change of array]]> Statistics: Posted by woodslanding — 23 Aug 2013, 22:12


]]>
2013-08-23T20:36:42+02:00 2013-08-23T20:36:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27535#p27535 <![CDATA[Pass on change of array]]>

Btw, i'm sure some users will be happy with your pass on change script for array, i remember some of them looking for this some times ago..

Statistics: Posted by nay-seven — 23 Aug 2013, 20:36


]]>
2013-08-23T12:14:06+02:00 2013-08-23T12:14:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27534#p27534 <![CDATA[Pass on change of array]]>
The more I'm using Usine, the more I'm realizing that thinking in terms of patches is a different beast than raw programming. Already I've realized that the magic of polyphony makes at least one of the scripts I've written redundant. So I can tell that there are problems that I've solved just by writing a new script that could be more easily solved using patches than I realized.

One script I've written that I can't seem to find an equivalent for though is 'Pass on change (Array)'. This takes two arrays, one which is the 'constant' (in my cases so far, the array output of sequenced switches/steps). The other is the 'changer', in my case this is the output of a 'Pattern Store' script. The output of this script then goes to the input of the the sequenced switches and it allows me to load patterns in while at the same time maintaining the ability to directly change the sequence.

I notice that there is a 'Pass only if changed' module already available in Usine, but it differs from mine in that it only takes one input. And that input is not of array type, so I figure it's not really useful in my case.

Is there a more efficient way to have a sequenced switches/step module take as input some patterns that are stored elsewhere, while at the same time allowing it to control itself in the usual manner?

(Also let me know if a patch would be better for understanding what I mean than my description above).

Statistics: Posted by ceasless — 23 Aug 2013, 12:14


]]>
BrainModular BrainModular Users Forum 2013-08-31T18:03:28+02:00 https://brainmodular.com/forums/app.php/feed/topic/4015 2013-08-31T18:03:28+02:00 2013-08-31T18:03:28+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27605#p27605 <![CDATA[Pass on change of array]]> Statistics: Posted by ceasless — 31 Aug 2013, 18:03


]]>
2013-08-27T22:11:26+02:00 2013-08-27T22:11:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27569#p27569 <![CDATA[Pass on change of array]]>
I've also uploaded this workspace.

Image

The second side to this drum sequencer will be that it has a customizable number of step sequencers which can be wired to parameters on a VST as well as saved in the pattern store. I'm thinking it may make sense to move the velocity stepper into that sub-patch as well, and have a combo box per voice that allows you to select whatever particular params you are wiring for that drum stepper.

If anyone with experience in scripting could take a look at this workspace (which, by the way, I think will start causing issues if it is re-tuned for polyphony), I'd really appreciate it. There are a handful of scripts* in there that I think others would appreciate, but I hesitate to share them while I am still experiencing breakdowns and other oddities with this patch.

* In this workspace: 'Midi Switch', 'Pass on Change (Array)', and 'Pattern Store'. Also developed for this project are 'MidiPlex' and 'MidiMux'. These come in handy with the polyphony mode. I'll make another workspace that includes them.

Statistics: Posted by ceasless — 27 Aug 2013, 22:11


]]>
2013-08-25T22:09:04+02:00 2013-08-25T22:09:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27550#p27550 <![CDATA[Pass on change of array]]>
Right now I am actually observing some frustrating behavior with regards to the array passing script I've posted above. In restarting this project I've run into a situation where step data is not passing back to itself through the script and thus you are unable to change any of the step values.

Hopefully these screenshots will help to explain.

This first one shows in the trace output of the patch cable that the array passing script works as expected, so long as it is not connected back into the step sequencer input.

Image

The second one shows that, after being connected, the value of the step I am trying to change is not reflecting back into the step sequencer. The new value I am inputting just disappears.

Image

I've uploaded this workspace which contains the sub patch featured in the screenshots above.

I've also been experiencing a lot of crashing when working on this stuff, but it generally happens when exiting the program (and after successfully saving). I've been basically running under the assumption that it has something to do with the scripts that I've been writing, but as far as I can tell from reading the documentation and looking at other scripts, they are written as they should be.

By the way, it works fine in the same sub-patch when working with sequenced switches instead of steps. Give the workspace a try and you should see what I mean.

Statistics: Posted by ceasless — 25 Aug 2013, 22:09


]]>
2013-08-25T06:50:54+02:00 2013-08-25T06:50:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27548#p27548 <![CDATA[Pass on change of array]]>
But it seems like Olivier is very good about streamlining conversion between types, whenever that is not ambiguous.... and whether an array has changed is not ambiguous......

Statistics: Posted by woodslanding — 25 Aug 2013, 06:50


]]>
2013-08-24T14:32:18+02:00 2013-08-24T14:32:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27543#p27543 <![CDATA[Pass on change of array]]> wiki: "Passes the input value only when it has changed. Otherwise, nothing passes through the module, as if the wire was deleted."

My use case however requires that it have a 'base signal' that is then overridden by an array that has changed.

I am definitely planning to share all the pieces I've put together so far, but I'm still working on the puzzle (crashes and other instabilities that most likely stem from some of the scripts I've written and/or the patching logic). Also, I've learned a lot since I began on this drum sequencer patch (especially with regards to polyphony), so a re-build is currently under way. I'll post it in this thread when I get a chance.

@woodslanding - Interesting mention of invisible conversion as a Usine philosophy. That actually runs a bit contrary to my patching/scripting experience so far but that is technical rather than philosophical. But from what I've seen I don't know how I'd have an input that takes both single values, arrays, midi, and text (for instance). I'd like to hear more!

Here is the 'Pass on Change (Array)' script:

CODE:

//////////////////////////// Pass On Change &#40;Array&#41;/////////////////////////// parameters declarationvar changer  &#58; tParameter;var constant &#58; tParameter;var outx     &#58; tParameter;// initialisation &#58; create parametersprocedure init;begin         changer &#58;= createParam&#40;'changer',ptArray&#41;;  setIsOutput&#40;changer,false&#41;;    constant &#58;= createParam&#40;'constant',ptArray&#41;;  setIsOutput&#40;constant,false&#41;;               outx &#58;= createParam&#40;'out',ptArray&#41;;  setIsInput&#40;outx,false&#41;;end;var i,len &#58; integer;                                     var v &#58; single;// Callback procedureProcedure Callback&#40;N&#58;integer&#41;; begin  case N of    changer&#58; begin      len &#58;= getLength&#40;changer&#41;;      for i&#58;=0 to len-1      do begin        v &#58;= getDataArrayValue&#40;changer,i&#41;;        setDataArrayValue&#40;outx,i,v&#41;;      end;       setLength&#40;outx,len&#41;;    end;        constant&#58; begin      len &#58;= getLength&#40;constant&#41;;       if len > 0      then begin        for i&#58;=0 to len-1        do begin          v &#58;= getDataArrayValue&#40;constant,i&#41;;          setDataArrayValue&#40;outx,i,v&#41;;        end;        setLength&#40;outx,len&#41;;         end;      end;      end;end;// Global variables//////////////////////////////// main proc//////////////////////////////Procedure Process;begin end;

Statistics: Posted by ceasless — 24 Aug 2013, 14:32


]]>
2013-08-23T22:12:53+02:00 2013-08-23T22:12:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27536#p27536 <![CDATA[Pass on change of array]]> Statistics: Posted by woodslanding — 23 Aug 2013, 22:12


]]>
2013-08-23T20:36:42+02:00 2013-08-23T20:36:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27535#p27535 <![CDATA[Pass on change of array]]>

Btw, i'm sure some users will be happy with your pass on change script for array, i remember some of them looking for this some times ago..

Statistics: Posted by nay-seven — 23 Aug 2013, 20:36


]]>
2013-08-23T12:14:06+02:00 2013-08-23T12:14:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=4015&p=27534#p27534 <![CDATA[Pass on change of array]]>
The more I'm using Usine, the more I'm realizing that thinking in terms of patches is a different beast than raw programming. Already I've realized that the magic of polyphony makes at least one of the scripts I've written redundant. So I can tell that there are problems that I've solved just by writing a new script that could be more easily solved using patches than I realized.

One script I've written that I can't seem to find an equivalent for though is 'Pass on change (Array)'. This takes two arrays, one which is the 'constant' (in my cases so far, the array output of sequenced switches/steps). The other is the 'changer', in my case this is the output of a 'Pattern Store' script. The output of this script then goes to the input of the the sequenced switches and it allows me to load patterns in while at the same time maintaining the ability to directly change the sequence.

I notice that there is a 'Pass only if changed' module already available in Usine, but it differs from mine in that it only takes one input. And that input is not of array type, so I figure it's not really useful in my case.

Is there a more efficient way to have a sequenced switches/step module take as input some patterns that are stored elsewhere, while at the same time allowing it to control itself in the usual manner?

(Also let me know if a patch would be better for understanding what I mean than my description above).

Statistics: Posted by ceasless — 23 Aug 2013, 12:14


]]>