Skip to main content
Topic: With a little help from my friends... (Read 8514 times) previous topic - next topic

With a little help from my friends...

I'm working on a big orchestral score with a lot of instruments, so many that they cant fit in a page unless you can use a microscope to read.
The solution is to use a "french" style score in which the instruments that don't play in that page are simply omitted.
Of course I use the "Collapse" option in boundary change for this. The problem is that, with a screenful of notes,  it's very easy to forget one "EndCollapse" and checking the whole score with the print preview is boring.

My idea is as follows: a simple (I think) tool that sets the color of all the objects (in its wide sense, not in the sense of "plugins") between "Collapse" and "EndCollapse" in every staff to a color of user choice. In this way it's immediate to see what will "disappear" when printing.
Returning later the whole score to the default color is not a big problem, but if the tool could do this too would be the top.

Anyone can be so kind to write this tool?

Re: With a little help from my friends...

Reply #1
Your concept might not be as useful as you think.
In print, much depends on where the system breaks.
Often, colored items would be printed.

OTOH, a user object (plugin) can distinguish between print, view and edit.
Registered user since 1996

Re: With a little help from my friends...

Reply #2
In print, much depends on where the system breaks.
Yes, of course, but that's not my need.
What I need is to be sure to collapse what can be collapsed but, in special mode, to be sure to close every collapsed section.
If I forget an "EndCollapse" I can miss a part and, very easily, I'll detect it when it's too late (i.e. after printing).

Re: With a little help from my friends...

Reply #3
I always put the "collapse" and "end collapse" in at the same time. You don't have to be exact - just place the "collapse" at the first place where it can take place and the "end collapse" at the first place you need to see that part again. The program will take care of any rests that are needed to fill in the staves before and after.

Re: With a little help from my friends...

Reply #4
This little lua-script can help coloring objects in collapsed sections.

This script supposes that every object in the collapsed section has the color-option. If this is not the case, I don't know what happens with your score. It may corrupt your file !!!  So, use with care.

The code should be self explanatory and can be adapted if more options are needed.


Code: [Select · Download]
-- $NWCUT$CONFIG: FileText $
nwcut.setlevel(2)
nwcut.status = nwcut.const.rc_Succes
--nwcut.status = nwcut.const.rc_Report

local progname = 'change_collapse_color'
local HelpMsg = [[
This tool changes the color of items in a collapse boundery
]]

--------------------------------------
-- Main processing -------------------
--------------------------------------
assert(nwcut.getprop('Mode')       == nwcut.const.mode_FileText, "Input type must be 'File Text'")
assert(nwcut.getprop('ReturnMode') == nwcut.const.mode_FileText, "Under 'Options', check 'Returns File Text'")

collapse_color = nwcut.prompt("collapse_color N ", "#",0,5)
collapse = 0

for item in nwcut.items() do
    if collapse == 1 then item.Opts.Color = collapse_color ; end--if
    if item:Is('Boundary') then
         if item.Opts.Style == 'Collapse'    then collapse = 1  end--if
         if item.Opts.Style == 'EndCollapse' then collapse = 0  end--if
    end--if
nwcut.writeline(item) 
end--for   


Bart

Re: With a little help from my friends...

Reply #5
Not perfect but a very good start.
Thank you, Bart.
Soon or later I should study a bit of lua (and the NWC lua library).

By the way: thank to this tool I discovered 3 errors in the collapsing of the staves! ;D

Re: With a little help from my friends...

Reply #6
I put together a JavaScript tool to handle multi bar rests and collapsing staves a few years ago.  After downloading it (remember where it is), install a new tool (you will have to assign it a group and name) and browse to where you parked it. Put "wscript " before the path and, following a space, copy the two prompts from the 4th line of this script to the end of that line.

mmr.js
Since 1998

Re: With a little help from my friends...

Reply #7
I didn't remember that your mmr tool adds Boundary collapse and cancel collapse around the multi measure rests.
That's ok if I use multi measure rests in every part I want to collapse.
A little problem is that it seems to work on a single staff each time, not the whole file at once.
Thank you anyway

Re: With a little help from my friends...

Reply #8
Hello Bart,

That's a very nice tool. I have one suggestion that will help it deal with multi-staff scores a bit better.  Currently, if you have a staff which has a collapse section which is not followed by an end collapse, then the coloring will wrap around to the next staff. This is obviously not desirable. Adding a single line of code, at the top of the for loop, will address this:
Code: [Select · Download]
-- $NWCUT$CONFIG: FileText $
nwcut.setlevel(2)
nwcut.status = nwcut.const.rc_Succes
--nwcut.status = nwcut.const.rc_Report

local progname = 'change_collapse_color'
local HelpMsg = [[
This tool changes the color of items in a collapse boundery
]]

--------------------------------------
-- Main processing -------------------
--------------------------------------
assert(nwcut.getprop('Mode')       == nwcut.const.mode_FileText, "Input type must be 'File Text'")
assert(nwcut.getprop('ReturnMode') == nwcut.const.mode_FileText, "Under 'Options', check 'Returns File Text'")

collapse_color = nwcut.prompt("collapse_color N ", "#",0,5)
collapse = 0

for item in nwcut.items() do
    if item:Is('AddStaff') then collapse = 0 end--if
    if collapse == 1 then item.Opts.Color = collapse_color ; end--if
    if item:Is('Boundary') then
         if item.Opts.Style == 'Collapse'    then collapse = 1  end--if
         if item.Opts.Style == 'EndCollapse' then collapse = 0  end--if
    end--if
