Vivaldi La Follia

This piece consists of a series of variations on the early European La Folia theme. It starts sedately, but becomes more complex and lively as it progresses through 20 variations.
There is an interesting article in Wikipedia which discusses the theme, which was utilised by over 150 different composers including Vivaldi, Corelli, CPE Bach and even in passing by Beethoven.
The piece lends itself well to Sonic Pi utilising the :tri and :pulse synths for the three parts in this version.

code available at:


Very nice! A SPI master piece on how to form voices using synth parameters and effects. (And, of course, a mster piece of European music as well)

Great work! I’ve never noticed how similar :tri sounds to a recorder.

Yes its not a bad match. I chop and choose between that and :sine but I think that sometimes sounds a bit muffled, and :tri has a greater clarity. For the lower part I experimented with :blade and ;saw (or even ;fm with the notes up an octave), but in this case :pule sounded right. A bit clarinet like. EDIT I would love a greater range of onboard synths for SP for orchestral instruments eg trumpet, oboe rather than switching to midi driven synths, although I have used sample based sounds directly based on the Sonatina Syyphonic Orchestra.

Interesting observations, leading me to look for some chalumeau performances. I’m not sure about reproducing orchestral instruments, mainly because not even hundreds of dollars can get a convincing sound. (I wasted hundreds on an unusable library.)

I think it’d be awesome to develop a signature set of sounds unique to Sonic Pi.

out of interest, how long did it take you to make this?

It took a couple of hours. I started with a midi file from This had about 12 parts, using different recorders (tenor bass etc). I copy and pasted this down to 3, then I had to put dummy notes (used a high note not in the part) into all the complete bar rests, as my conversion script cant handle say a section of 6 bars of rests. I also adjusted tempo changes to get suitable rit at the end. (For SP you need each part to change tempo at the same time, unlike in midi). I then separated the individual parts and saved them as musicxml, and used a processing script to convert them to SP format. I then copied the converted parts to a text editor (I used visual studio code) replaced the high notes with rest symbols, added synth and fx info, and played with sustain release settings to get final code.
It sounds long winded but its not too bad, and a huge amount quicker than entering the notes and durations manually.

I did it with 12 parts to start with which lengthened the time taken. Then I thought as 10 of the parts don’t overlap I could combine them. This reduced the number of dummy notes that had to be added, and made the whole process a lot quicker.

1 Like

that’s crazy. Ive been working on my SP project for school, and I’ve spent about 4-5 hours on it so far and gotten barely anywhere.