ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2010-03-12T12:12:59+02:00 https://brainmodular.com/forums/app.php/feed/topic/1090 2010-03-12T12:12:59+02:00 2010-03-12T12:12:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12534#p12534 <![CDATA[Clear Midi Notes]]> Statistics: Posted by bsork — 12 Mar 2010, 11:12


]]>
2010-03-12T01:48:11+02:00 2010-03-12T01:48:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12527#p12527 <![CDATA[Clear Midi Notes]]> Statistics: Posted by Clearscreen — 12 Mar 2010, 00:48


]]>
2010-03-12T01:46:40+02:00 2010-03-12T01:46:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12526#p12526 <![CDATA[Clear Midi Notes]]>
//******************************************************************************
// Script that checks whether Notes and Sustain have been turned off. If not,
// then send NoteOffs and Sustain=0 when a trigger is received. A "mild" form of
// a panic button functionality when the receiving instrument doesn't recognize
// the AllNotesOff message.
//
// The script should be connected in parallell to the existing MIDI stream.
// For instance: MidiIn -> SomeVSTi (as per normal)
// MidiIn -> ClearMidiNotes -> SomeVSTi
// bSork, October 2008
//****************************************************************************** $}
Still a script I find handy Bsork! Thanks for doing it in the first place!! :)

Statistics: Posted by Clearscreen — 12 Mar 2010, 00:46


]]>
2008-10-23T23:26:53+02:00 2008-10-23T23:26:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5870#p5870 <![CDATA[Clear Midi Notes]]>
I must admit I'm not among the most "technical" type of programmer around - if things get to low-level I'm more or less lost...
Me too! That's why I chose to learn Java instead of C++ ;)

-e

Statistics: Posted by woodslanding — 23 Oct 2008, 23:26


]]>
2008-10-23T22:57:16+02:00 2008-10-23T22:57:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5868#p5868 <![CDATA[Clear Midi Notes]]>
I guess a pass by value on a large array would be a hit though, right?
Seems reasonable to think so. Maybe one day when I feel so inclined, I'll do some tests on how different ways of programming the script affects efficiency. I must admit I'm not among the most "technical" type of programmer around - if things get to low-level I'm more or less lost...

Olivier, do you have anything to add to this topic?

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


]]>
2008-10-23T17:45:43+02:00 2008-10-23T17:45:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5864#p5864 <![CDATA[Clear Midi Notes]]>
I'll have to look at the midi mapper script. I missed that one!

-e

Statistics: Posted by woodslanding — 23 Oct 2008, 17:45


]]>
2008-10-23T12:03:15+02:00 2008-10-23T12:03:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5850#p5850 <![CDATA[Clear Midi Notes]]>
Personally, I mostly use globals, only creating input parameters when something should be done repeatedly with different data, but then again most of my scripts are limited in size. In larger programs like those I do for a living, I certainly use more procedure and function calls than in a typical Usine script.

Statistics: Posted by bsork — 23 Oct 2008, 12:03


]]>
2008-10-23T11:48:41+02:00 2008-10-23T11:48:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5849#p5849 <![CDATA[Clear Midi Notes]]>
I'm not quite clear how I would check if the value of an input has changed. I want to have a 'dirty' flag, a boolean that gets turned to TRUE whenever certain inputs change state, and set back to FALSE when clearMidi is called.

You do a test for pSendNoteOff = 1, but I'm not sure how that would work if that input was a toggle and you needed to check whether it had changed. Where would you put that logic? In every iteration of the main loop? I assume 'init' only gets called when you create the object, right?

well, maybe this will be clearer in the morning. I have to get some sleep!

cheers,
-eric

Statistics: Posted by woodslanding — 23 Oct 2008, 11:48


]]>
2008-10-23T11:30:55+02:00 2008-10-23T11:30:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5848#p5848 <![CDATA[Clear Midi Notes]]>
I've been studying your code, and it all is making good sense. But I have one question:

I notice that you send the integer'len' into your PROCEDURE CreateOut as the VAR 'cnt'. Is this a matter of programming ettiquette, or is there an actual scope issue with variables in these scripts?? Could you just use len globally? I'm trying to figure out in which instances I need to send a value into a procedure, and when I should just use a global variable.... specifically, If I want to strip out the "setStatus" code into a PROCEDURE, should I send it the 'status' and 'notes' variables, or can I just refer to the global versions?? The global versions are so clearly global, it doesn't seem like bad ettiquette to refer to them. But it may be bad grammer!

