ArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2009-03-04T20:58:05+02:00 https://brainmodular.org/forums/app.php/feed/topic/1402 2009-03-04T20:58:05+02:00 2009-03-04T20:58:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7727#p7727 <![CDATA[infinte note off]]> thanks
Vincent

Statistics: Posted by pansoul — 04 Mar 2009, 19:58


]]>
2009-03-04T10:18:41+02:00 2009-03-04T10:18:41+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7718#p7718 <![CDATA[infinte note off]]>
You can see an example in for instance the ScriptsMidiTranspose.script in the distro. Here's the main loop:

CODE:

begin nbOfMidi &#58;= GetLength&#40;input&#41;;  // get the number of incoming midi codes   if nbOfMidi > 0  then begin    SetLength&#40;outPut,nbOfMidi&#41;;      // set the number of output codes    transpoVal &#58;= getValue&#40;transpo&#41;; // get the transpo value    for i &#58;= 0 to nbOfMidi-1         // loop for all input codes, for polyphonic data &#40;chords&#41;    do begin      GetMidiArrayValue&#40;input,i,ReceivedMidi&#41;; // get each code      ReceivedMidi.data1 &#58;= ReceivedMidi.data1+trunc&#40;transpoVal&#41;; // calculate transpo      SetMidiArrayValue&#40;output,i,ReceivedMidi&#41;; // set output value         end; end  else SetLength&#40;outPut,0&#41;; // nothing received, set out length to 0end.
One thing that isn't obvious, is that you don't have to to set the length before filling in the output data, so the above example could also be done like this:

CODE:

begin nbOfMidi &#58;= GetLength&#40;input&#41;;  // get the number of incoming midi codes   if nbOfMidi > 0  then begin    transpoVal &#58;= getValue&#40;transpo&#41;; // get the transpo value    for i &#58;= 0 to nbOfMidi-1         // loop for all input codes, for polyphonic data &#40;chords&#41;    do begin      GetMidiArrayValue&#40;input,i,ReceivedMidi&#41;; // get each code      ReceivedMidi.data1 &#58;= ReceivedMidi.data1+trunc&#40;transpoVal&#41;; // calculate transpo      SetMidiArrayValue&#40;output,i,ReceivedMidi&#41;; // set output value         end; end;  SetLength&#40;outPut, nbOfMidi&#41;;end.

Statistics: Posted by bsork — 04 Mar 2009, 09:18


]]>
2009-03-04T01:19:41+02:00 2009-03-04T01:19:41+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7715#p7715 <![CDATA[infinte note off]]>
what i explain in this example is not what i want to do. Actually i don't need 'if else end' statement but only 'if end' and i don't need to produce 88 or 89 anymore but it is a test to see that when i produce a value like 88 , it is generated only one time and when i produce noteon or off , hundred times.

the behaviour i want is :
-beat 1 read array 1
-beat 2 read array 2
-beat 3 read array 3
and so on but i can't solve this inopportune "infinite noteon"

Statistics: Posted by pansoul — 04 Mar 2009, 00:19


]]>
2009-03-04T01:01:59+02:00 2009-03-04T01:01:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7713#p7713 <![CDATA[infinte note off]]>
You may do this somewhere in your script, but I'd like to add this anyway: Remember to set the length of the Midi array to 0 when it's not supposed to send any messages, else you will be sending the same message for every block execution. You should take a look at some of the included Midi scripts in the distro and/or download some of add-ons.

Statistics: Posted by bsork — 04 Mar 2009, 00:01


]]>
2009-03-03T23:53:31+02:00 2009-03-03T23:53:31+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7712#p7712 <![CDATA[infinte note off]]>
i try to do a sequencer script and i have a problem with generating midi event.
here a small part of my script that i wrote to find where my problem come from.

beat = GetValue(beat-synchro-externe);

if (beat = 2)
then begin
setvalue(Out-data,88);
end
else begin
setvalue(Out-data,89);
end
this script works well it means that when the
beat value is 2 it generates 88 else it generates 89 (when the beat value is 1,3 or 4)

but when i try to create a midi note in place of value 89 it generates infinite note on, on every beat value.
beat = GetValue(beat-synchro-externe);

if (beat = 2)
then begin
setvalue(Out-data,88);
end
else begin
Midi-note.Msg := 144;
Midi-note.Data1 := 37;
Midi-note.Data2 := 100;
Midi-note.Channel := 4;
SetMidiArrayValue(out-mid,0,Midi-note);
SetLength(out-mid,1);
end
is there a problem in my way of generating midi ?

thanks
Vincent

