Skip to main content
Topic: NWC to LilyPond (Read 59026 times) previous topic - next topic

NWC to LilyPond

I've been updating the classic NWC2LY program and I've uploaded my efforts at http://www.philholmes.net/software/.

Comments are very welcome.

Re: NWC to LilyPond

Reply #1
Downloaded it from your site and ran it through a virus checker
Quote from: http://virusscan.jotti.org/en
Filename:  nwc2ly.exe 
Status:  Scan finished. 0 out of 20 scanners reported malware.
Scan taken on:   Wed 20 Jan 2010 17:44:56 (CET) Permalink
--------------------------------------------------------------------------
Additional info
File size:  16896 bytes 
Filetype:  PE32 executable for MS Windows (GUI) Intel 80386 32-bit Mono/.Net assembly 
MD5:  0b5b31e3b2130084d52bad0900bf89a4 
SHA1:  4cd014a5402cd54242d12f7815806ea5c7f1259f 
Crashes if you try to run it outside the User Tool environment (no STDIN)
Not a problem except that it wants to send an error report to MicroSoft (I declined)

I got results consistent with https://forum.noteworthycomposer.com/?topic=6759.msg46320#msg46320

Many changes to NWC2 since Mike Wiering wrote nwc2ly version 0.21
NWC2 can now export the entire file as nwctxt
This would seem to be a better mechanism to derive a page layout.
The new Beta gives more context info so that something sensible can be done with a partial staff.

There appear to be problems with RestChords and split duration chords.
This:
Quote from: STDIN
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Treble
|Chord|Dur:4th|Pos:-1|Opts:Stem=Up|Dur2:Half|Pos2:-3
|Note|Dur:4th|Pos:-1|Opts:Stem=Up
|RestChord|Dur:4th|Opts:Stem=Up,ArticulationsOnStem|Dur2:Half|Pos2:-3
|Note|Dur:4th|Pos:-1
!NoteWorthyComposerClip-End
yields this:
Quote from: STDOUT (partial)
\score {
{
 #(set-accidental-style 'modern-cautionary)
 \clef treble
< a'>4 a'4% Unparsed command: |RestChord|Dur:4th|Opts:Stem=Up,ArticulationsOnStem|Dur2:Half|Pos2:-3
 a'4 \bar "|."
 }
}
which won't do at all. For most folks anyhow. I'm perfectly happy to put each voice on its own staff.

I've recently moved to a new computer and it may be some time before I dive back into the LilyPond.
I may have more to say then. Good luck, and I hope you hear from some others.
Registered user since 1996

Re: NWC to LilyPond

Reply #2
I've now fixed some bits and uploaded a new version (0.1.0.1) to http://www.philholmes.net/software/.

Downloaded it from your site and ran it through a virus checker
:-)

Crashes if you try to run it outside the User Tool environment (no STDIN)
Not a problem except that it wants to send an error report to MicroSoft (I declined)
Should be fixed in latest version.

Many changes to NWC2 since Mike Wiering wrote nwc2ly version 0.21
NWC2 can now export the entire file as nwctxt
This would seem to be a better mechanism to derive a page layout.

Agreed.  However, as I said, I started with a port of the previous program.  When I've got more of the features working, I'll look at using it to do multi-voice songs.

There appear to be problems with RestChords and split duration chords.
I'm perfectly happy to put each voice on its own staff.

Yes - I was aware of that but forgot to document it. It's now documented and the error message is a bit more helpful, I think.  The problem with fixing it is that the current program parses the input one note at a time and then immediately writes the output.  To do polyphony using different voices (which is needed for chords with differing note lengths) correctly, you need to write a whole bar to each voice, and that means remembering a whole bars-worth of output before writing it - so I need some time to think about how best to do that.

Re: NWC to LilyPond

Reply #3
Phil,
do you work at Microsoft? :-)

Quote
File version: 0.1.0.1
Description: nwc2ly.Properties
Copyright © Microsoft 2010


Re: NWC to LilyPond

Reply #5
A question, please.

I've tried to work this out, but can't.  Could someone explain what the check box "Use stem for articulations" (notated as ArticulationsOnStem in the text output) actually does?  TIA.

Re: NWC to LilyPond

Reply #6
Normally, articulations are placed above the notehead if the stem is down, and below the notehead if the stems are up. ArticulationsOnStem reverses this. It is usually used on RestChords and split stem Chords. In NWC, whole notes have a stem direction and are affected by this. ArticulationsOnStem can always be set, even if there are no articulations and is not unset by removing articulations. It is set by default on RestChords, but not on split stem Chords. Go figure.