I'm going to end up with a pretty big script, so I'd like to put as much code in procedure calls as possible. But I want to do all my MIDI mapping and managing work in one big iteration loop, so as to save processor overhead--and minimize cabling! As a Java programmer, I'm used to encapsulation and restricting scope, but I particularly don't want to pass everything around in function calls if there is a performance hit associated with it.

Thanks!
-eric

Statistics: Posted by woodslanding — 23 Oct 2008, 11:30


]]>
2008-10-23T09:07:49+02:00 2008-10-23T09:07:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5845#p5845 <![CDATA[Clear Midi Notes]]> Statistics: Posted by noise2sine — 23 Oct 2008, 09:07


]]>
2008-10-23T08:26:21+02:00 2008-10-23T08:26:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5843#p5843 <![CDATA[Clear Midi Notes]]>
...and how did you think of using it on your girlfriend..? :P

Statistics: Posted by bsork — 23 Oct 2008, 08:26


]]>
2008-10-23T01:13:52+02:00 2008-10-23T01:13:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5840#p5840 <![CDATA[Clear Midi Notes]]>
I'll see if I can add the pitch reset....

-e

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


]]>
2008-10-23T00:12:46+02:00 2008-10-23T00:12:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5837#p5837 <![CDATA[Clear Midi Notes]]>
(It's a shame it can't work on my girlfriend too :))

one suggestion for a name : Midi Broom ?

Statistics: Posted by noise2sine — 23 Oct 2008, 00:12


]]>
2008-10-22T23:45:50+02:00 2008-10-22T23:45:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5836#p5836 <![CDATA[Clear Midi Notes]]> Statistics: Posted by moody33 — 22 Oct 2008, 23:45


]]>
2008-10-22T23:18:11+02:00 2008-10-22T23:18:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5834#p5834 <![CDATA[Clear Midi Notes]]> then send NoteOffs and Sustain=0 when a trigger is received. A "mild" form of
a panic button functionality when the receiving instrument doesn't recognize
the AllNotesOff message.

The script should be connected in parallell to the existing MIDI stream.
For instance:
MidiIn -> SomeVSTi (as per normal)
MidiIn -> ClearMidiNotes -> SomeVSTi

--

Sorry I couldn't think of a better name... I haven't tested it much, so I might have overlooked something.


PS. What about adding a Pitch Wheel reset as well?

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


]]>
BrainModular BrainModular Users Forum 2010-03-12T12:12:59+02:00 https://brainmodular.com/forums/app.php/feed/topic/1090 2010-03-12T12:12:59+02:00 2010-03-12T12:12:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12534#p12534 <![CDATA[Clear Midi Notes]]> Statistics: Posted by bsork — 12 Mar 2010, 11:12


]]>
2010-03-12T01:48:11+02:00 2010-03-12T01:48:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12527#p12527 <![CDATA[Clear Midi Notes]]> Statistics: Posted by Clearscreen — 12 Mar 2010, 00:48


]]>
2010-03-12T01:46:40+02:00 2010-03-12T01:46:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=12526#p12526 <![CDATA[Clear Midi Notes]]>
//******************************************************************************
// Script that checks whether Notes and Sustain have been turned off. If not,
// then send NoteOffs and Sustain=0 when a trigger is received. A "mild" form of
// a panic button functionality when the receiving instrument doesn't recognize
// the AllNotesOff message.
//
// The script should be connected in parallell to the existing MIDI stream.
// For instance: MidiIn -> SomeVSTi (as per normal)
// MidiIn -> ClearMidiNotes -> SomeVSTi
// bSork, October 2008
//****************************************************************************** $}
Still a script I find handy Bsork! Thanks for doing it in the first place!! :)

Statistics: Posted by Clearscreen — 12 Mar 2010, 00:46


]]>
2008-10-23T23:26:53+02:00 2008-10-23T23:26:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5870#p5870 <![CDATA[Clear Midi Notes]]>
I must admit I'm not among the most "technical" type of programmer around - if things get to low-level I'm more or less lost...
Me too! That's why I chose to learn Java instead of C++ ;)

-e

Statistics: Posted by woodslanding — 23 Oct 2008, 23:26


]]>
2008-10-23T22:57:16+02:00 2008-10-23T22:57:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5868#p5868 <![CDATA[Clear Midi Notes]]>
I guess a pass by value on a large array would be a hit though, right?
Seems reasonable to think so. Maybe one day when I feel so inclined, I'll do some tests on how different ways of programming the script affects efficiency. I must admit I'm not among the most "technical" type of programmer around - if things get to low-level I'm more or less lost...

