NoteWorthy Composer Forum

Forums => General Discussion => Topic started by: RebeccaETripp on 2019-08-13 08:33 pm

Title: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-13 08:33 pm
Hey!  I was hoping that somebody maybe knew how to automatically separate every instrument used on a percussion stuff into individual staffs.  I have a performance coming up in a couple months, and the percussion section has been a pain, and my engraver has asked me to do this, but my wrists hurt too much to do this all manually.  I think Musescore used to do this, but it doesn't now, for whatever reason.  Does anyone know of an instant/automatic way to do this?  Maybe a website I can upload my midis to or something?

You've all been really helpful to me in the past, so thanks again in advance!
Title: Re: How to separate percussion into individual staffs?
Post by: Lawrie Pardy on 2019-08-14 03:48 am
If it's in Noteworthy, maybe the "Parts" user tool will help?
Title: Re: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-14 06:42 am
If it's in Noteworthy, maybe the "Parts" user tool will help?

Nah, parts won't work for this.  It would ultimately be slower.  :/
Title: Re: How to separate percussion into individual staffs?
Post by: hmmueller on 2019-08-14 06:52 am
Could you post the score, or an initial part of it, so that we can see what it looks like?

H.M.
Title: Re: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-14 07:08 am
Sure!  All for of these staffs are percussion tracks.

https://imgur.com/a/vai4lMB

I want it so that there's a different staff for each "note".  So, that would end up being one for snares, one for hihats, one for tambourines, one for triangles, etc.
Title: Re: How to separate percussion into individual staffs?
Post by: hmmueller on 2019-08-14 09:22 am
One (I) could do this manually in half an hour or so, with a text editor, as follows:

a) Create all the staves; and copy the notes into them.
b) Save as .nwctxt, and then, for each staff:
b.1) With a regular expression editor, replace all the notes that are to remain in the staff with some marker (essentially, replace pattern |Note|...|Pos=N|... with e.g. |XNote|...|Pos=N|..., where N is the position of the note that should survive in this staff).
b.2) Replace all the remaining |Note| with |Rest|.
b.3) Replace all the |XNote| with |Note|.

It worked in a small example I tried. I did not find a tool which could do this programmatically - "Global Modification", it appears, cannot do "type replacements", but maybe I overlooked one.

H.M.
Title: Re: How to separate percussion into individual staffs?
Post by: Flurmy on 2019-08-14 10:42 am
I found myself some cases in which such a tool would have saved me a lot of time.

The top could be if such a tool could also keep in the same staff the "notes" connected to the same instrument.
For example: Mute Triangle - Open Triangle; Closed Hi Hat - Pedal Hi-Hat - Open Hi-Hat...

Top of the tops: option to keep together the similar instruments.
For example: High Timbale - Low Timbale; Hi Bongo - Low Bongo...

Who knows? Maybe a day or the other I'll write it...
Title: Re: How to separate percussion into individual staffs?
Post by: Rick G. on 2019-08-14 05:10 pm
You might try this:
Title: Re: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-14 05:43 pm
All of these suggestions are decent, but ultimately too time consuming.  I have a total of 30 minutes worth of music to get through though, which is why I'm trying not to do this all by hand.
Title: Re: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-15 12:41 am
You might try this:
  • With the tool: Pitch Mod, move some instruments so that none are within 2 semitones of another
  • Add playing style: Tenuto to the begining of each staff
  • Set each staff to MIDI channel 10
  • Export to MIDI
  • Import the file you just saved specifying a Track Size of 2 semitones
  • Shift the instrument notes moved in step 1 to their desired place

Well, unfortunately, I have over 30 minutes worth of music to get through + carpel tunnel syndrome, which is why I'm trying not to do this all by hand.  I was hoping that maybe there was a way to automate the process a bit more, like some tool that would automatically split each "note" into a different staff.  So, for instance, Staff 1 has just the high As (open triangle), Staff 2 has just the low As (cymbal crash), etc, and rests are automatically put into all the blank/leftover spaces
Title: Re: How to separate percussion into individual staffs?
Post by: Lawrie Pardy on 2019-08-15 03:23 am
Sooo, suppose you copied the staff to several different staves, one for each instrument, then if you had a tool that could replace a note of any pitch EXCEPT the one specified with a rest that would help?
E.G. on the staff that needs only the notes in POS -4, you have notes in, say, POS 1 2 5 -4 and -6 in a bar and as you only want the notes in POS -4, a tool you could run with a parameter of -4 that would then replace every note except the ones at -4 with a rest of the same duration as the note.

This mightn't be so hard to write.