nwcut.writeline(item) 
end--for   


Re: With a little help from my friends...

Reply #9
Warren, I tried to install your tool but, after the prompts, I keep getting
Quote
No script interpreter for files with extension .js
N.B. Windows XP 32.
P.S. The command line is:
Quote
wscript Scripts\mmr.js <PROMPT:MMR?:=|Yes|Undo> <PROMPT:Options:=|HideAll|ShowAll|ShowBar|ShowRst|LayerHide>

Re: With a little help from my friends...

Reply #10
Mike, I had already met that problem and I had already put in the fix.
Thank you anyway, on behalf of a possible user interested but not too expert.  :)

Re: With a little help from my friends...

Reply #11
Did I ever tell you that editing a big score with multi measure rests is a p.i.t.a.?
When you scroll up and down from a staff to the other the MMRs make the cursor jumping here and there...

Re: With a little help from my friends...

Reply #12
... that's why I use only standard rests in the concert pitch score; and introduce MMRs only in the print view, which is created mechanically from the concert pitch score. I think this separation of "working score [staves]" and "printing score [staves]" is quite useful as a "separation of concerns" tool - this is one reason.

H.M.

Re: With a little help from my friends...

Reply #13
For me, when I need a run of rests within a collapsed section, I use regular rests rather than MMRs. Like @hmmueller, I only use MMRs when I want them to print as such.  It makes page up/down through multiple staves much easier.

Re: With a little help from my friends...

Reply #14
which is created mechanically from the concert pitch score
What do you use to "mechanically" create the instruments score?

N.B. In my case there is a problem: the score is in 2/4 and the full measure rests are 2/4, not whole rests.  ;D

I have a staff with rehearsal marks, comments etc. meant to be overlayed to the top ordinary staff (or the instrument staff in case of a part).
The problem is that when the top ordinary staff is collapsed the overlayed staff is still visible... alone.

Well, stop for tonight. Bed time here.

Re: With a little help from my friends...

Reply #15
What do you use to "mechanically" create the instruments score?
Me. The process is straightforward - mark all, copy it, transpose it, audit notestems for all staves; and then go over the complete score and do e.g. MMR replacements, various alignments (which I usually copy back into the concert pitch score) and, on the whole, re-read and re-think the whole music ...

N.B. In my case there is a problem: the score is in 2/4 and the full measure rests are 2/4, not whole rests.  ;D
Why wouldn't they be full measure rests also for 2/4?

I have a staff with rehearsal marks, comments etc. meant to be overlayed to the top ordinary staff (or the instrument staff in case of a part).
The problem is that when the top ordinary staff is collapsed the overlayed staff is still visible... alone.
Yes, this is a nuisance - it kills my concept of having various topmost formatting staves (esp. for breaks at bars) at times. "Overlay with next visible staff" would be a nice feature ...

Well, stop for tonight. Bed time here.
Good morning, as of now!

H.M.

Re: With a little help from my friends...

Reply #16
Quote
wscript Scripts\mmr.js <PROMPT:MMR?:=|Yes|Undo> <PROMPT:Options:=|HideAll|ShowAll|ShowBar|ShowRst|LayerHide>
Does "Scripts\xxx.js" work on other scripts? Mine looks like
Code: [Select · Download]
wscript "C:\Users\Porter Household\Documents\My Webs\javascript\mmr.js" <PROMPT:MMR?:=|Yes|Undo> <PROMPT:Options:=|HideAll|ShowAll|ShowBar|ShowRst|LayerHide>
Before adding that line, click Browse to find the file, put "wscript " at the beginning and the prompts at the end.  On mine, "wscript.exe" is in \Windows\System32.

HTH
Since 1998

 

Re: With a little help from my friends...

Reply #18
Me. The process is straightforward - mark all, copy it, transpose it, audit notestems for all staves; and then go over the complete score and do e.g. MMR replacements, various alignments (which I usually copy back into the concert pitch score) and, on the whole, re-read and re-think the whole music ...
Gosh! ;D

I don't understand if you're talking about the file path or the file type.
The path yes, it works with all the NWC tools.
The file type no. wscript doesn't work with any .js (even outside of NWC, of course.)

I have a sneaking suspicion that wscript (part of Windows Scripting Host -AKA- WSH) was a separate install on XP
Yes, you're right but... I already installed the relevant service pack long ago and my wscript is version 5.7.0.18066.
Anyway I'll try the one of your link. Thanks.

Re: With a little help from my friends...

Reply #19
Quote
Anyway I'll try the one of your link
Quote
---------------------------
Windows Script Setup Error
---------------------------
Setup has detected that the Service Pack version of this system
is newer than the update you are applying.

There is no need to install this update.
---------------------------

Re: With a little help from my friends...

Reply #20
Hmm, don't have time to look now, but why not do a search for why .js scripts don't work - I vaguely recall seeing something appear in my search when I was looking for the WSH link.

wscript SHOULD work with .js files...
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.


Re: With a little help from my friends...

Reply #22
To be more explicit: wscript mmr.js //E:jscript
But don't ask me why the extension .js is not handled natively!  ::)
Thank you a lot, Rick.

Re: With a little help from my friends...

Reply #23
But don't ask me why the extension .js is not handled natively!  ::)
I don't know why either. From what I read, there may be keys in the Registry that affect this. The articles are not clear.
I thought of offering the suggestion a day or so ago, but I didn't want to look like a fool.
I'm glad it worked for you.
Registered user since 1996