Olivier, do you have anything to add to this topic?

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


]]>
2008-10-23T17:45:43+02:00 2008-10-23T17:45:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5864#p5864 <![CDATA[Clear Midi Notes]]>
I'll have to look at the midi mapper script. I missed that one!

-e

Statistics: Posted by woodslanding — 23 Oct 2008, 17:45


]]>
2008-10-23T12:03:15+02:00 2008-10-23T12:03:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5850#p5850 <![CDATA[Clear Midi Notes]]>
Personally, I mostly use globals, only creating input parameters when something should be done repeatedly with different data, but then again most of my scripts are limited in size. In larger programs like those I do for a living, I certainly use more procedure and function calls than in a typical Usine script.

Statistics: Posted by bsork — 23 Oct 2008, 12:03


]]>
2008-10-23T11:48:41+02:00 2008-10-23T11:48:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5849#p5849 <![CDATA[Clear Midi Notes]]>
I'm not quite clear how I would check if the value of an input has changed. I want to have a 'dirty' flag, a boolean that gets turned to TRUE whenever certain inputs change state, and set back to FALSE when clearMidi is called.

You do a test for pSendNoteOff = 1, but I'm not sure how that would work if that input was a toggle and you needed to check whether it had changed. Where would you put that logic? In every iteration of the main loop? I assume 'init' only gets called when you create the object, right?

well, maybe this will be clearer in the morning. I have to get some sleep!

cheers,
-eric

Statistics: Posted by woodslanding — 23 Oct 2008, 11:48


]]>
2008-10-23T11:30:55+02:00 2008-10-23T11:30:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5848#p5848 <![CDATA[Clear Midi Notes]]>
I've been studying your code, and it all is making good sense. But I have one question:

I notice that you send the integer'len' into your PROCEDURE CreateOut as the VAR 'cnt'. Is this a matter of programming ettiquette, or is there an actual scope issue with variables in these scripts?? Could you just use len globally? I'm trying to figure out in which instances I need to send a value into a procedure, and when I should just use a global variable.... specifically, If I want to strip out the "setStatus" code into a PROCEDURE, should I send it the 'status' and 'notes' variables, or can I just refer to the global versions?? The global versions are so clearly global, it doesn't seem like bad ettiquette to refer to them. But it may be bad grammer!

I'm going to end up with a pretty big script, so I'd like to put as much code in procedure calls as possible. But I want to do all my MIDI mapping and managing work in one big iteration loop, so as to save processor overhead--and minimize cabling! As a Java programmer, I'm used to encapsulation and restricting scope, but I particularly don't want to pass everything around in function calls if there is a performance hit associated with it.

Thanks!
-eric

Statistics: Posted by woodslanding — 23 Oct 2008, 11:30


]]>
2008-10-23T09:07:49+02:00 2008-10-23T09:07:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5845#p5845 <![CDATA[Clear Midi Notes]]> Statistics: Posted by noise2sine — 23 Oct 2008, 09:07


]]>
2008-10-23T08:26:21+02:00 2008-10-23T08:26:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5843#p5843 <![CDATA[Clear Midi Notes]]>
...and how did you think of using it on your girlfriend..? :P

Statistics: Posted by bsork — 23 Oct 2008, 08:26


]]>
2008-10-23T01:13:52+02:00 2008-10-23T01:13:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5840#p5840 <![CDATA[Clear Midi Notes]]>
I'll see if I can add the pitch reset....

-e

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


]]>
2008-10-23T00:12:46+02:00 2008-10-23T00:12:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5837#p5837 <![CDATA[Clear Midi Notes]]>
(It's a shame it can't work on my girlfriend too :))

one suggestion for a name : Midi Broom ?

Statistics: Posted by noise2sine — 23 Oct 2008, 00:12


]]>
2008-10-22T23:45:50+02:00 2008-10-22T23:45:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5836#p5836 <![CDATA[Clear Midi Notes]]> Statistics: Posted by moody33 — 22 Oct 2008, 23:45


]]>
2008-10-22T23:18:11+02:00 2008-10-22T23:18:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=1090&p=5834#p5834 <![CDATA[Clear Midi Notes]]> then send NoteOffs and Sustain=0 when a trigger is received. A "mild" form of
a panic button functionality when the receiving instrument doesn't recognize
the AllNotesOff message.

The script should be connected in parallell to the existing MIDI stream.
For instance:
MidiIn -> SomeVSTi (as per normal)
MidiIn -> ClearMidiNotes -> SomeVSTi

--

Sorry I couldn't think of a better name... I haven't tested it much, so I might have overlooked something.


PS. What about adding a Pitch Wheel reset as well?

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


]]>