Code from tutorial doesn't work for me...can you help?


Very amateur coder and musician, with high interest in both. Loving Sonic Pi…and working through the tutorial.

I’m getting into the good stuff…right now. I’m just starting with threads.

However, to my dismay, the simple example given, returns only the drum kick looped instead of the fm sample simultaneous as expected. Checked into the Discord and the two people that responded had it work as expected. This is the only time thusfar the code has given me any problems, following the full tutorial to this point. I feel like this is really important, so am very curious to know what may be causing the issue. I’ve tried stopping, closing, restarting, etc.

in_thread do
loop do
sample :drum_heavy_kick
sleep 1

loop do
use_synth :fm
play 40, release: 0.2
sleep 0.5

Update: Got some additional feedback on Discord and realized that at 40, I am completely unable to hear it, even though it is running the code, whereas at 50 or 60, I hear it plain as day!

Though, this wasn’t the case for the other two on Discord, and presumably most people.

1 Like

Hey @plexiclass,

your ability to hear low notes such as 40 is typically limited by the ability of the speakers/headphones you’re using. Typical laptop speakers or in-ear headphones don’t usually have a decent capability for bass which means these low frequency sounds will be very quiet. However, plug your laptop into a nightclub sound system with huge subs and you’ll make the room shake :slight_smile:


I hear ya…no pun intended…well now it is :slight_smile:

Inspiration to get better, get some equipment, and get it bumping!