Skip to main content
Topic: HeadPatch.vbs - a Tool to change instruments when notehead changes (Read 28577 times) previous topic - next topic

HeadPatch.vbs - a Tool to change instruments when notehead changes

The attached tool will insert object(s) into a staff when the notehead type changes.

Usually, an X or diamond notehead indicates a change of instrument patch, volume and/or pitch. Putting these on separate staves can be tedious.

Normally, information is added to the command line to alter the behaviour of the tool. But this tool needs far too much info for that method. Instead, it reads the info from the end of the staff (what I call the 'definition area'). I use |Ending|Endings:7 to indicate this which keeps the defintions from playing or being exported to MIDI.

Listen to this clip:
Code: [Select · Download]
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Bass|OctaveShift:Octave Down
|Key|Signature:Bb,Eb,Ab
|Tempo|Tempo:150|Pos:11
|TimeSig|Signature:AllaBreve
|Dynamic|Style:f|Pos:-7
|Bar|Style:LocalRepeatOpen
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:6
|Note|Dur:4th|Pos:3x
|Note|Dur:8th|Pos:3x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:n-2
|Note|Dur:8th|Pos:0^
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:n5
|Note|Dur:4th|Pos:3x
|Note|Dur:8th|Pos:3x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-1
|Note|Dur:8th|Pos:1^
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar|Style:LocalRepeatClose|Repeat:4
|Ending|Endings:7|Visibility:Never
|Instrument|Name:"[o]"|Patch:36|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[x]"|Patch:115|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0x|Visibility:Never
|Bar|Visibility:Never
|Text|Text:"{^}"|Font:StaffBold|Pos:10|Justify:Center|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0X|Visibility:Never
|Bar|Style:SectionClose
!NoteWorthyComposerClip-End
Then run the tool on the entire staff and listen again. Each time the tool is run, anything added by it before is removed. I do this by tagging the additions: "|Color:6|Visibility:Never", hardly a normally needed attribute.
Registered user since 1996

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #1
Does nwctxt support comments? If it does, you don't have to find expressions that will never be used - you insert the name of your user tool as a comment where you need it. That way, if you want to undo previous changes of the tool, you know where to look.

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #2
You can put all the comments in that you want. Once NWC2 parses it, they are all gone. IOW, useless for my purpose here.
Registered user since 1996

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #3
You can put all the comments in that you want. Once NWC2 parses it, they are all gone. IOW, useless for my purpose here.

How about a particularly formatted text entry with visibility:never... ?

<edit> Having now had an actual look at the tool I withdraw this comment - it works well as it stands and an invisible highlight is extremely unlikely in normal circumstances.

Say Rick, I think I recognise a function in there... :)
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #4
You can put all the comments in that you want. Once NWC2 parses it, they are all gone. IOW, useless for my purpose here.
There's that, there's that. Comments would be useful only if NWC2 would store them. Might be nice, though - but zero prio.

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #5
IMO, Comments work as needed.
At some point, an Info tag for each object might be useful, like:
Quote
|Note|Dur:4th|Pos:0|Info:"added to ms"
But as you say, low priority.
Registered user since 1996

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #6
I would not eat my hat if we would find this in an upcoming release.

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #7
Perfect

This is an important improvement.
The feature should definitely be an integrated part of the application.
For bassplayers this is a must
https://forum.noteworthycomposer.com/?topic=2885.0

TESTING
There is a bug while looping after the last x note
In this case the first none x-notes in the start of the looping part will not change back to "normal"


Thank you
Jacob

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #8
There is a bug while looping after the last x note
The tool just looks at notes from left to right.
Decoding the actual musical flow of a song would require many lines of error-prone code. NoteWorthy's flow rules are not completely documented and are a subject of some contention among users.

This aspect of the tool is unlikely to change unless there is widespread demand for it (with lots of data to test it against).

If you post an example clip of any staff that is causing a problem, I will look at it. I may be able to find a simple alteration to the clip or a program change that is less than a full flow decoder.

Glad that this has helped a bass player. I had hoped this to be of use for guitar, bowed string, and brass players who use a mute.

Edit: In this example, I added a tied grace note just before the repeat.
Code: [Select · Download]
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Bass|OctaveShift:Octave Down
|Key|Signature:Bb,Eb,Ab
|Tempo|Tempo:170|Pos:11
|TimeSig|Signature:AllaBreve
|Bar|Style:LocalRepeatOpen
|Note|Dur:4th|Pos:3
|Note|Dur:8th|Pos:6|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:6x|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:6x
|Note|Dur:8th|Pos:2x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:n-2
|Note|Dur:8th|Pos:0^
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2x|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:n5
|Rest|Dur:8th
|Note|Dur:8th|Pos:6x
|Note|Dur:8th|Pos:2x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-1
|Note|Dur:8th|Pos:1^
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2x|Opts:Stem=Down,Beam=End
|Note|Dur:4th,Grace|Pos:3^|Visibility:Never
|Bar|Style:LocalRepeatClose|Repeat:4
|Ending|Endings:7|Visibility:Never
|Instrument|Name:"[o]"|Patch:36|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[x]"|Patch:115|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0x|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[^]"|Patch:119|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0X|Visibility:Never
|Bar|Visibility:Never
|Bar|Style:SectionClose
!NoteWorthyComposerClip-End
But strangely, NoteWorthy ignores the tie (except for the last time when it creates a hanging tie). I'll stop short of calling this a bug since by design, grace notes are not fully implemented.
This might be a better option:
Code: [Select · Download]
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Bass|OctaveShift:Octave Down
|Key|Signature:Bb,Eb,Ab
|Tempo|Tempo:170|Pos:11
|TimeSig|Signature:AllaBreve
|Bar|Style:LocalRepeatOpen
|Instrument|Name:"Slap Bass 1"|Patch:36|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:16|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:3
|Note|Dur:8th|Pos:6|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:6x|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:6x
|Note|Dur:8th|Pos:2x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:n-2
|Note|Dur:8th|Pos:0^
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2x|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:n5
|Rest|Dur:8th
|Note|Dur:8th|Pos:6x
|Note|Dur:8th|Pos:2x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-1
|Note|Dur:8th|Pos:1^
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2x|Opts:Stem=Down,Beam=End
|Bar|Style:LocalRepeatClose|Repeat:4
|Ending|Endings:7|Visibility:Never
|Instrument|Name:"[o]"|Patch:36|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[x]"|Patch:115|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0x|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[^]"|Patch:119|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0X|Visibility:Never
|Bar|Visibility:Never
|Bar|Style:SectionClose
!NoteWorthyComposerClip-End
Registered user since 1996

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #9
Here is a workaround
I just mark a instrument shift to slapbas (and forte) in the begining of the loop

Re: HeadPatch.vbs - a Tool to change instruments when notehead changes

Reply #10
Looks strangely like my 2nd example ;) That's what happens when you post something and then delete it.

A tip: be sure to uncheck Preserve Width: on Instrument Patches. Bad default, IMHO.
Registered user since 1996