Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Last active July 14, 2023 16:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinewalker/b7019b2e8ecb4b1a0de79f8c9a7d4b28 to your computer and use it in GitHub Desktop.
Save sinewalker/b7019b2e8ecb4b1a0de79f8c9a7d4b28 to your computer and use it in GitHub Desktop.
Boulder Dash Theme
# Boulder Dash for ATARI 2600, by Peter Liepa, 1984
# A Live Loop to algorave to.
#
# Original music (Youtube, Commodore 64 version): https://www.youtube.com/watch?v=14CAO72_pJw
# A pretty accurate transcription: https://musescore.com/user/3769276/scores/1076731 (I can't hear any errors)
#
# Interesting note: Boulder Dash was originally written for the ATARI 2600 video game console, which had a TIA sound chip
# with two oscillators to generate tones (max polyphony was 2). So on both the Youtube recording (which is of a C64 port)
# and the MIDI score transcription, only two notes are ever played at once.
#
# More on Boulder Dash: https://en.wikipedia.org/wiki/Boulder_Dash
# 8 bars, 16 semiquavers per bar, two-tone polyphony, consequently no actual rests, but the bass and treble parts bounce
# between the two occilators. 128 x 2 notes. Repeats forever.
aud0 = [ :F3, :A3, :C4, :F4, :G3, :Bb3, :C4, :G4, :Db4, :Eb4, :F4, :Ab4, :Eb4, :D5, :E4, :C5]
aud0.concat [ :F3, :F4, :C3, :G3, :Eb3, :G4, :G3, :Eb3, :F3, :F4, :C3, :G3, :Db3, :F5, :F3, :Db3]
aud0.concat [:Eb3, :Eb4, :Bb3, :F3, :B3, :Eb5, :Eb4, :B3, :C2, :E4, :C2, :F4, :Bb3, :Bb3, :Bb4, :Bb3]
aud0.concat [ :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4, :F4]
aud0.concat [ :F4, :A4, :F4, :Bb4, :F4, :A4, :F4, :Bb4, :F4, :A4, :F4, :Bb4, :Eb4, :G4, :Eb4, :Ab4]
aud0.concat [ :F4, :F5, :F4, :Eb5, :F4, :D5, :F4, :C5, :Eb4, :Eb5, :Eb4, :Eb5, :Eb4, :Bb4, :Eb4, :Eb5]
aud0.concat [ :F4, :A4, :F4, :Bb4, :F4, :A4, :F4, :Bb4, :F4, :A4, :F4, :Bb4, :Eb4, :G4, :Eb4, :Ab4]
aud0.concat [ :A4, :F4, :C4, :A3, :G4, :Eb4, :Bb3, :Eb3, :C5, :A4, :F4, :C4, :G4, :Eb4, :Bb3, :Eb3]
aud0=aud0.ring
aud1 = [ :F2, :C3, :F3, :Ab3, :Eb2, :D3, :Eb3, :Bb3, :Db2, :Db2, :Db3, :Db2, :Eb3, :Bb4, :E3, :A4]
aud1.concat [ :F2, :F2, :F2, :F2, :Eb2, :Eb2, :Eb2, :Eb2, :F2, :F2, :F2, :F2, :Db3, :Db3, :Db3, :Db3]
aud1.concat [:Eb2, :Eb2, :Eb2, :Eb2, :B2, :B2, :B2, :B2, :C2, :C3, :C2, :C3, :Bb2, :Bb2, :F2, :F2]
aud1.concat [ :F2, :F2, :F2, :F2, :F3, :F3, :F2, :F2, :Eb2, :Eb2, :Eb2, :Eb2, :Eb3, :Eb3, :Eb2, :Eb2]
aud1.concat [ :F2, :F4, :F2, :F4, :F3, :F4, :F2, :F4, :Eb2, :F4, :Eb2, :F4, :Eb3, :Eb4, :Eb2, :Eb4]
aud1.concat [ :F2, :F2, :F2, :C5, :F3, :F3, :F2, :C5, :Eb2, :Eb2, :Eb2, :Eb2, :Eb3, :Eb3, :Eb2, :Eb2]
aud1.concat [ :F2, :F4, :F2, :F4, :F3, :F4, :F2, :F4, :Eb2, :F4, :Eb2, :F4, :Eb3, :Eb4, :Eb2, :Eb4]
aud1.concat [ :F4, :C4, :A3, :F3, :Eb4, :Bb3, :G3, :Eb2, :A4, :F4, :C4, :A3, :Bb3, :G3, :Eb3, :Eb2]
aud1=aud1.ring
####
use_transpose 0
use_synth :tri
use_synth_defaults attack: 0, decay: 0, sustain: 0.25, release: 0.2
use_bpm 93
set :position, tick_reset
dur=0.25
phz=4
live_loop :metro do
sleep dur
set :position, tick
end
live_loop :au0 do
use_synth :tri
##| with_fx :ixi_techno, phase: phz, res: 0.95, cutoff_max: 129, cutoff_min: 50 do #, delay: 8, feedback: 5
##| steps=phz/dur
##| steps.times do
play aud0[sync :position], pan: -0.5
##| end
##| end
end
live_loop :au1 do
use_synth :subpulse
##| with_fx :bitcrusher do
play aud1[sync :position], pan: 0.5#, sustain: 0.0125#, sustain: 0.0125, pan: 1, amp: 2
##| end
end
@sinewalker
Copy link
Author

Debugging tip

When debugging code like this that is based upon a ring or array of notes/patterns, you can increment the starting point so that you don't have to listen through the parts you've already heard and corrected.

In this case, the :metro loop is ticking along and setting the :position which is then synced and used by the other loops to keep together and in time along their respective note rings. To start further into the music, simply add the number of ticks(positions) you want to start after. E.g. to start after the 64th note, do like so:

live_loop :metro do
  sleep dur
  set :position, tick + 64
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment