Parsing pitches and compute interval in cents

11 views
Skip to first unread message

jsch...@gmail.com

unread,
Sep 3, 2018, 5:28:48 PM9/3/18
to music-suite-discuss
Hi,

I want to write a command-line program to change the pitch of audio music using sox or rubberband. I would like to use Haskell and the usage should be something like:

transpose --from c --to fis [filename]

First, it would be nice to have LilyPond syntax for note names because it's intuitive to write. Second, I need to compute the difference in cents, i.e. hundredths of semitones. Because that value is what sox or rubberband need to change the pitch.

I have a couple of questions:

1. Is there still no LilyPond parser out there? I found https://github.com/ejlilley/lilypond-parse but sadly it parses to it's own music types.

2. If I write my own LilyPond parser, do you think, it's better to parse to music-suite's Pitch or to Music.Lilypond.Pitch? Probably LilyPond, because it's LilyPond syntax. Are there already translation functions between the two?

3. Are there already functions to compute the difference in cents between two pitches?In music-suite, Pitch is of class Num, but what does that mean, exactly? Is "fis" - "f" == 1 and "c'" - "c" == 12?

4. If I write my own parser, how to handle LilyPond languages for pitch names, e.g. "b" (engl.) == "h" (german). By passing kind of a locale to the parse function?

5. Is it worth at all to try to parse to and use a mature music library for simple cents computation?

6. I don't have the time to write a full LilyPond parser but would you incorporate a simple note parser into Music.Lilypond? Maybe this is a good and useful starting point.

Best, Jakob

Reply all
Reply to author
Forward
0 new messages