ArrayArray BrainModular BrainModular Users Forum 2013-09-22T19:20:39+02:00 https://brainmodular.org/forums/app.php/feed/topic/4073 2013-09-22T19:20:39+02:00 2013-09-22T19:20:39+02:00 https://brainmodular.org/forums/viewtopic.php?t=4073&p=27839#p27839 <![CDATA[presetmanager in hollyhock question]]>
The Preset Manager simply remains ignorant of the fact that there are multiple step sequencers and a sequenced switch to keep track of. That is, storing into a preset does not mean anything, as switching presets just carries over whatever is currently in the sequencers. Recalling a preset that had different values saved previously doesn't do anything, it just carries over the current values too.

Here is a 'Pattern Store' script I wrote in order to save the array values of the sequencers, in case it helps somehow:

CODE:

//////////////////////////// Pattern Store  /////////////////////////// parameters declarationconst PATTERNs = 8;const STEPs = 32;const IOs = 9;                                                          var MEMs &#58; integer;                                      type tStep    = array &#91;0..STEPs-1&#93; of single;type stepBank = array &#91;0..IOs-1&#93; of tStep;    var  patternBank &#58; array of stepBank;var  memory   &#58; array &#91;0..&#40;PATTERNs*IOs&#41;-1&#93; of tParameter;var  stepIn   &#58; array of integer;var  stepOut  &#58; array of integer;var  store    &#58; tParameter;var  load     &#58; tParameter; var  stepNum  &#58; tParameter;  var  current  &#58; tParameter;var  copy     &#58; tParameter;//var  copys    &#58; tParameter;var  resetP   &#58; tParameter;var  resetA   &#58; tParameter;                                         var  p,i,n,s  &#58; integer;                                                            // initialisation &#58; create parametersprocedure init;begin  MEMs &#58;= PATTERNs * IOs;  writeln&#40;'length of all my MEMs '+inttostr&#40;MEMs&#41;&#41;;                              setArrayLength&#40;patternBank,PATTERNS&#41;;  setArrayLength&#40;stepIn,IOs&#41;;                    setArrayLength&#40;stepOut,IOs&#41;;    store &#58;= createParam&#40;'store',ptButton&#41;;  setIsOutput&#40;store,false&#41;;  load  &#58;= createParam&#40;'load',ptDataField&#41;;  setIsOutput&#40;load,false&#41;;    copy  &#58;= createParam&#40;'copy',ptSwitch&#41;;  setIsOutput&#40;copy,false&#41;;  setIsSeparator&#40;copy,true&#41;;// copys &#58;= createParam&#40;'copy store',ptButton&#41;;// setIsInput&#40;copys,false&#41;;                                  stepNum &#58;= createParam&#40;'step num',ptDataField&#41;;  setIsSeparator&#40;stepNum,true&#41;;            current &#58;= createParam&#40;'current',ptDataField&#41;;  setIsInput&#40;current,false&#41;;      setIsOutput&#40;current,false&#41;;    resetP &#58;= createParam&#40;'reset pattern',ptButton&#41;;  setIsOutput&#40;resetP,false&#41;;    resetA &#58;= createParam&#40;'reset all',ptButton&#41;;  setIsOutput&#40;resetA,false&#41;;    for i &#58;= 0 to IOs-1                  do begin                                                              stepIn&#91;i&#93; &#58;= createParam&#40;'seq '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsOutput&#40;stepIn&#91;i&#93;,false&#41;;         for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;stepIn&#91;i&#93;,s,0&#41;;    end;                    setLength&#40;stepIn&#91;i&#93;,STEPs&#41;;    end;                                                       setIsSeparator&#40;stepIn&#91;0&#93;,true&#41;;      for i &#58;= 0 to IOs-1                  do begin    stepOut&#91;i&#93; &#58;= createParam&#40;'seq '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsInput&#40;stepOut&#91;i&#93;,false&#41;;           for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;stepOut&#91;i&#93;,s,0&#41;;    end;                    setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;    end;    for i&#58;=0 to MEMs-1                              do begin    memory&#91;i&#93; &#58;= createParam&#40;'mem '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsInput&#40;memory&#91;i&#93;,false&#41;;    setIsOutput&#40;memory&#91;i&#93;,false&#41;;    setDontSave&#40;memory&#91;i&#93;,false&#41;;    setLength&#40;memory&#91;i&#93;,STEPs&#41;;        // i hope this only happens once, at the very beginning    for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;memory&#91;i&#93;,s,0&#41;;    end;  end;    writeln&#40;'initted'&#41;;  // load will hold a value from a switch group,  // so it will begin with a value.//  setvalue&#40;current, getValue&#40;load&#41;&#41;; end;                                               var choice,next,                                                               prev, x, m   &#58; integer;var v            &#58; single;var temp         &#58; tStep;// Callbackprocedure      Procedure Callback&#40;N&#58;integer&#41;;begin   case N of      resetP&#58; begin         choice &#58;= round&#40;getValue&#40;current&#41;&#41;;      writeln&#40;'reset pattern '+inttostr&#40;choice&#41;&#41;;      setLength&#40;stepOut&#91;choice&#93;,STEPs&#41;;      setLength&#40;memory&#91;choice&#93;,STEPs&#41;;        for s&#58;=0 to STEPs-1        do begin          setDataArrayValue&#40;memory&#91;choice&#93;,s,0&#41;;          setDataArrayValue&#40;stepOut&#91;choice&#93;,s,0&#41;;        end;                                        end;         resetA&#58; begin                   writeln&#40;'resetting all patterns'&#41;;      for m&#58;=0 to MEMs-1      do begin        for s&#58;=0 to STEPs-1        do begin          setDataArrayValue&#40;memory&#91;m&#93;,s,0&#41;;        end;                                   end;    end;                        copy&#58; begin      choice &#58;= round&#40;getvalue&#40;copy&#41;&#41;;      writeln&#40;'copy is '+inttostr&#40;choice&#41;&#41;;                                                       //      setValue&#40; copys, choice &#41;;    end;        store&#58; begin       choice &#58;= round&#40; getValue&#40;load&#41; &#41;;      for i &#58;= 0 to IOs-1      do begin        m &#58;= &#40;&#40;choice-1&#41; * PATTERNs&#41; + i;        writeln&#40;'storing in '+inttostr&#40;m&#41;&#41;;        setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;        setLength&#40;memory&#91;m&#93;,STEPs&#41;;                  for s &#58;= 0 to STEPs-1        do begin          temp&#91;s&#93; &#58;= getDataArrayValue&#40;stepIn&#91;i&#93;,s&#41;;          setDataArrayValue&#40;memory&#91;m&#93;,s,temp&#91;s&#93;&#41;;          setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;        end;      end;     end;//store                    stepNum&#58; begin      if getValue&#40;stepNum&#41; = 1      then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;           if next <> prev                             then begin             writeln&#40;'setting current to load'&#41;;                 setValue&#40;current, next&#41;;        end;      end      else if getValue&#40;stepNum&#41; = 31       then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;           if next <> prev                           then begin                          for i&#58;=0 to IOs-1          do begin            n &#58;= &#40;&#40;next-1&#41; * IOs&#41; + i;                   writeln&#40;'getting values from '+inttostr&#40;n&#41;&#41;;             setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;                    for s&#58;=0 to STEPs-1            do begin               temp&#91;s&#93; &#58;= getDataArrayValue&#40;memory&#91;n&#93;,s&#41;;              setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;                                    end;                                                                   end;                            setValue&#40;current,next&#41;;        end;      end;         end;//stepNum        // this case handles 'copy to new pattern'    load&#58; begin      prev &#58;= round&#40; getValue&#40;current&#41;&#41;;      for i&#58;=0 to IOs-1      do begin                               p &#58;= &#40;&#40;prev-1&#41; * IOs&#41; + i;           writeln&#40;'auto-saving into '+inttostr&#40;p&#41;&#41;;                        setLength&#40;memory&#91;p&#93;,STEPs&#41;;         setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;        for s&#58;=0 to STEPs-1        do begin          temp&#91;s&#93; &#58;= getDataArrayValue&#40;stepIn&#91;i&#93;,s&#41;;          setDataArrayValue&#40;memory&#91;p&#93;,s,temp&#91;s&#93;&#41;;          setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;        end;      end;       choice &#58;= round&#40; getValue&#40;copy&#41; &#41;;      if choice = 1      then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;                            for i&#58;=0 to IOs-1                            do begin          n &#58;= &#40;&#40;next-1&#41; * IOs&#41; + i;          p &#58;= &#40;&#40;prev-1&#41; * IOs&#41; + i;          writeln&#40;'loading from '+inttostr&#40;p&#41;+' into '+inttostr&#40;n&#41;&#41;;          setLength&#40;memory&#91;n&#93;,STEPs&#41;;                            for s&#58;=0 to STEPs-1          do begin            temp&#91;s&#93; &#58;= getDataArrayValue&#40;memory&#91;p&#93;,s&#41;;            setDataArrayValue&#40;memory&#91;n&#93;,s,temp&#91;s&#93;&#41;;            end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          end;          // Don't leave copy on!        setValue&#40;copy,0&#41;;                         end;    end;                   end;end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          // Global variables               //var loadPattern &#58; integer;//var stepPos &#58; integer;                  //////////////////////////////// main proc                                                       //////////////////////////////                                          Procedure Process;begin                                                      // v2end;

