# 240531 2209 krush and bitcrusher on saw with big reverb
# Saved 240531 2209
# https://in-thread.sonic-pi.net/t/krush-and-bitcrusher-on-saw-with-big-reverb/8907
set_volume! 4
with_fx :reverb, room: 0.9 do
c = 90
with_fx :bitcrusher do |bitc|
with_fx :krush do |krush|
live_loop :a1 do
tick
puts c = [70,70,70,70,130].look
control bitc, cutoff: c
control krush, cutoff: c, mix: [0,0,0,1,0,1].look
sample :bd_haus,cutoff: 70, pan: 0.25, amp: 3 if spread([1,1,5].choose,12).look
sample :bd_haus,cutoff: 110,pan: -0.25 if spread([2,5].choose,7).look
use_synth :saw
use_synth_defaults cutoff: [70,70,70,90,110].choose, release: [0.1,0.2,0.3, 0.5].choose
b = 16
play :c5+knit(0,b*3,-2,b).look, cutoff: 60, amp: 0.7
play :c2+knit(0,b*3,-2,b).look
use_synth_defaults cutoff: [70,70,70,90,110].choose-20, release: [0.1,0.2,0.3].choose, amp: 0.8
a = 16
play :c4+knit(0,a,2,a,3,a,7,a+a).look
sleep 0.25
end
end
end
end
hello @Relaxnow excellent track! I have a question: what does precisely 20 here:
use_synth_defaults cutoff: [70,70,70,90,110].choose-20
is it 20 times in the list?
Thanks for sharing!
Hi @beryann
Thank you.
[70,70,70,90,110].choose-20
Is the same as
[50,50,50,70,90].choose
-20 is just a fast way to adjust the cutoff value.
Tryout -30, -20, -10,+0,+10,+20
[edit: oops, thereâs the answer ]
itâs a global offset for the values inside the array
8.times do
x = [1,2,3,4,5].choose-100
sleep 0.5
puts x
end
PD-Pi
thanks to you two @Relaxnow @brendanmac okay, understoodâŚi see it as a good trick in a live coding situation to change the values of the array quickly, is it correct?
Yes, correct. Itâs a live coding shorthand, allowing the performer to shift a control range by only typing one number, instead of re-typing the boundaries of a range. Live coding is a such a great challenge for musicians and coders. If I find myself re-typing many numbers in a control range, I think âis there a better/quicker way to do thisâ. Because less code = better efficiency, and arguably better transparency.
Iâm learning so much from yâall. And enjoying the music!
Thanks!
I agree totally with you Brendan @brendanmac Thatâs why I am also âstudyingâ the Ziffers mini-notation which can be very useful for live coding.
Apart from this, there must still be a lot of shortcuts/shorthands to be discovered in Sonic Pi, they would almost have to be exhaustively listed to share and study them. Itâs a simple project idea that I am sharing with youâŚ
Cheers!
I think we all learn and develop our own âstyleâ of coding shorthand, thereâs no wrong or right way - the code either works or it doesnât Compare how Sam, Robin, DJDave and Relaxnow write their Sonic Pi code, quite different. I quickly learned to stop my âskills envyâ, and focus on writing what works for me.
And by shortcuts, do you mean keystrokes :
PD-Pi
You are right :
the code either works or it doesnât
And yes I mean keystrokes! excuse me! I try to integrate them little by little in my code.
And thanks to the community here! I regularly discover ideas that are used in my compositions in Sonic Pi
Best Regards