My user tool, Tidy.js will remove unneeded ArticulationsOnStem settings.
Registered user since 1996

Re: NWC to LilyPond

Reply #7
I've now made some substantial upgrades to my Noteworthy to LilyPond translator.  I've corrected a number of bugs, and now extended it so that it will read a Noteworthy text file and write a complete LilyPond score.

As before, it's at http://www.philholmes.net/software/ and feedback is welcome. I'm away for a week or so so if you give feedback and it's not answered, that's why.

Re: NWC to LilyPond

Reply #8
I've now made some substantial upgrades to my Noteworthy to LilyPond translator. 

Phil,
which version of Lilypond is the target of your translator?

Haymo


Re: NWC to LilyPond

Reply #10
I'm using it with the latest stable version - 2.12.3.  Why do you ask?

Thanks Phil.
I'm asking because Lilypond is continuously being upgraded - which probably is fine,
BUT then the upgrades cannot properly read older *.ly files - any way, that's been my experience.
Hence the need to know which version your convertor targets.

Re: NWC to LilyPond

Reply #11
I downloaded unzipped and opened (clicked on the exe)
Figured out how to export a nwctxt file
found it browsed and loaded
I have been using lilypond for a number of years etc.... but here's the response I got

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'nwc2ly, Version=0.1.0.3, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'nwc2ly, Version=0.1.0.3, Culture=neutral, PublicKeyToken=null'
   at NWCTXT2Ly.MainForm.btnGo_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
NWCTXT2Ly
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Frybyte/Desktop/Applications/NWCTXT2Ly.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Hope you can make sense of this as I've used NWC since it was on a floppy and I'd love to get the scores looking more like Lilypond

Jay

Re: NWC to LilyPond

Reply #12
Just tried it and got: Unhandled exception has occurred in you application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit, the application will close immediately.

Could load file or assembly 'nwc2ly, Version 0.1.0.3, Culture=neutral, PublicKey Token=null' or one of its dependencies.  The system cannot find the file specified. 

The details are:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'nwc2ly, Version=0.1.0.3, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'nwc2ly, Version=0.1.0.3, Culture=neutral, PublicKeyToken=null'
   at NWCTXT2Ly.MainForm.btnGo_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
NWCTXT2Ly
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Downloads/NWCTXT2Ly.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Since 1998

Re: NWC to LilyPond

Reply #13
Thanks to both of you for your reports.  That'll teach me not to test the install on a "clean" PC.

Because I've written the score translator to use the facilities provided by the user tool, you need to download both executables and put them both in the same directory.  I've updated my instructions on the web site and I hope this should fix your problem.  Please let me know if it doesn't - but in any case, how you get on.

http://www.holmessoft.co.uk/homepage/software/nwc2ly/

Re: NWC to LilyPond

Reply #14
Phil,
thanks for the work you've done!
I've gone through your instructions today (2010-07-26) and found them really helpful.

1. NWCTXT2ly.exe is hard-coded to produce a *.ly file, with header section which starts:

% Generated by NWCTXT2Ly C# version 1.0.1.1 by Phil Holmes
% Based on nwc2ly by Mike Wiering

\version "2.8.0"

The version available for download with your link, calls itself:
lilypond-2.12.3-1.mingw.exe

Question: Should I manually change the version, if the *.ly file is to be kept for a longer period?

2. After working through the samples which you provide,
I noticed that quite a large number of temporary files had been created.
Would it be feasable for NWCTXT2Ly.exe to create a \temp folder where these could be collected?


Re: NWC to LilyPond

Reply #15
1. NWCTXT2ly.exe is hard-coded to produce a *.ly file, with header section which starts:

% Generated by NWCTXT2Ly C# version 1.0.1.1 by Phil Holmes
% Based on nwc2ly by Mike Wiering

\version "2.8.0"

The version available for download with your link, calls itself:
lilypond-2.12.3-1.mingw.exe

Question: Should I manually change the version, if the *.ly file is to be kept for a longer period?


My understanding is that the version number tells LilyPond of the minimum version needed - so if you put version 2.8.0 and run version 2.12.3 it works fine.  That's what I do.


2. After working through the samples which you provide,
I noticed that quite a large number of temporary files had been created.
Would it be feasable for NWCTXT2Ly.exe to create a \temp folder where these could be collected?


Quite a few of these are produced by LilyPond, so it's not really feasible.  The simplest way is just to put the test files in a folder you won't use in the future, and delete them if you don't want them.

Re: NWC to LilyPond

Reply #16
Thanks for your reply, Phil.
My apologies for answering only now - it's been a bit of a rough time here.

