August 14, 2024
More Thuja, another burst where I'm simplifying the API. I've been using Codeium to kickstart my refactoring and docmentation of this thing, and it's pretty fun. I asked ChatGPT to make some variations of Happy Birthday I could use with Thuja - here's the transcript:
Me: you are an electronic music composer, using pitches and rhythms to describe melodies. pitches are notated as lower case letters: a, b, c, d, e, f, g. adding an 's' to a pitch makes it sharp, for example 'as' is a sharp.
rhythms are notated as such: w is a whole note, h is a half note, q is a quarter note, e is an eighth note, s is a sixteenth note. rhythms can be combined with a '+', for example q+e is valid. adding a '.' after a rhythm adds half the duration, for example 'q.' is equivalent to q+e.
ChatGPT: Got it! I’m now set to work with pitches and rhythms in this notation system. Feel free to give me any sequence to compose or analyze, and I’ll help build the melody or rhythm accordingly. What would you like to do next?
Me: One more rule: the octave number should be added to each pitch, for example a4 is the a below middle c on a piano, and has a frequency of 440 Hz. the octave number should appear after the 's' is a pitch is sharp.
ChaptGPT: Got it! Your notation system is now clear. If you have a melody or rhythm in mind, feel free to share, and I’ll help you with the composition or analysis. What would you like to explore next?
Me; when I ask for a melody, return two python lists: one of pitches, one of the corresponding rhythms.
ChatGPT:
Understood! When you ask for a melody, I’ll return two Python lists: one for the pitches and one for the corresponding rhythms. Feel free to request a melody whenever you’re ready!
Me: generate the melody for "Happy Birthday to You"
ChatGPT:
Here’s a melody for “Happy Birthday to You” in the notation system we’ve been using.
Pitches:
['g4', 'g4', 'a4', 'g4', 'c5', 'b4', 'g4', 'g4', 'a4', 'g4', 'd5', 'c5',
'g4', 'g4', 'g5', 'e5', 'c5', 'b4', 'a4', 'f5', 'f5', 'e5', 'c5', 'd5', 'c5']
Rhythms:
['q', 'q', 'q', 'q', 'q', 'h', 'q', 'q', 'q', 'q', 'q', 'h',
'q', 'q', 'q', 'q', 'q', 'q', 'h', 'q', 'q', 'q', 'q', 'h']
...and so on i.e. (can you make the rhythm more interesting through the use of dots (for example, 'q.', 'e.' or 's.' and rhythmic addition (for example, 'q+e' or 's+s+s')?
Here's the link to the chat session
I / 'we' made 3 sections with four parts - the rhythmic variation made a nice smeary minimalist texture. Not super interesting musically, but some clay to play with. I think these LLMs can get you past the blank canvas and into making. I'm not precious about the purity of boredom and staring at a blank piece of paper this week, though I may reconsider this position down the road.
Comments powered by Talkyard.