Skip to main content

Topic: AllNotesOff.ms (0.1) (Read 1981 times) previous topic - next topic

AllNotesOff.ms (0.1)
This plugin plays a MIDI "All Notes Off" message, at the playback position at which it is inserted. It uses the staff's port and channel number. This page includes a description of the various MIDI messages.

The following clip demonstrates the object's operation. The two tied half notes create an intentional stuck note (the second note is muted), which can be heard playing during measure 2. The AllNotesOff.ms at the start of measure 3 will stop the stuck note.

!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Note|Dur:Half|Pos:1^
|Note|Dur:Half|Pos:1|Opts:Muted
|Bar
|Note|Dur:4th|Pos:-6
|Note|Dur:4th|Pos:-5
|Note|Dur:4th|Pos:-4
|Note|Dur:4th|Pos:-3
|User|AllNotesOff.ms|Pos:-5
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-3
|Note|Dur:4th|Pos:-4
|Note|Dur:4th|Pos:-5
!NoteWorthyComposerClip-End

It occurs to me that this object could be expanded into a more general "channel mode message" object, which could be used to generate other MIDI messages such as All Sound Off, Reset All Controllers and Local Control On/Off.  If there is interest in these options, I can make the necessary changes (which would most likely result in a different named object).

Re: AllNotesOff.ms (0.1)
Reply #1
Thanks much, Mike, but we probably need "All Sounds Off" in my situation. The object works great for stuck notes in the same staff as the object, but in a multi-staff score, they still sound in the other staves, and inserting it in a staff without a stuck note appears to have no effect.

Re: AllNotesOff.ms (0.1)
Reply #2
"All Notes Off" should not be needed.
If it is, it is because of an error, so I prefer to correct the score.

"Reset All Controllers" instead can be useful at the beginning of every staff, instead of having to reset each single controller used in it.
BUT...
NWC looks for them before to start playing in the middle of the score. I doubt an object resetting all at once could have the same effect.

Re: AllNotesOff.ms (0.1)
Reply #3
Thanks much, Mike, but we probably need "All Sounds Off" in my situation. The object works great for stuck notes in the same staff as the object, but in a multi-staff score, they still sound in the other staves, and inserting it in a staff without a stuck note appears to have no effect.
If you want to change the object from "All Notes Off" to "All Sound Off", you can tweak the plugin code by changing the following line:
Code: (lua) [Select · Download]
nwcplay.midi(0, 'controller', 123, 0)
to:
Code: (lua) [Select · Download]
nwcplay.midi(0, 'controller', 120, 0)
From the replies I have seen so far, it sounds like a more general version of the plugin would be useful. I'll work on a version that lets you pick the kind of message you want to send. In the meanwhile, let me know if "all sound off" works for your case.  However, please note that these MIDI messages are channel specific, and will only send for the current staff's instrument channel.

Re: AllNotesOff.ms (0.1)
Reply #4
In a couple of cases I would have appreciated the possibility to send automatically "XG System ON" or "GS System ON" to a keyboard instead of having to set it manually. Is it possible now (with an ad hoc plugin, of course)?

Re: AllNotesOff.ms (0.1)
Reply #5
In a couple of cases I would have appreciated the possibility to send automatically "XG System ON" or "GS System ON" to a keyboard instead of having to set it manually. Is it possible now (with an ad hoc plugin, of course)?
The following is from the Object Plugin API documentation:
Quote
nwcplay.midi(#offsetSPP,'Command',#midiData1,[#midiData2]), Returns Boolean [,'ErrorText']

This adds a midi message into the performance relative to the current time position of the object. The offsetSPP is restricted to an area near the current play back position (MAXSPPOFFSET). The channel and port are set by the current staff environment.

The command must be a valid, non-sysex midi command number, or one of the following command names: noteOff, noteOn, keyAftertouch, controller, patch, channelAftertouch, or pitchBend.
Since the XG System On and GS System On commands are system exclusive (sysex) messages, I assume that this can't currently be done with a plugin (unless there is a mechanism I'm not aware of for doing this).

Re: AllNotesOff.ms (0.1)
Reply #6
Quote
Since the XG System On and GS System On commands are system exclusive (sysex) messages, I assume that this can't currently be done with a plugin (unless there is a mechanism I'm not aware of for doing this).
I supposed that.
Thanks, Mike.

Re: AllNotesOff.ms (0.1)
Reply #7
Flurmy, the problem I'm dealing with isn't solvable by correcting the score, only by adding a kludge of some sort. It arises from NWC's failure to shut off all sound from muted channels, plus a quirk in the way the program handles ties from muted notes - the muted notes being necessary to use Mike's "arpeggio" object.

Mike, thanks for the possible fix via the one-line change in the lua code. Unfortunately, it didn't work. Looks like I'm stuck with the layers kludge, which is a PITA, but which does work. Thanks for trying....

Bill