Statistics: Posted by ceasless — 22 Sep 2013, 19:20


]]>
2013-09-19T22:31:05+02:00 2013-09-19T22:31:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=4073&p=27815#p27815 <![CDATA[presetmanager in hollyhock question]]>
i tried the preset manager in hollyhock and found its not working the way its supposed to
when i use patches containing other patches.

in usine 5 i m having no problems with this.

has someone experienced the same or am i am doing something wrong?



cheers
mark

Statistics: Posted by funkyguitarist — 19 Sep 2013, 22:31


]]>
BrainModular BrainModular Users Forum 2013-09-22T19:20:39+02:00 https://brainmodular.org/forums/app.php/feed/topic/4073 2013-09-22T19:20:39+02:00 2013-09-22T19:20:39+02:00 https://brainmodular.org/forums/viewtopic.php?t=4073&p=27839#p27839 <![CDATA[presetmanager in hollyhock question]]>
The Preset Manager simply remains ignorant of the fact that there are multiple step sequencers and a sequenced switch to keep track of. That is, storing into a preset does not mean anything, as switching presets just carries over whatever is currently in the sequencers. Recalling a preset that had different values saved previously doesn't do anything, it just carries over the current values too.

Here is a 'Pattern Store' script I wrote in order to save the array values of the sequencers, in case it helps somehow:

