General Questions

For those questions that don’t fit nicely into one of the existing topics :slight_smile:

Hi Sam & everyone else, looking forward to swapping ideas and tips with you all here!

Is there any way to add ‘groove’ or swing to drum patterns Sonic Pi, like Ableton’s groove pool or swing settings on drum machines?

An example is here, where the swing is set to ‘5’ on a Roland TR-909 to make the classic beat of Daft Punk’s ‘Revolution 909’ - https://youtu.be/xLCVNUj40I0?t=68

1 Like

We have basic support of adding swing with the swing fn - but this is something that really does need further work and deeper thinking. It would be ace to be able to create and share swing files. Should only be the case of agreeing on a spec for a data structure and a serialisation format.

1 Like

Seems like it might make sense to have a “feature request” category ?

4 Likes

The swing fn is already capable of producing some nice swing grooves. I’ve made this in Sonic Pi, no external quantizing : https://soundcloud.com/dagobertsondervan/swinglong1

2 Likes

Hey, I was looking through your code on the example ‘FM noise’ and was curious about what divisor means, but I wasn’t able to find it in any of the help section. Is there a shortcut for it, or how would I be able to find some of the meaning of the opt parameter in Sonic Pi. Thanks.

The fm synth is a great one to play around with as you can see from the fm noise example.
There is a little bit about the divisor and depth parameters in the details about the fm synth which you can find under the synths tab on the Help section tabs. click on fm in the list of synths and it will take you there.

divisor:
Modifies the frequency of the modulator oscillator relative to the carrier. Don’t worry too much about what this means - just try different numbers out!
Default: 2
May be changed whilst playing
Has slide options to shape changes

depth:
Modifies the depth of the carrier wave used to modify fundamental frequency. Don’t worry too much about what this means - just try different numbers out!
Default: 1
May be changed whilst playing
Has slide options to shape changes

As Sam suggests the best thing to do is to try them out. Initially leave depth: at the default value 1 and alter the divisor:
try

use_synth :fm
play :c4,divisor: 2,release: 4 #divisor: 2 is the default
sleep 4
play :c4,:divisor:1,release: 4
sleep 4
play :c4,:divisor:4,release: 4

This will give an idea of the effect of the divisor. Notive that the default effectively gives a note which sounds down an octave from :c4
Then you could try keeping the divisor fixed and altering the :depth
In a similar program try
divisor: 2,depth: 1
divisor :2,depth: 0
divisor :2 depth: 0.1
divisor:2, depth: 2
divisor :2,depth: 4
and experiment with othersl

The fm noise example also makes use of controlling the note and then altering the divisor with an accompanying divisor_slide parameter, which alters the divisor over time as the note plays.
You can see about this in section 7 of the Tutorial. Read up on how it works and how to use slide options.
You can have a lot of fun with them.

2 Likes