- Make a beep.
- Goal:
- Code: Make a beep with code. Progress to making a sequence of beeps.
- Understand note names
Your First Beeps
- Goal:
- Make a sequence of beeps
- Refactor beeps sequence with a loop
- Randomisation & sleep
3.times do
play 60 + rand(10)
sleep 0.5
end
- If else with rand().
Toss a virtual musical coin
if rand(1) < 0.5
# if heads, play two ascending notes
play 60
sleep 0.5
play 62
else
# if tails, play three descending notes
play 72
sleep 0.25
play 71
sleep 0.25
play 70
end
- What are comments in code?
- Errors and debugging
- Try removing spaces / indents
- Remove
end
from a loop - Remove
end
from an if-else block
- Discovering new sounds
- Synths: Switching Synths
- Drums
- Bass
- Make a simple melody with all these ideas