Your convertor works beautifully.

Will have to learn how to use Lilypond properly,
to get at those features which Noteworthy cannot (yet) handle.

Haymo.

Re: NWC to LilyPond

Reply #17
Will have to learn how to use Lilypond properly,
to get at those features which Noteworthy cannot (yet) handle.

The later versions I use for my own benefit implement a fair number of Lilypond features that Noteworthy doesn't.  If you have specific requirements, please let me know.

Re: NWC to LilyPond

Reply #18
Thanks for this wonderful tool! It's come to be quite useful. Just a curiosity about how it works.

I have files "466tuba.nwc" and "457tuba.nwc" and it creates separate 466tuba.ly and 475tuba.ly but the staff.ly overwrites. Do I need to manually tweak the staff file name each time if I want to keep multiple source files in the same folder?

Thanks again though... you've saved me hours of labour. I love how NWC works for ease of entry, but I much prefer how Lilypond sets up output.


Re: NWC to LilyPond

Reply #19
Have you tried entering a descriptive bit of text in the Part Name box?  This should distinguish between the other files it creates.

Re: NWC to LilyPond

Reply #20
Ah ha. Indeed, that makes sense. Thanks! Awesome tool, as I said. Thanks for making it!

Re: NWC to LilyPond

Reply #21
Phil,
I thank you again for your convertor -
BUT-
Sadly, Bettie is winding down her orchestra at the end of 2011,
(after 27 years) which seems to bring to an end my need of all the advanced goodies available in Lilypond.

Haymo.

Re: NWC to LilyPond

Reply #22
The later versions I use for my own benefit implement a fair number of Lilypond features that Noteworthy doesn't.  If you have specific requirements, please let me know.

I've just loaded your utilities into my Win7 Pro laptop and I'm consistently getting 0 staves with 4 voices as the result from my input file; it's creating all the separate parts, but the main ly file doesn't seem to be grabbing them and linking them? odd.

Re: NWC to LilyPond

Reply #23
Could you post the main .ly file?

Re: NWC to LilyPond

Reply #24
Sure. I tried it with your demonstrator files as well, and here's what happens:
Quote
% Generated by NWCTXT2Ly C# version 1.0.1.1 by Phil Holmes
% Based on nwc2ly by Mike Wiering

\version "2.8.0"
\pointAndClickOff
#(set-global-staff-size 18)

\header {
subtitle = \markup {\fontsize #5 "Built On The Rock"}
composer = "Music: Lindeman (arr. Scheer)"
poet = "Lyrics: Grundtvig (tr. Doving)"
copyright = "Copyright"
}


\new Score \with {
\override PaperColumn #'keep-inside-line = ##t
\override NonMusicalPaperColumn #'keep-inside-line = ##t
}
{
<<
>>
>>
}

Re: NWC to LilyPond

Reply #25
Could you let me have a copy of your nwc file or the nwctxt file?  Also any filenames that are created by my program.

Thanks.

Re: NWC to LilyPond

Reply #26
Sure. Do you want the NWC file or the NWCTXT file? (Plus, PM me your email address so I can send it to you...!)
-Alex

Re: NWC to LilyPond

Reply #27
I was able to take the component files (created by your excellent utility) and assemble them to a working file, which, with a little tweaking (and a grasp of how Lilypond works) made it all work. I really like Lilypond, I just like using NWC as a frontend for it to do the brunt of the arranging and note-entry (I was tweaking a choir piece for our church to take out a key change which made the last part unsingable for our sopranos, who simply can't hit A's anymore).

Re: NWC to LilyPond

Reply #28
I think the nwc file should be enough.  Please let me know the directory name that it's in, too - in case this is causing my program come confusion.  I've pm'ed you an email address.  If you don't receive the pm, a visit to my philholmes.net website will give you the address of my webmaster account at the bottom.

Re: NWC to LilyPond

Reply #29
In case anyone is watching this thread, Phil and I have determined that the problem seems to be his convertor doesn't quite work rightly with 2.5.x files (but again, if you have a passing knowledge of LilyPond, it still works well enough that you can cobble the final work together from the parts).

Re: NWC to LilyPond

Reply #30
I've now upgraded my Noteworthy to LilyPond converter to handle the new staff types created by 2.5.  I believe it works correctly with these, but would welcome reports of it not doing so.  FWIW I don't slavishly follow the connect staves option of NoteWorthy - my converted files will always have the staves connected with Grand Staves, which is what I would expect from music theory.

Link as above.

Re: NWC to LilyPond

Reply #31
Just used the new version; thanks! Works great, so far; I'll try to break it again for you. :)