CODE:

//////////////////////////// Pattern Store  /////////////////////////// parameters declarationconst PATTERNs = 8;const STEPs = 32;const IOs = 9;                                                          var MEMs &#58; integer;                                      type tStep    = array &#91;0..STEPs-1&#93; of single;type stepBank = array &#91;0..IOs-1&#93; of tStep;    var  patternBank &#58; array of stepBank;var  memory   &#58; array &#91;0..&#40;PATTERNs*IOs&#41;-1&#93; of tParameter;var  stepIn   &#58; array of integer;var  stepOut  &#58; array of integer;var  store    &#58; tParameter;var  load     &#58; tParameter; var  stepNum  &#58; tParameter;  var  current  &#58; tParameter;var  copy     &#58; tParameter;//var  copys    &#58; tParameter;var  resetP   &#58; tParameter;var  resetA   &#58; tParameter;                                         var  p,i,n,s  &#58; integer;                                                            // initialisation &#58; create parametersprocedure init;begin  MEMs &#58;= PATTERNs * IOs;  writeln&#40;'length of all my MEMs '+inttostr&#40;MEMs&#41;&#41;;                              setArrayLength&#40;patternBank,PATTERNS&#41;;  setArrayLength&#40;stepIn,IOs&#41;;                    setArrayLength&#40;stepOut,IOs&#41;;    store &#58;= createParam&#40;'store',ptButton&#41;;  setIsOutput&#40;store,false&#41;;  load  &#58;= createParam&#40;'load',ptDataField&#41;;  setIsOutput&#40;load,false&#41;;    copy  &#58;= createParam&#40;'copy',ptSwitch&#41;;  setIsOutput&#40;copy,false&#41;;  setIsSeparator&#40;copy,true&#41;;// copys &#58;= createParam&#40;'copy store',ptButton&#41;;// setIsInput&#40;copys,false&#41;;                                  stepNum &#58;= createParam&#40;'step num',ptDataField&#41;;  setIsSeparator&#40;stepNum,true&#41;;            current &#58;= createParam&#40;'current',ptDataField&#41;;  setIsInput&#40;current,false&#41;;      setIsOutput&#40;current,false&#41;;    resetP &#58;= createParam&#40;'reset pattern',ptButton&#41;;  setIsOutput&#40;resetP,false&#41;;    resetA &#58;= createParam&#40;'reset all',ptButton&#41;;  setIsOutput&#40;resetA,false&#41;;    for i &#58;= 0 to IOs-1                  do begin                                                              stepIn&#91;i&#93; &#58;= createParam&#40;'seq '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsOutput&#40;stepIn&#91;i&#93;,false&#41;;         for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;stepIn&#91;i&#93;,s,0&#41;;    end;                    setLength&#40;stepIn&#91;i&#93;,STEPs&#41;;    end;                                                       setIsSeparator&#40;stepIn&#91;0&#93;,true&#41;;      for i &#58;= 0 to IOs-1                  do begin    stepOut&#91;i&#93; &#58;= createParam&#40;'seq '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsInput&#40;stepOut&#91;i&#93;,false&#41;;           for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;stepOut&#91;i&#93;,s,0&#41;;    end;                    setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;    end;    for i&#58;=0 to MEMs-1                              do begin    memory&#91;i&#93; &#58;= createParam&#40;'mem '+inttostr&#40;i+1&#41;,ptArray&#41;;    setIsInput&#40;memory&#91;i&#93;,false&#41;;    setIsOutput&#40;memory&#91;i&#93;,false&#41;;    setDontSave&#40;memory&#91;i&#93;,false&#41;;    setLength&#40;memory&#91;i&#93;,STEPs&#41;;        // i hope this only happens once, at the very beginning    for s&#58;=0 to STEPs-1    do begin      setDataArrayValue&#40;memory&#91;i&#93;,s,0&#41;;    end;  end;    writeln&#40;'initted'&#41;;  // load will hold a value from a switch group,  // so it will begin with a value.//  setvalue&#40;current, getValue&#40;load&#41;&#41;; end;                                               var choice,next,                                                               prev, x, m   &#58; integer;var v            &#58; single;var temp         &#58; tStep;// Callbackprocedure      Procedure Callback&#40;N&#58;integer&#41;;begin   case N of      resetP&#58; begin         choice &#58;= round&#40;getValue&#40;current&#41;&#41;;      writeln&#40;'reset pattern '+inttostr&#40;choice&#41;&#41;;      setLength&#40;stepOut&#91;choice&#93;,STEPs&#41;;      setLength&#40;memory&#91;choice&#93;,STEPs&#41;;        for s&#58;=0 to STEPs-1        do begin          setDataArrayValue&#40;memory&#91;choice&#93;,s,0&#41;;          setDataArrayValue&#40;stepOut&#91;choice&#93;,s,0&#41;;        end;                                        end;         resetA&#58; begin                   writeln&#40;'resetting all patterns'&#41;;      for m&#58;=0 to MEMs-1      do begin        for s&#58;=0 to STEPs-1        do begin          setDataArrayValue&#40;memory&#91;m&#93;,s,0&#41;;        end;                                   end;    end;                        copy&#58; begin      choice &#58;= round&#40;getvalue&#40;copy&#41;&#41;;      writeln&#40;'copy is '+inttostr&#40;choice&#41;&#41;;                                                       //      setValue&#40; copys, choice &#41;;    end;        store&#58; begin       choice &#58;= round&#40; getValue&#40;load&#41; &#41;;      for i &#58;= 0 to IOs-1      do begin        m &#58;= &#40;&#40;choice-1&#41; * PATTERNs&#41; + i;        writeln&#40;'storing in '+inttostr&#40;m&#41;&#41;;        setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;        setLength&#40;memory&#91;m&#93;,STEPs&#41;;                  for s &#58;= 0 to STEPs-1        do begin          temp&#91;s&#93; &#58;= getDataArrayValue&#40;stepIn&#91;i&#93;,s&#41;;          setDataArrayValue&#40;memory&#91;m&#93;,s,temp&#91;s&#93;&#41;;          setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;        end;      end;     end;//store                    stepNum&#58; begin      if getValue&#40;stepNum&#41; = 1      then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;           if next <> prev                             then begin             writeln&#40;'setting current to load'&#41;;                 setValue&#40;current, next&#41;;        end;      end      else if getValue&#40;stepNum&#41; = 31       then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;           if next <> prev                           then begin                          for i&#58;=0 to IOs-1          do begin            n &#58;= &#40;&#40;next-1&#41; * IOs&#41; + i;                   writeln&#40;'getting values from '+inttostr&#40;n&#41;&#41;;             setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;                    for s&#58;=0 to STEPs-1            do begin               temp&#91;s&#93; &#58;= getDataArrayValue&#40;memory&#91;n&#93;,s&#41;;              setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;                                    end;                                                                   end;                            setValue&#40;current,next&#41;;        end;      end;         end;//stepNum        // this case handles 'copy to new pattern'    load&#58; begin      prev &#58;= round&#40; getValue&#40;current&#41;&#41;;      for i&#58;=0 to IOs-1      do begin                               p &#58;= &#40;&#40;prev-1&#41; * IOs&#41; + i;           writeln&#40;'auto-saving into '+inttostr&#40;p&#41;&#41;;                        setLength&#40;memory&#91;p&#93;,STEPs&#41;;         setLength&#40;stepOut&#91;i&#93;,STEPs&#41;;        for s&#58;=0 to STEPs-1        do begin          temp&#91;s&#93; &#58;= getDataArrayValue&#40;stepIn&#91;i&#93;,s&#41;;          setDataArrayValue&#40;memory&#91;p&#93;,s,temp&#91;s&#93;&#41;;          setDataArrayValue&#40;stepOut&#91;i&#93;,s,temp&#91;s&#93;&#41;;        end;      end;       choice &#58;= round&#40; getValue&#40;copy&#41; &#41;;      if choice = 1      then begin        next &#58;= round&#40; getValue&#40;load&#41; &#41;;        prev &#58;= round&#40; getValue&#40;current&#41; &#41;;                            for i&#58;=0 to IOs-1                            do begin          n &#58;= &#40;&#40;next-1&#41; * IOs&#41; + i;          p &#58;= &#40;&#40;prev-1&#41; * IOs&#41; + i;          writeln&#40;'loading from '+inttostr&#40;p&#41;+' into '+inttostr&#40;n&#41;&#41;;          setLength&#40;memory&#91;n&#93;,STEPs&#41;;                            for s&#58;=0 to STEPs-1          do begin            temp&#91;s&#93; &#58;= getDataArrayValue&#40;memory&#91;p&#93;,s&#41;;            setDataArrayValue&#40;memory&#91;n&#93;,s,temp&#91;s&#93;&#41;;            end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          end;          // Don't leave copy on!        setValue&#40;copy,0&#41;;                         end;    end;                   end;end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          // Global variables               //var loadPattern &#58; integer;//var stepPos &#58; integer;                  //////////////////////////////// main proc                                                       //////////////////////////////                                          Procedure Process;begin                                                      // v2end;

Statistics: Posted by ceasless — 22 Sep 2013, 19:20


]]>
2013-09-19T22:31:05+02:00 2013-09-19T22:31:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=4073&p=27815#p27815 <![CDATA[presetmanager in hollyhock question]]>
i tried the preset manager in hollyhock and found its not working the way its supposed to
when i use patches containing other patches.

in usine 5 i m having no problems with this.

has someone experienced the same or am i am doing something wrong?



cheers
mark

Statistics: Posted by funkyguitarist — 19 Sep 2013, 22:31


]]>