I often play with the brilliant Sonic Pi https://sonic-pi.net/ for a bit of fun, but let's be clear I have no musical ability. To get my head around it I tried turning thee one tune I know "Hot Cross Buns" for the recorder into a tune. I found a useful webpage https://newt.phys.unsw.edu.au/jw/notes.html to turn the notes into the MIDI number (60, etc) . Played with the synthesier sounds and choose tech_saw just because I liked it. The code is below use_synth :tech_saws 2.times do play 71 sleep 0.5 play 69 sleep 0.5 play 67 sleep 0.5 end 4.times do play 67 sleep 0.25 end 4.times do play 69 sleep 0.25 end play 71 sleep 0.5 play 69 sleep 0.5 play 67 Also tried it with changing the synth to prophet Also tried to make it a bit more mournful (possible slightly aggressive) with minor chords - I used https://en.wikipedia.org/wiki/Minor_chord#:~:text=In%20music%20theory%2C%20a%20minor,is%20called...
Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.