Is there a difference between synths and instruments in Pi? ...looking for woodwinds?

Still very much a n00b… I’ve gone through a fair amount of the tutorial and viewed some examples but I’m missing some knowledge so I hope it is okay to just ask. I tend to learn best by defining an objective on my own and then learning what I need to achieve that objective… as opposed to just memorizing a manual from front to back.

So, the task I’ve given myself is mimicking Pavane in clarinet Duo. I’ve found the sheet music for the work, and even a MIDI file that performs the work in clarinet Duo which plays well on Mac Garage Band, and I’ve also found a tone.js site that converts the MIDI to JSON and then plays it using tone.js. All great.

So now I’d like to do something similar in Sonic Pi – it is fine if I have to hand code the notes with play to achieve the appropriate note, duration, and amp (velocity), but how do I achieve a clarinet sounding instrument with Pi? I poked around in the source that I downloaded and I do see that there is a wavetables directory and it contains defs for some woodwinds (clarinet, flute) – but I’m not sure how to use those in the Sonic Pi paradigm?

I do see that there are synths (synth_names) defined for piano and pluck, but I don’t see anything for woodwind – am I missing something?

HI !

the instruments available into sonic pi are these you see in the select list when you type use_synth

If you want to get more natural instruments, you have to use midi to send the note to another software called Digital Audio Workstation (DAW) as Ableton Live, GarageBand or Qsynth with soundfonts.

@robin.newman has just made a video in which you can see the use of Qsynth to get some other instruments.

1 Like

Thanks for the reply, that certainly looks like one way to achieve what I’m interested in doing…

But I’m curious if there is a way to do it without leaving the Sonic Pi paradigm? As far as I know, Sonic Pi is a Ruby wrapper around supercollider – is supercollider less capable than those other systems you named? …and since the Sonic Pi install has wavetables for flute & clarinet (and many more instruments) I suspect there was some intent to make those work natively in Sonic Pi? …perhaps unfinished work on the roadmap?

There aren’t directly wind instrument synths in Sonic Pi, although Sine Wave and Tri can be useful.
What I usually do is to produce sample based synths. This article I wrote some time ago illustrates this using the Sonatina symphonic Orchestra. which has a link to the program in it. Note the original download link for the SSO is dead, but you can still get it via

You can achieve pretty good results specially for a wind instrument by choosing a sample of single long sounding note, and then playing it back at different rates to get a range of notes.
There are wave table samples in Sonic PI, but to date they have not been exploited. Also, although Supercollider is powerful, you need to program different synth samples which is not easy, and these then need to be compiled external to Sonic Pi. One ore two users have tried this, but it is not all that easy to do.


Here’s a simple example. Play with the asr parameters to alter the sound. also maybe select delayed start using opt for sample

#simple flute sample based "synth"
#download SSO from
flute="/Users/rbn/Desktop/Sonatina Symphonic Orchestra/Samples/Flute/flute-c5.wav"
define :plflute do |n,dur|
  sample flute,rpitch: n-note(:c5),attack: 0.1*dur,sustain: 0.8*dur,release: 0.1*dur
  sleep dur
live_loop :test do
  plflute rrand_i(:c4,:c5),0.2
  sleep 0.2
1 Like

Interesting, thanks Robin. I downloaded that SSO and played with your code, swapping a clarinet for the flute and adding a parameter so that I could randomly adjust AMP for the different random notes.

Still much to learn about the world of synth music.

Hey @gl3nn206,
The wavetable files you see in the Sonic Pi file structure (such as yes, those forming a clarinet sound etc) are definitely going to be usable, one day.

The trick is that in order to make them available through Sonic Pi this requires a slightly involved update to the Sonic Pi source code.

I made a start on this in the past, and theoretically it was fairly close, though with the recent amount of changes in the codebase, it may well need a little more work.

There’s a bunch of similar new features we/I’d love to get through - it’s definitely just a matter of time at the moment :sweat_smile: hopefully they’ll start appearing in the not-too-distant future :slightly_smiling_face:


Eli asked me to post this Calling all brainy types which he published some time ago. A nice clarinet synth.


Very interesting, thank you.

I slogged through writing some Ruby to parse out a JSON file of Pavane notes and translating into a series of function calls to play all of the notes with the appropriate note, duration, amp, and timing… that part is done but it took me a while because I realized that print %f %f %f works in Ruby but not always in the SP “log” interface which helps me understand that not all Ruby code works in SP.

The timing is the hardest part now – I need to think about where to put the “rests” implied in the series of notes because it isn’t just the duration – there is an additional rest timing between some notes…