2024-03-10 - songwriting software
hardware success is great, but i needed to make some software to make writing songs (or maybe more appropriately control scripts, or lists of steps) for this contraption easier. i could slap together some neat sounding bits and pieces with a little bit of python but it was cumbersome and not terribly fun.
over the last couple of years thanks to the radio project i've gotten somewhat experienced with browser javascript and building simple ui's in it. so i sat down to write a song editor.
something important to note - i know fuck all about music structure. ok maybe a little. i remember some mnemonics for some note patterns from elementary school music class. i remember there's things like whole notes and fractions of notes. there's time signatures but i've never been very good at understanding them beyond 4/4. also i don't necessarily want to fix this. i just want to make cool noises and occasionally make complicated cool noises.
i've gone for a pretty simple design. you can have one or more tracks, and each track is a list of events. events have a type -
- NoOp: does nothing, changes no output states. useful for inserting quiet
- PinOn: turns a gpio pin on. it does not care what the state is, if you need a toggle that's on you to do with a...
- PinOff: opposite of PinOn
- ToneSet: sets the track's dac output to the specified level. this is a naming decision i need to fix because it will exist outside of using voltage for tone control
- KeyPress: combines a sequence of actions similar to a ToneSet followed by PinOn, a delay, and PinOff. this provides functionality similar to the cv and gate outputs of the synthesizer's keyboard, hence the name
events also have a tone and duration. the tone is the level 0-255 to set the track's dac output. the duration is given in ticks, and the playback software allows for configuring how long in seconds (or fractions of seconds) a tick is.
only ToneSet and KeyPress will actually affect the dac's output, but i figured at 3 fields per event we're not exactly boiling the ocean with resource usage. only the Pin types and KeyPress will cause gpio actions. this means a track that only uses ToneSet can be used as a generic programmable control voltage, and a track with only PinOn/PinOff can be used as a programmable switch. while a track will frequently use a dac and gpio together, they don't have to.
for a single weekend crash effort, i'm pretty happy with the results. i made it possible to drive most of the functions with hotkeys, allowing for really quick event adding and editing. and if i want to create a complex note sequence, i can pop open the browser console and do things there.
soon i'm going to be really fucked though. soon i'll have no big obstacles to making music and i'll be left with the staggering realization that i have no good ideas of music to make :D
back to blog index
back to jattdb.com