Melodeon.net Forums

Discussions => Tunes => ABC => Topic started by: Gandy on July 07, 2010, 01:30:22 PM

Title: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Gandy on July 07, 2010, 01:30:22 PM
Hi,

I'm looking for an ABC tool that can clean up code that's been written with the wrong key signature.   In this case its from a MIDI - ABC conversion.

To illustrate what I mean, suppose the tune is in F, but the conversion comes out with no key signature.  All the B flats will be written with unnecessary flat symbols, and the odd B natural accidental will be written without the natural symbol.

What I am hoping to find is something that would re-write the ABC code for a new key signature, without transposing, but correcting the sharp, flat and natural symbols to match the new key signature.

Any suggestions would be appreciated,

Tony S
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Simon on July 07, 2010, 02:34:45 PM
Perhaps abc2abc can do this. A simple search/replace in a text editor also works. Or transpose the midi to C first.
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Gandy on July 07, 2010, 03:15:32 PM
Or transpose the midi to C first.
That's worth a try ... transpose down to C within MIDI, convert to ABC then transpose the ABC back to the proper key.   I think there'll still be a few surplus symbols, because MIDI seems not to really recognise bar lines when it comes to notating accidentals.

abc2abc looks promising, but those command line programs seem a bit neglected nowadays.  There seem to be up to date "readme" files for new versions, but the actual programs available for download are much older with fewer options.
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Simon on July 07, 2010, 06:13:36 PM
I think there'll still be a few surplus symbols, because MIDI seems not to really recognise bar lines when it comes to notating accidentals.
Actually midi doesn't do notes, only pitches. So a midi file can't distinguish a G# from an Ab for example.
abc2abc looks promising, but those command line programs seem a bit neglected nowadays.  There seem to be up to date "readme" files for new versions, but the actual programs available for download are much older with fewer options.
I'm using v1.56 (on linux); the latest is v1.59. There's a windows binary (http://abcplus.sourceforge.net/abcMIDI-2010_05_31-win32.zip) from May 2010 which should be pretty up to date.
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Anahata on July 07, 2010, 06:29:28 PM
I think what you want (using abc2abc) is this:

-usekey  sf
              This will force abc2abc to output the notes in the key signature
              keys[sf]  where  sf specifies the number of flats (-negative) or
              sharps (+positive) in the key signature. It is a number  between
              -5 and +5 inclusive.

That's different from transposing, and I assume it means it will take out the accidentals where they are already covered by the key signature you specify.
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: cboody on July 08, 2010, 07:41:39 AM
Binaries for abcMIDI contain the code for abc2abc and can easily be compiled for whatever platform.  I'm in process to update the abcMIDI files for Mac on the abcPlus site, but that will need to wait until probably tomorrow evening for me to get to it, and then Guido will need to post the files. 
Title: Re: ABC Tool Wanted (to clean up accidentals and key sigs)
Post by: Gandy on July 08, 2010, 10:41:59 AM
Thanks all.   abc2abc works for me, thanks for pointing me to an up to date version.
SimplePortal 2.3.5 © 2008-2012, SimplePortal