I used Sonic pi to implement the tritone paradox in Sonic PI.
Tritone paradox
This is the paradox where 2 tones played at the same time and separated by half an octave seem to be ascending to some listeners and descending to others.
Some people question the seemingly infinite rise or descent.
Process
Like many things around us, we can translate this illusion by a process.
- A collection of notes keeps on rising in pitch
- When a given note reaches some (high) frequency, it goes down a multiple of 1 octave
Implementation
- We use a sinusoidal wave sound, it’s the purest in the frequency space.
- We instantiate six pitches spanning three octaves.
- We play them with a high sustain and decay.
- In a loop:
- increment the pitches by a small value (for the “sliding” effect )
- apply the pitches to notes
- cater for the edge cases (e.g. the pitches became too high)
- sleep for a short time
Thoughts
- additional sounds can be inputed.
- A cleaner code can be written.
- some variation of this effect can be used
Code
use_synth :sine
my three notes
s=36
tritone_s=42
j=48
tritone_j=54
i=60
tritone_i=66
sustain =100
start the notes
note1=play s, attack: 0.05, decay: 50, sustain: sustain
note2=play j, attack: 0.05, decay: 50, sustain: sustain
note3=play i, attack: 0.05, decay: 50, sustain: sustain
play tritones
tritone_1 =play tritone_s, attack: 0.05, decay: 50, sustain: sustain
tritone_2 =play tritone_j, attack: 0.05, decay: 50, sustain: sustain
tritone_3 =play tritone_i, attack: 0.05, decay: 50, sustain: sustain
sleep time
m=0.225
increment
increment=0.125
live_loop :shift do
### we calculate by how much the given note is shifted
s+=increment
tritone_s+=increment
j+=increment
tritone_j+=increment
i+=increment
tritone_i+=increment
### we a pply te shift
control note1, note: s
control tritone_1, note: tritone_s
control note2, note: j
control tritone_2, note: tritone_j
control note3, note: i
control tritone_3, note: tritone_i
## never forget to sleep
sleep m
### we set boundaries
if s>72
s=24
end
if j>72
j=24
end
if i> 72
i=24
end
if tritone_s> 78
tritone_s=30
end
if tritone_j> 78
tritone_j=30
end
if tritone_i> 78
tritone_i=30
end
end