denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Import filter for CapXML


From: Richard Shann
Subject: Re: [Denemo-devel] Import filter for CapXML
Date: Fri, 03 Apr 2015 14:33:46 +0100

On Fri, 2015-04-03 at 15:01 +0200, Andreas Schneider wrote:
> Thank you for pointing to the CapToMusic script which I previously did
> not know. However, I could not get it working -- I always get an error
> "No module named caplib.capDOM", maybe one needs a full version of
> Capella to run it. Too bad, that would have been the easy way.
> 
> I am familiar with C, but not with Python.

In that case there is a fairly straightforward route, clone the files
src/export/importmusicxml.[ch] and then modify the xml fields that are
searched for. This would save a good part of the work, as there are
procedures such as insert_note() to put a note into the score and
add_note()to add a note to the chord at the cursor and so on. The basic
strategy followed is to step through the input building up a Scheme
script (by appending to GStrings, one for each voice IIRC), and then at
the end to put these together with commands to create each voice and
finally execute the Scheme to create the score.

You would have to strip out all the horribly convoluted code that deals
with musicxml's timer going backwards and forwards and hopefully all the
stuff for staffs and voices would be much simpler. I would hope that the
capella format would just give you a sequence of notes, rests, time
signature changes etc to put into a voice in the right order, in which
case it will just be a case of building up the GStrings for each voice,
the rest of the work is already done.

N.B.
There is a bit of irrelevant code at the bottom of the file
src/export/importmusicxml.c - the entry point you need is the procedure
mxmlinput (gchar *filename) which would become capella_input (gchar
*filename). The irrelevant code starts #ifdef DEVELOPER.

I'll be happy to help!

Richard



> 
> Andreas
> 
> 
> Am 03.04.2015 um 11:09 schrieb Richard Shann:
> > On Fri, 2015-04-03 at 00:13 +0200, Andreas Schneider wrote:
> >> How difficult and time-consuming would be
> > 
> > That depends on so many things - I did the current MusicXML importer and
> > it took me days of work, but MusicXML is an extremely obfuscated
> > representation of a music score due to its basic design which highly
> > MIDI influenced.
> > 
> >>  the implementation of a
> >> (basic) import filter for the CapXML format defined in the attachement?
> > 
> > Did you see
> > 
> > http://bjungmann.privat.t-online.de/CapXMLSkripte.htm
> > 
> > it offers CapXML to MusicXML conversion, and Denemo does import
> > MusicXML...
> > 
> >> I importing a score to Denemo from that format, and via MIDI it takes me
> >> a few hours per movement to get everything correct, so if I would save
> >> time by implementing the direct import, I'd be willing to do it if you
> >> give me some starting help.
> > 
> > Which programming languages are you familiar with? It makes a big
> > difference - e.g. if you are familiar with python then the python script
> > which you get from the above link could be adapted to output Denemo's
> > Scheme (which is how Denemo's musicXML import is done). I used the
> > libxml2 library to import MusicXML and then output the Denemo Scheme
> > using C, but that is just because I have written a lot of C in my time.
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]