# Pachabel's Canon and Gigue on Sonic Pi

**URL:** <https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894>\
**Category:** Performances, Streams & Live Coding\
**Created:** [March 22, 2018, 11:29am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894 "2018-03-22T11:29:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [March 22, 2018, 11:29am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/1 "2018-03-22T11:29:29Z")

</div>

Been bedding in my new Pi3 B+ and built Sonic Pi 3.1 on it (with some tweaks to allow for older SuperCollider). Tried it out with several pieces, including this rendition of Pachabel’s Canon and Gigue which I created this morning. I tried using fx :normaliser to smooth out the parts (played with the :blade synth) and quite like the end effect. You can download the code (which should be played using a run\_file command) from

> <https://gist.github.com/rbnpi/4d82895022cc6ef006cd84cfdde8c880>

and listen to it on SoundCloud, although they put extra compression on the file.

https://w.soundcloud.com/player/?visual=false&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F417512898&show_artwork=true&maxheight=166

---

<div class="post-metadata">

**Author:** ![detbrau](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@detbrau](https://in-thread.sonic-pi.net/u/detbrau)\
**Post date:** [November 15, 2018, 3:53pm UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/2 "2018-11-15T15:53:11Z")

</div>

Super  
What a shame, too long for my Raspi

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [November 15, 2018, 5:02pm UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/3 "2018-11-15T17:02:26Z")

</div>

Have you tried saving the file and then using run\_file “/path/to/filename” to execute it? That should work. (To get the file open the pink link in a browser to go to the gist site, select raw text and then save it as a text file).

---

<div class="post-metadata">

**Author:** ![detbrau](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@detbrau](https://in-thread.sonic-pi.net/u/detbrau)\
**Post date:** [November 16, 2018, 9:06am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/4 "2018-11-16T09:06:31Z")

</div>

Thank you. Now I have listened to the whole piece.  
What does this construction mean:  
with\_fx :reverb, room: 0.8, mix: 0.7 do  
with\_fx :level, amp: 1.5 do  
with\_fx :level, amp: 0.6 do  
…  
end # level  
with\_fx :level, amp: 0.4 do  
…  
end # level  
end # outer level  
end

---

<div class="post-metadata">

**Author:** ![Bubo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/bubo/32/786_2.png) [@Bubo](https://in-thread.sonic-pi.net/u/Bubo)\
**Post date:** [November 16, 2018, 7:38pm UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/5 "2018-11-16T19:38:48Z")

</div>

This construction is just declaring a few effects to be used between the `with_fx :reverb do` and the `end` that follows. Read the section 6 of the built-in tutorial.

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [November 16, 2018, 8:55pm UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/6 "2018-11-16T20:55:20Z")

</div>

Yes Bubo is correct. I have one overriding fx\_level which applies to everything, but in that I wanted to control the relative levels of two different groups of playing synths. One of these had a level amp: setting of 1.5, the other 0.6 This was to balance the audio outputs of the different synths playing. Around everything I then put an fx reverb wrapper, which applied to ALL the contents. I have used this technique quite a bit when trying to balance up the outputs of a range of notes playing with different synths.  
You can put individual amp: settings for each synth, but I find it more convenient to alter levels for different grouped parts together using the fx\_level command.  
You can also save a reference to the fx\_level command and control it which is a nice way to get fades etc.

---

<div class="post-metadata">

**Author:** ![detbrau](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@detbrau](https://in-thread.sonic-pi.net/u/detbrau)\
**Post date:** [November 18, 2018, 8:41am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/7 "2018-11-18T08:41:19Z")

</div>

Thanks for your help.  
But I made a mistake:  
The construction belongs to the piece of music “SchubertSerenade-RF.rb”  
For the inner level, the thing is clear, one synth 0.4 and the other 0.6.  
But maybe you can use the normal volume control on Raspi instead of the outer level (1.5)

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [November 18, 2018, 8:50am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/8 "2018-11-18T08:50:16Z")

</div>

Yes you could, but I prefer to set a suitable listening level for the user without them having recourse to altering the level for each specific piece they play ( if you play several one after the other for example).

---

<div class="post-metadata">

**Author:** ![detbrau](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@detbrau](https://in-thread.sonic-pi.net/u/detbrau)\
**Post date:** [November 18, 2018, 8:53am UTC](https://in-thread.sonic-pi.net/t/pachabels-canon-and-gigue-on-sonic-pi/894/9 "2018-11-18T08:53:31Z")

</div>

All right and thank you for the quick response  
Detlef
