This is very interesting to me


I happened to discover this since i am learning to code in Python recently. I have always been interested in music but i am completely bad at understanding exactly what music is. I have taken music lessons before when i was younger and can mimic things after a while but i have never truly understood sound.

This seems like an object oriented way for me to learn how to write music. However the documentation and information seems to be geared towards people that already understand music in their own way.

I know this would be a great task for you but i would suggest you change your perspective and begin thinking about how you can get a meat head like me to understand how music works and sound. How to properly manipulate it better.

You seem to have all to tools needed to play music but i don’t even fully understand the spectrum of everything you can play. I will try to learn through experimentation to discover the sounds i want to make.

Hi Nicholas and welcome to Sonic Pi
It is an incredibly flexible program, and can cater for both those who like programming but know little about music, and those who come from a musical background, but have not done much programming before. Sam’s philopsophy in developing it was only to include things that a nine or ten year old could understand, (although some users, incorporate complex algorithms which is also possible).
The starting point is however that sounds can be high or low, and this is governed by a number in the range 1-127, such that a higher number gives a higher sounding note, than a lower one which does the opposite. Notes can sound for different lengths of time, and there can be gaps between them when the program sleeps and produces no sound. Starting with these simple ideas you can develop tunes and play them. The sounds are generated by synths, which have different characteristics: some sounding smooth and mellow, others harsh and more grating. You can choose to taste. Add to this mix the ability to play prerecorded samples, which can be of musical instruments, durms, cymbals, or even dogs barking, and you have a rich mix of possibilites.
Nothing is “wrong” to try out with Sonic Pi. You can experiment to find what sounds nice to you. Do that and you are making music.

In order to guide you, there is an extensive tutorial built in to Sonic Pi which you can access from the Help Button. There are six tabs containing
The Tutorial
Some Example programs to try out
Details of the available synths
Details of effects (fx) such as reverb and filters which can be used to modify sounds
Details of the included recorded samples
A language syntax section which details individual commands that Sonic Pi understands

There is also an external tutorial which I can highly recommend by MeHackit which you can access here

The best thing to do is to experiment and try things out using these various sources of help.
And there are lots of Sonic Pi enthusiasts on this site who will be willing to help and give advice along the way.

The main thing is have a lot of fun, and enjoy trying out Sonic Pi.


Thank you for the simple explanation of an orderly way for me to experiment creating a sound with this. It should be in the doc intro lol.

Seems like it would be a better fit for me to understand how to make what I’m imagining.

Making sounds high or low as you mentioned. Is that like changing the frequency of a sound?

Thanks for the reply I will look at the other thing you provided.

Exactly right. A “high” note has a high pitch or high frequency compared to a “low” note which has the opposite. Musicians would refer to notes by name and octave, and Sonic Pi has in fact got three ways of decsribing this. Numerically using what is often referred to as the midi value of a note, midi being a protocol to enable different electronic instruments to communicate together, using the number range 0-127 to refer to the pitch of the note. You can use use a midi_to_hz function to convert a midi number to its corresponding frequency or a hz_to_midi function to convert in the opposite direction.
name wise, you can use :c4 to denote note C in octave 4 which is equivalent to midi note 60 or frequency 261Hz (approx).
Here is a little program which illustrates the three notations, and prints the results (using puts)

puts :c4 #musical note notation
play :c4 #listen to it
sleep 1 #wait a bit
puts note(:c4) #note converts musical notation to midi value =>60
play 60 #sounds the same
sleep 1 #wait a bit
puts midi_to_hz( note(:c4) ) #calculate the frequency of this note
play hz_to_midi(261.6255653005986) #convert the frequency back to midi and play it