It’s been a bit since I’ve had time to post, but I’ve got an interesting new project that I’ve been working on. It’s a bit more complicated, ergo spread out over a few posts, but those tend to be the more interesting posts anyway, eh?
The basic idea is that I want to be able to write and play music in Racket. One end goal would be to make a library available for the C211 class to give them something else to work with (in addition to images and turtles). To that end, here’s my current plan of attack:
- Write a lexer for ABC notation to turn raw text into a list of tokens
- Write a parser to turn those tokens into a song (for example dealing with the interactions between key signature/accidentals and meter/note duration)
- Use the rsound library on Planet2 / pkg to play back individuals notes and chords
- Tie it all together to play a parsed song in ABC notation using the rsound library
- (maybe): Use the rsound library to save ABC files as WAV audio
- (maybe): Figure out the format and save ABC files as MIDI
- (maybe): Render songs as music sheets/li>
Sounds like fun! Let’s get started.