Pretty obvious, still fun. A sweep through the harmonic/overtone series.
i=1.0
partials=32
dura=0.06
pdamp=0.8
use_synth :sine
use_synth_defaults attack: 0.05, sustain: 1
fund=60
with_fx :reverb, room: 8, damp: 0 do
partials.times do
freq=hz_to_midi fund*i
play freq, amp: 1/(i*pdamp), release: (partials-i+1)*dura
i+=1
sleep dura
end
end
Though exceedingly simple, perhaps, I feel that this kind of thing can help learners “appropriate sound”. Sure, there are plenty of YouTube videos about the overtone series. With a bit of code, it makes it easier for learners to try things on their own, tweaking a parameter here and there. For instance, it can be switched to an “undertone sweep” by changing freq=hz_to_midi fund*i
to freq=hz_to_midi fund/i
. Again, really simple. And kinda fun.
Of course, it’s also a neat way to learn some simple coding ideas.
For context…
Was exploring the overtone series because of George Russell’s “Lydian Chromatic Concept of Tonal Organization” (LCCTO). While discovering that it’s more of a pseudoscientific theory than I had thought, I got to think about that 11th overtone and the relationship between the overtone series and tuning systems.
Reminded me of the bit of training I had in acoustics and psychoacoustics in the late 80s and early 90s. At the time, Csound tended to be what instructors used to create example files. We also used some pretty sophisticated (and then-expensive) equipment like Brüel & Kjær instruments (that was probably long before Hainbach started collecting them). Decades later, I’m still not that good with Csound… and I don’t have Hainbach’s budget or patience for this kind of thing. So, simple Sonic Pi scripts will have to do.
And the result is pretty neat, to my ear.
One thing I’ll probably do with this is use samples from those experiments in other contexts, say with granular synthesis tools on my iPad.
Something I wish I knew how to do is to “autosample” in Sonic Pi. Basically, write samples directly from the script. I’m sure it’s doable and probably fairly easy. Perhaps even easier on the command-line. Then, it’d be easier (and more precise) than trimming the audio recordings.
This whole period of isolation is as good a time as any to play with this geeky stuff.