·

# InternalSounds

For the 3rd Prompt Of Mathober: Internal, Area will be represented Internal. An Area is the interior of a shape. InternalSounds takes the area & circumference/perimeter formulas for circles, squares and triangles and sonifies them into a SonicPi Composition.

## Poem

``````Shape and Sounds
Escape to be Loud
Loud to elevate
Their Voice
To be heard amongst the Noise
So it doesn’t evaporate
``````

## SonicPi Code

``````
#Sonifying the Area of A Circle, Square and Triangle

circumference = 2 * Math::PI * radius
area = Math::PI * (radius ** 2)

live_loop loop do
use_random_seed Math.cbrt(Time.now.to_i)
with_fx :ping_pong,mix: 0.75 do
with_fx :gverb, damp: 0.5 do
use_synth :piano
play [circumference,circumference/2], decay: rrand(1,4)
sample [:ambi_drone,:elec_beep,:perc_snap,:perc_swoosh].choose, beat_stretch: area / 80,amp: dice(2)
end
end
sleep [0.25,0.5,1,2,4,8].choose
end

end

def triangle(height,base,side1,side2,loop)

perimeter = base + side1 + side2
area = (height * base) /2

live_loop loop do
use_random_seed Time.now.to_i
with_fx :ixi_techno,mix: 0.75 do
with_fx :vowel, voice: dice(3) + 1 do
use_synth [:chipbass,:chipnoise].choose
play [perimeter/2,perimeter/3,perimeter].choose, sustain: dice(3)
sample [:loop_perc1,:elec_blip2,:tabla_ghe2,:elec_wood,:drum_bass_soft].choose, rate: area / 5 + 0.2
end
end
sleep [0.25,0.5,1,2,4,8].choose
end
end

def square1(side,loop)

perimeter = 4 * side
area = side ** 2

live_loop loop do
use_random_seed Time.now.to_i
with_fx :ixi_techno,mix: 0.75 do
with_fx [:ping_pong,:flanger].choose, mix: 0.65 do
sample [:guit_em9,:tabla_ghe2,:elec_pong,:drum_bass_hard].choose, rate: area / 100, attack: dice(5), amp: dice(2)
end
end
sleep [side,perimeter,side/3,Math.cbrt(perimeter)].choose
end

end

circles1(19,:cir1)
triangle(10,5,26,9,:tri1)
square1(13,:sq1)
circles1(22,:cir2)
triangle(14,33,10,9,:tri2)
square1(16,:square2)
``````