Dopshop background music beat

use_bpm 100 # Setting the tempo (100 BPM)
use_synth :fm # Synth sound for a modern vibe

Bassline

live_loop :bass do
use_synth :tb303
play :c2, release: 0.5, cutoff: 80
sleep 0.5
play :c2, release: 0.5, cutoff: 90
sleep 0.5
play :c2, release: 0.5, cutoff: 100
sleep 0.5
play :e2, release: 0.5, cutoff: 110
sleep 0.5
end

Kick Drum

live_loop :kick do
sample :bd_haus, amp: 2 # Heavy kick sound
sleep 1
end

Snare/Clap

live_loop :snare do
sleep 0.5
sample :perc_snap, amp: 1.5, rate: 1 # Snare or clap effect
sleep 0.5
end

Hi-hats

live_loop :hihat do
sleep 0.25
sample :drum_cymbal_closed, amp: 0.7, rate: 1.5 # Hi-hat sound
sleep 0.25
end

Melody/Lead

live_loop :melody do
use_synth :prophet
play :g4, release: 0.3, cutoff: 100, amp: 1.2
sleep 0.5
play :a4, release: 0.3, cutoff: 110, amp: 1.2
sleep 0.5
play :e4, release: 0.3, cutoff: 120, amp: 1.2
sleep 1
end

2 Likes

Hi @Vecnirp
This is fun! I like the filter sweeps (who doesn’t?!?).

I couldn’t resist trimming the code down - this does the same thing but uses some functions and methods you might like to look at, in the Tutorial and Language help files :wink:

Paste your code into the body of a message using the </> formatting link above

use_bpm 100 # Setting the tempo (100 BPM)
use_synth :fm # Synth sound for a modern vibe

live_loop :bass do
  tick
  use_synth :tb303
  use_synth_defaults cutoff: [70,80,100,120].look
  play knit(:c2,3, :e2,1).look, release: 0.5
  sleep 0.5
end


live_loop :snare do
  sample :bd_haus, amp: 2
  sleep 0.5
  sample :perc_snap, amp: 1.5, rate: 1 # Snare or clap effect
  sleep 0.5
end

#Hi-hats
live_loop :hihat do
  sleep 0.25
  sample :drum_cymbal_closed, amp: 3 # Hi-hat sound
  sleep 0.25
end

#Melody/Lead
live_loop :melody do
  tick
  use_synth :prophet
  play_pattern_timed [:g4,:a4,:e4], [0.5,0.5,1], release: 0.5, cutoff: [80,100,120].look
end

PD-Pi

2 Likes

Very fun!
Welcome! Sonic Pi is a ton of fun, and this is a great supportive community.