Skip to main content
Topic: How to (1) alter code and (2) get it back into the notation file (Read 9022 times) previous topic - next topic

How to (1) alter code and (2) get it back into the notation file

Very basic questions.  I finally figured out how to view the code for selected notes.  Tools > User Tool > .Automatic > Show Note Names > Run > STDIN button.

So, how do you edit the code for your selected notes?  You can't edit it in the window that appears after making the selection describe above.

And then how do you get your edited code translated back into the notation file itself? 

Thanks!

Re: How to (1) alter code and (2) get it back into the notation file

Reply #1
Hi Wal,
Ummm, what kind of modifications do you want to make? 

Most things are far easier to edit in the normal editor.

Bulk edits can often be done with user tools - most commonly (in my case) Global Modification.

If you really need to use a text editor, then highlight the section to edit, copy (Ctrl+C) to the clipboard, paste into Notepad (Ctrl+V), make the mods and reverse the copy and paste process.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

 

Re: How to (1) alter code and (2) get it back into the notation file

Reply #2
If(!) you are a power-user of some good text editor (UltraEdit is my favorite; NotePad++ is a free one), then you can easily
  • mark a selection in NWC
  • copy it into the editor - it will turn up as text there
  • modify it; regular expressions, in particular, are a very powerful tool; scripting in the editor might be another one;
  • mark all the text in the editor
  • and copy it back into NWC.
Likewise, you can just edit the .nwctxt file with that powerful editor. However, if you do not know, or cannot really work with such an editor (the standard Windows notepad is not meant by that - it is a crutch), then this is not for you ...

H.M.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #3
And mine too.
Long ago I made the syntax file "nwctxt.uew" and I tried to keep it up to date.
Do you have something similar I can borrow from?
Or, vice-versa, do you like to have mine?

Re: How to (1) alter code and (2) get it back into the notation file

Reply #4
If you are going to modify something with a text editor:
  • First save your file if you have done anything else to it.
  • Open text editor, do Alt/Tab to get back to NWC.
  • Select what you want to change.
  • Cut to the clipboard (Cntl/X).  Alt/Tab.
  • Paste from the clipboard (Cntl/V) into your text editor, then modify as needed.
  • Select all (Ctl/A). Cut to the clipboard.  Alt/Tab to get back to NWC.
  • The cursor will be where you left it.  Paste from the clipboard.
Since 1998

Re: How to (1) alter code and (2) get it back into the notation file

Reply #5
One thing to be aware of when doing this is that if you manage to make edits that are "illegal", NWC may silently throw away notes or attributes when you paste the code back into NWC. Therefore, always be sure to save your score before making these sorts of changes.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #6
One thing to be aware of when doing this is that if you manage to make edits that are "illegal", NWC may silently throw away notes or attributes when you paste the code back into NWC. Therefore, always be sure to save your score before making these sorts of changes.
Yep.  Step One.
Since 1998

Re: How to (1) alter code and (2) get it back into the notation file

Reply #7
Thanks everyone, especially Warren Porter.  Now it seems obvious.  I was thinking this could done within User Tools (like, that there would be a text editor in there).  But I just used Notepad and Warren Porter's procedure, and it worked. 

One reason I want to do this is to get RestChords into the music.  I see the notation and the code for it in a piece I downloaded, but I don't think it's possible to insert a RestChord in NWC itself. 

Re: How to (1) alter code and (2) get it back into the notation file

Reply #8
...I don't think it's possible to insert a RestChord in NWC itself. 
Of course it is - everything you can see in an NWC score can be entered!
For rest chords, see help topic (F1, then search for it) "Chord Member Command", where it says in item 4.:
Quote
A chord containing a rest is created by first placing the rest, and then adding one or more notes to that rest. The duration of the rest must be smaller than that of the notes that are added to it. The stem direction assigned to the rest must be different (opposite) than the note that is being added, or the operation will fail.
and then, after item 5,
Quote
Chord members can be added most efficiently by pressing <Ctrl Enter> from the computer keyboard.
Also, if your chords do not follow the rules above (rest shorter than added notes), you can create almost anything in the score with layered staffs - look them up in the help!
Hope that helps!
H.M.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #9
One reason I want to do this is to get RestChords into the music.  I see the notation and the code for it in a piece I downloaded, but I don't think it's possible to insert a RestChord in NWC itself. 
Yes, it's possible: first enter the rest (space bar) and then the note(s) with CTRL/Enter. Limitation: the note must not be shorter than the rest.

Note: I hadn't seen the post of hmmueller when I was typing mine. It's more complete.
Always look on the bright side of life!

Re: How to (1) alter code and (2) get it back into the notation file

Reply #10
And mine too.
Long ago I made the syntax file "nwctxt.uew" and I tried to keep it up to date.
Do you have something similar I can borrow from?
Or, vice-versa, do you like to have mine?
I didn't make anything - I'm quite happy to read the "raw text". But if you are willing to share it, that would be nice!

H.M.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #11
One small correction to the NWC documentation for RestChords. As noted by @hmmueller, it says:
Quote
... The duration of the rest must be smaller than that of the notes that are added to it.
Actually, it should say:
Quote
... The duration of the rest must be equal to or smaller than that of the notes that are added to it.
@Opagust says it correctly (the note duration must not be shorter than the rest).

Re: How to (1) alter code and (2) get it back into the notation file

Reply #12
I didn't make anything - I'm quite happy to read the "raw text". But if you are willing to share it, that would be nice!
Yes, raw text is readable, but the syntax colouring makes it easier.  :D
By the way: my version of ultraedit is quite old now, so perhaps there were some changes in the syntax file syntax.  ;)
And my file includes colors, that perhaps are not the one you like best.
Anyway you can find it here attached.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #13
I couldn't get two quarters against a dotted quarter and eighth on the same staff (soprano vs. alto) without the whole measure shifting over a 1/8 or 1/4 beat.  I finally got it with the code (see below).  I'll work on the suggestions some of you have given for direct entry, but in any case I'm happy to have learned the basics of using the code method.  Thanks again.

!NoteWorthyComposerClip(2.75,Single)
|Chord|Dur:4th|Pos:-1|Opts:Stem=Down|Dur2:4th,Dotted|Pos2:4
|RestChord|Dur:8th|Opts:Stem=Up,ArticulationsOnStem,HideRest|Dur2:4th|Pos2:2
|Note|Dur:8th|Pos:4|Opts:Stem=Up
!NoteWorthyComposerClip-End

Re: How to (1) alter code and (2) get it back into the notation file

Reply #14
The usual approach for situations like that is layering  - especially when it involves two independent voices, like soprano and alto. One voice on one staff, the other voice on a second staff that is layered with the first. This allows you to cross voices, as well.

Re: How to (1) alter code and (2) get it back into the notation file

Reply #15
The usual approach for situations like that is layering  - especially when it involves two independent voices, like soprano and alto. One voice on one staff, the other voice on a second staff that is layered with the first. This allows you to cross voices, as well.

Just layering two voices  entered on seperate staves can give a messy result. I wrote a user tool that tries to do better  ;D :
Layering voices
Always look on the bright side of life!