Of course, you might find yourself with a lot of short rests, but I seem to recall someone writing a tool many years ago that could aggregate rests.
Title: Re: How to separate percussion into individual staffs?
Post by: RebeccaETripp on 2019-08-15 08:11 am
Okay, this seems like the best solution to me.  :)  Thanks!  Where is that tool that aggregates rests?
Title: Re: How to separate percussion into individual staffs?
Post by: Lawrie Pardy on 2019-08-15 09:00 am
Okay, this seems like the best solution to me.  :)  Thanks!  Where is that tool that aggregates rests?
I'm sorry, I'm not sure - it's just a vague memory from ages ago and it may have been a request from someone rather than an actually created tool.
Perhaps one of the others here have a better recollection.
Title: Re: How to separate percussion into individual staffs?
Post by: hmmueller on 2019-08-15 11:43 am
Here is an attempt at the user tool that removes certain noteheads (it took me much longer to write than I hoped - well, I've forgotten almost all of Lua). This does not (yet) do the compaction of rests Lawrie has mentioned; and it may be arbitrarily buggy ...

Usage: You mark a range of notes/chords; the first one indicates which noteheads should survive (typically, you would add an auxiliary grace note for this). Running the tool removes all other heads. See attached gifs for a demo.

H.M.
Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-15 06:02 pm
User Tool "SplitStaff"

I have been working too on a user tool "SplitStaff".
And I also had more difficulties then initially expected (and it is still not always working as desired).
But in certain/most circumstances it works well, so I nevertheless decided to publish it already in the current (sometimes failing) state.

How to install
Just go to the configuration screen for usertools (Tools\User Tool) and click on the "new" button where the tool can be added.
I added my configuration in SplitStaff.jpg.

How to use
Click in a staff, run the tool, and every item will be copied in added staves, but only if the note/chord is/contains the target "midi-note".  Chords with several different midi-notes will show multiple times.
It is possible to run the tool several times for different staves. The label of the "mid-staves" will be the same, but the staff name is different.
To undo, just delete the generated staves which were added at the end of the score.

And yes, it is possible to have even more than one hundred staves in one NoteWorthyComposer score !!!

CAUTION:
The tool seems to run flawlessly on staves with not too many items. But from a certain number of items (for instance on the whole percussion staff of "stairway to heaven"), the tool doesn't give the desired output anymore on my computer but just shows a window with nothing more then "ERROR".  (see SplitStaff_error.jpg)
I think it must be related with the fact that I allocate too much memory, since after deleting some measures, it works as expected. But if someone recognizes this behavior and knows a work around, I would be happy to learn how to avoid this.

For relatively small scores however, the tool should be useful.

Bart

Title: Re: How to separate percussion into individual staffs?
Post by: Opagust on 2019-08-16 01:21 pm

The tool seems to run flawlessly on staves with not too many items. But from a certain number of items (for instance on the whole percussion staff of "stairway to heaven"), the tool doesn't give the desired output anymore on my computer but just shows a window with nothing more then "ERROR".  (see SplitStaff_error.jpg)

If a window with 'ERROR' is shown, click the radiobutton 'STDERR' to see the error(s).
Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-16 04:47 pm
Thank you, Opagust.

I just checked it, but that is empty, too.
Even STDIN is empty :(

My script had a lot of inefficient code  :-[  and I am now working on another version with a different design.
I will post it soon.

Bart
Title: Re: How to separate percussion into individual staffs?
Post by: Rick G. on 2019-08-16 04:54 pm
Bart:
You might try checking: 'Long Task Handling' on your user tool setup.
Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-16 08:36 pm
Thank you, Rick.

Bart:
You might try checking: 'Long Task Handling' on your user tool setup.

Good suggestion!  8)

After accepting "several" times ( >:( ) the warning about a long running script, STAIRWAY_TO_HEAVEN transforms into the attached file.
I never used this option before (and didn't notice that it exists).

Nevertheless, a user tool shouldn't work so long to achieve a decent result, so I will continue to elaborate my redesigned script.

Bart.

Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-17 10:33 am
The optimized (and corrected) version of SplitStaff.lua is now available.
It now also works for very crowded staves without the 'Long Task Handling' option.

The built-in Module nwcPlayContext gave me hot water instead of the warm water that I was trying to invent.

Bart

CAUTION
Wrong chord handling detected in this version. Script is deleted.
New version can be found in Reply #21.
Title: Re: How to separate percussion into individual staffs?
Post by: Flurmy on 2019-08-17 02:53 pm
What to say? Wow!
Thank you very much, Bart.

May I add a little detail? (See attachement)

As above.
Script is deleted. New version can be found in Reply #21.
Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-18 03:22 am
SplitStaff.lua - with corrected chord handling
RestMultiBar was not yet correctly handled in this version.
For the latest version, see file in Reply #23.
Title: Re: How to separate percussion into individual staffs?
Post by: Flurmy on 2019-08-18 08:43 am
Quote
Bart & Flurmy (09-2019)
Hey Bart, don't hurry!
We're still in August and so I'm still on holidays!  :))

You did a very good work indeed!
Title: Re: How to separate percussion into individual staffs?
Post by: Bart on 2019-08-20 07:24 pm
New version for SplitStaff.lua with correction for RestMultiBar handling.
Thank you for mentioning, Flumy.

Bart

Title: Re: How to separate percussion into individual staffs?
Post by: Flurmy on 2019-08-31 08:55 pm
Probably a bit late for RebeccaETripp, but anyway: https://forum.noteworthycomposer.com/?topic=9924.msg71002 (https://forum.noteworthycomposer.com/?topic=9924.msg71002)