Forums => Tips & Tricks => User Tools => Topic started by: thepiano on 2016-01-06 07:30 am
Title: Colouring Tools
Post by: thepiano on 2016-01-06 07:30 am
Dear NWC users,
I have two problems in editing my sheetmusics. I hope someone could help me writing a tool:
Firstly, I want to colour (red) all of clefs. https://drive.google.com/file/d/0B-H5D05PlaLTUlljaWN0Z3FFQzg/view?usp=sharing
Secondly, I also want to colour (red) all of noteheads which are played in the black key of a Piano. https://drive.google.com/file/d/0B-H5D05PlaLTTE1oeUttZ19aRXc/view?usp=sharing
I do not have any background in programming, I have read the User Tools in NWC but I cannot understand clearly.
Best regards Thank you
Title: Re: Colouring Tools
Post by: Lawrie Pardy on 2016-01-06 03:05 pm
A quick and easy way to colour the clefs is to use the Global_Mod tool installed with the User Tool Starter Kit, which I assume you have installed already:
Press <Alt+F8> to open the user tool dialogue In the left pane, click on ".File Tools" In the right pane, select the now available "Global Modification (adp)" tool and press <Enter>
You will be presented with a dialogue box where you can enter the expression "Clef Color=1" (Dont enter the quotes and make sure there is a space between the words "Clef" and "Color").
This directive to Global_Mod will change ALL the clefs in your file to highlight colour 1, which is red, unless you have changed the highlight colours in the Options dialogue.
Changing notes that are on the black keys is a little more challenging and will require a tool that can take into account the clef, the key signature and any accidentals that may apply.
Title: Re: Colouring Tools
Post by: thepiano on 2016-01-06 03:32 pm
Thank you very much, I can change all the clefs into red. I am still learning to find a way to change the colour of noteheads...
Title: Re: Colouring Tools
Post by: Francis Beaumier on 2016-01-06 06:39 pm
> Changing notes that are on the black keys is a little more challenging and will require a tool that can take into account the clef, the key signature and any accidentals that may apply.
Presumably there aren't that many unique notes that need to be red. Rather than spend the time to write a tool to take all of that into account, couldn't you just run Global_Mod for, for example, all of the F's and then clean up the outliers manually? I'm afraid I can't play with this at the moment, but that would be my approach.
Title: Re: Colouring Tools
Post by: Rick G. on 2016-01-06 07:07 pm
-- rg_ColorNotesMIDI.Lua ver 1.0 User Tool <http://nwsw.net/-f9310> local map = {[0] = 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0} local playContext = nwcPlayContext.new()
for item in nwcut.items() do for notepos in item:AllNotePositions() do notepos.Color = map[playContext:GetNoteMidiPitch(notepos) % 12] end playContext:put(item) nwcut.writeline(item) end
Title: Re: Colouring Tools
Post by: NoteWorthy Support on 2016-01-08 05:56 pm
Another idea....though manual, not a user tool
Color a certain note for all instances on a staff (notehead and stem)
Select the note Edit: Find (Ctrl+F) to show the text representation of note Ctrl+C to copy the text representation Press Esc Place insertion point at the start of staff Press Shift+End to select entire staff Go to Edit: Filtered Properties (Ctrl+F3) Ctrl+V to paste into field Click Next, under Visibility tab, set item color to "whatever color" Click OK Those notes will be "whatever color"
Title: Re: Colouring Tools
Post by: thepiano on 2016-01-08 07:16 pm
-- rg_ColorNotesMIDI.Lua ver 1.0 User Tool <http://nwsw.net/-f9310> local map = {[0] = 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0} local playContext = nwcPlayContext.new()
for item in nwcut.items() do for notepos in item:AllNotePositions() do notepos.Color = map[playContext:GetNoteMidiPitch(notepos) % 12] end playContext:put(item) nwcut.writeline(item) end