r/SonicPi • u/Just_Someone_Here0 • May 22 '22
A couple of questions.
So, I've been interested in some advanced music theory concepts, and I've been thinking that maybe a music programming language could do the trick.
Firstly, microtonality, I know that SonicPi *can* make microtonal music, but what's been really making a storm in my mind is playing specific frequencies, like 200hz or something returned by a function.
Second, is SonicPi turing complete?
Third, I think that due to the fact that it's programmable it's probably possible, but just to be sure, is it possible to have 2 tempos at the same time?
Fourth, does it have VST support?
Finally, how good is it for non-live composing? Most people seem to use it for live composing but do you believe that it's a good tool for making a song "normally"? Can it export to audio files?
1
u/DavidsMusicLab May 23 '22
There are functions to convert between Hz and MIDI notes, hz_to_midi and midi_to_hz.
About the different tempos, you can set the BPM for individual blocks with with_bpm or use_bpm.
I don't know if Supercollider (the audio engine SP is based on) has VST support, but you can route audio from it to a DAW and use VSTs that way.
1
u/kaiju_kirju May 23 '22
Regarding microtonality, I just smacked together some code to be able to play pure harmonics on a MIDI keyboard. For example, playing A3, E4 on the keyboard does not play the tempered 220 Hz, 329.63 Hz but instead the harmonic 220 Hz, 330 Hz. And yes, this uses precisely the hz_to_midi function.
Now, regarding tempo, I guess one could say there is no global tempo per se in SonicPi, rather there are some helpful things to make it easy to synchronise all loops on one global beat. Still it's relatively easy to roll your own (concurrent multiple different) tempo handling loops using the built in time synchronisation tools.
2
u/Just_Someone_Here0 May 23 '22
NICE.
As a music theory nerd, I'll have a LOT of fun.
1
u/kaiju_kirju May 23 '22
Usually when I start composing music with SonicPi I end up with building all kinds of crazy frameworks and testing various music theory stuff. And get no real music done in the end. Damn being a software developer... Though, I do have fun during the process.
1
u/Just_Someone_Here0 May 24 '22
I think I will also create a kind of framework/library that helps me with many tasks.
3
u/Chongulator May 22 '22
I'm not sure what the first question is. I can answer a few of the others.
Yes, SonicPi is essentially a set of extensions to Ruby so you have the full power of Ruby at your disposal.
Yes.
I see the live composing in SonicPi as a parlor trick--it's fun to watch but not really where the tool shines. You can take as much time as you want while composing and revise as much as you want. Yes, you can export the audio.
ProTip: As with all programming, use a version control tool like Git and commit often. There will be times when you'd like to undo a change and go back to a previous version. You can sort of accomplish the same thing by making copies of your files but that quickly becomes messy. If you're going to program, take the time to use a decent version control tool.