Statistics: Posted by pansoul — 03 Mar 2009, 22:53


]]>
BrainModular BrainModular Users Forum 2009-03-04T20:58:05+02:00 https://brainmodular.org/forums/app.php/feed/topic/1402 2009-03-04T20:58:05+02:00 2009-03-04T20:58:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7727#p7727 <![CDATA[infinte note off]]> thanks
Vincent

Statistics: Posted by pansoul — 04 Mar 2009, 19:58


]]>
2009-03-04T10:18:41+02:00 2009-03-04T10:18:41+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7718#p7718 <![CDATA[infinte note off]]>
You can see an example in for instance the ScriptsMidiTranspose.script in the distro. Here's the main loop:

CODE:

begin nbOfMidi &#58;= GetLength&#40;input&#41;;  // get the number of incoming midi codes   if nbOfMidi > 0  then begin    SetLength&#40;outPut,nbOfMidi&#41;;      // set the number of output codes    transpoVal &#58;= getValue&#40;transpo&#41;; // get the transpo value    for i &#58;= 0 to nbOfMidi-1         // loop for all input codes, for polyphonic data &#40;chords&#41;    do begin      GetMidiArrayValue&#40;input,i,ReceivedMidi&#41;; // get each code      ReceivedMidi.data1 &#58;= ReceivedMidi.data1+trunc&#40;transpoVal&#41;; // calculate transpo      SetMidiArrayValue&#40;output,i,ReceivedMidi&#41;; // set output value         end; end  else SetLength&#40;outPut,0&#41;; // nothing received, set out length to 0end.
One thing that isn't obvious, is that you don't have to to set the length before filling in the output data, so the above example could also be done like this:

CODE:

begin nbOfMidi &#58;= GetLength&#40;input&#41;;  // get the number of incoming midi codes   if nbOfMidi > 0  then begin    transpoVal &#58;= getValue&#40;transpo&#41;; // get the transpo value    for i &#58;= 0 to nbOfMidi-1         // loop for all input codes, for polyphonic data &#40;chords&#41;    do begin      GetMidiArrayValue&#40;input,i,ReceivedMidi&#41;; // get each code      ReceivedMidi.data1 &#58;= ReceivedMidi.data1+trunc&#40;transpoVal&#41;; // calculate transpo      SetMidiArrayValue&#40;output,i,ReceivedMidi&#41;; // set output value         end; end;  SetLength&#40;outPut, nbOfMidi&#41;;end.

Statistics: Posted by bsork — 04 Mar 2009, 09:18


]]>
2009-03-04T01:19:41+02:00 2009-03-04T01:19:41+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7715#p7715 <![CDATA[infinte note off]]>
what i explain in this example is not what i want to do. Actually i don't need 'if else end' statement but only 'if end' and i don't need to produce 88 or 89 anymore but it is a test to see that when i produce a value like 88 , it is generated only one time and when i produce noteon or off , hundred times.

the behaviour i want is :
-beat 1 read array 1
-beat 2 read array 2
-beat 3 read array 3
and so on but i can't solve this inopportune "infinite noteon"

Statistics: Posted by pansoul — 04 Mar 2009, 00:19


]]>
2009-03-04T01:01:59+02:00 2009-03-04T01:01:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7713#p7713 <![CDATA[infinte note off]]>
You may do this somewhere in your script, but I'd like to add this anyway: Remember to set the length of the Midi array to 0 when it's not supposed to send any messages, else you will be sending the same message for every block execution. You should take a look at some of the included Midi scripts in the distro and/or download some of add-ons.

Statistics: Posted by bsork — 04 Mar 2009, 00:01


]]>
2009-03-03T23:53:31+02:00 2009-03-03T23:53:31+02:00 https://brainmodular.org/forums/viewtopic.php?t=1402&p=7712#p7712 <![CDATA[infinte note off]]>
i try to do a sequencer script and i have a problem with generating midi event.
here a small part of my script that i wrote to find where my problem come from.

beat = GetValue(beat-synchro-externe);

if (beat = 2)
then begin
setvalue(Out-data,88);
end
else begin
setvalue(Out-data,89);
end
this script works well it means that when the
beat value is 2 it generates 88 else it generates 89 (when the beat value is 1,3 or 4)

but when i try to create a midi note in place of value 89 it generates infinite note on, on every beat value.
beat = GetValue(beat-synchro-externe);

if (beat = 2)
then begin
setvalue(Out-data,88);
end
else begin
Midi-note.Msg := 144;
Midi-note.Data1 := 37;
Midi-note.Data2 := 100;
Midi-note.Channel := 4;
SetMidiArrayValue(out-mid,0,Midi-note);
SetLength(out-mid,1);
end
is there a problem in my way of generating midi ?

thanks
Vincent

Statistics: Posted by pansoul — 03 Mar 2009, 22:53


]]>