Nuclearbastard

Electrician (1984) title music for Sonic Pi

Feb 23rd, 2025
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.02 KB | Music | 0 0
  1. ##| Electrician title Screen
  2. ##| Composed by David Bunch
  3. ##| Arranged for Sonic Pi by Nuclear Bastard
  4. ##| Original work (c) 1984 by Synapse Software
  5.  
  6. use_bpm 180 # 180 for NTSC timing. Use 150 for PAL
  7.  
  8. # Define timing in fractions of BPM
  9. _w = 1.0/1  # whole note
  10. _h = 1.0/2  # half note
  11. _q = 1.0/4  # quarter note
  12. _e = 1.0/8  # eightth note
  13. _s = 1.0/16 # sixteenth note
  14. _t = 1.0/32 # thirty-second note
  15. use_synth_defaults sustain: 0, attack: 0, release: _h
  16.  
  17. use_synth :square
  18.  
  19. define :background_loop_3x do
  20.   play_pattern_timed [:B2, :E3, :Ds3, :E3], [_h, _h, _h, _h]
  21. end
  22.  
  23. define :background_loop_break1 do
  24.   play :D3, attack: 0, sustain: 0, release: _h
  25.   sleep _h
  26.   play :Cs3, attack: 0, sustain: 0, release: _h
  27.   sleep _h
  28.   play :B2, attack: 0, sustain: _h, release: _h
  29.   sleep _w
  30. end
  31.  
  32. define :background_loop_break2 do
  33.   play :Cs3, attack: 0, sustain: 0, release: _h
  34.   sleep _h
  35.   play :Ds3, attack: 0, sustain: 0, release: _h
  36.   sleep _h
  37.   play :E3, attack: 0, sustain: _h, release: _h
  38.   sleep _w
  39. end
  40.  
  41. define :background_loop do
  42.   3.times do
  43.     background_loop_3x
  44.   end
  45.   background_loop_break1
  46.   3.times do
  47.     background_loop_3x
  48.   end
  49.   background_loop_break2
  50. end
  51.  
  52. define :two_measure_rest do
  53.   sleep 8
  54. end
  55.  
  56. define :opening_horn do
  57.   play :F4, attack: 0, sustain: _q, release: 0
  58.   play :B4, attack: 0, sustain: _q, release: 0
  59.   sleep _h + _q
  60.   play :F4, attack: 0, sustain: _q, release: 0
  61.   play :B4, attack: 0, sustain: _q, release: 0
  62.   sleep _q
  63.   sleep _w * 3
  64. end
  65.  
  66. define :melody_fg do
  67.   play_pattern_timed [:E4, :B4, :Fs4, :B4, :Gs4, :B4, :A4, :B4],[_h, _h, _h, _h, _h, _h, _h, _h], sustain: 0, attack: 0, release: _h
  68.   play_pattern_timed [:Gs4, :B4, :Fs4, :B4, :E4, :B4, :Ds4, :B4],[_h, _h, _h, _h, _h, _h, _h, _h], sustain: 0, attack: 0, release: _h
  69.   play_pattern_timed [:E4, :B4, :Fs4, :B4, :Gs4, :B4, :A4, :B4],[_h, _h, _h, _h, _h, _h, _h, _h], sustain: 0, attack: 0, release: _h
  70.   play_pattern_timed [:Gs4, :B4, :Fs4, :B4, :Ds4, :B4],[_h, _h, _h, _h, _h, _h], sustain: 0, attack: 0, release: _h
  71.   play :E4, sustain: _h, attack: 0, release: _h
  72.   sleep _w
  73. end
  74.  
  75. define :melody_bg do
  76.   play :B3, sustain: _w, release: _h
  77.   sleep _w + _h
  78.   play :A3
  79.   sleep _h
  80.   play :Gs3, sustain: _w, release: _h
  81.   sleep _w + _h
  82.   play_pattern_timed [:Fs3,:E3,:Fs3,:Gs3],[_h,_h,_h,_h]
  83.   play_pattern_timed [:Fs3,:E3,:Fs3,:Ds3,:B2],[_h,_h,_h, _h, _h]
  84.  
  85.   play :B3, sustain: _w, release: _h
  86.   sleep _w + _h
  87.   play :A3
  88.   sleep _h
  89.   play :Gs3, sustain: _w, release: _h
  90.   sleep _w + _h
  91.   play_pattern_timed [:Fs3,:E3,:Fs3,:Gs3,:Fs3],[_h,_h,_h,_h, _h]
  92.   play_pattern_timed [:B2,:Cs3,:Ds3],[_q,_q,_q]
  93.   sleep _q
  94.   play :E3, sustain: _h, release: _h
  95.   sleep _w
  96. end
  97.  
  98. define :melody_mix do
  99.   in_thread do
  100.     melody_fg
  101.   end
  102.   in_thread do
  103.     melody_bg
  104.   end
  105. end
  106.  
  107. define :dark_bridge do
  108.   play_pattern_timed [:E3,:Fs3,:G3,:E3],[_h,_h,_h,_h]
  109.   play :B3, sustain: _h, release: _h
  110.   sleep _w
  111.  
  112.   play :A3
  113.   sleep _h
  114.   play :G3
  115.   sleep _h
  116.   play :A3, sustain: _h, release: _h
  117.   sleep _w
  118.  
  119.   play :G3
  120.   sleep _h
  121.   play :Fs3
  122.   sleep _h
  123.   play :G3, sustain: _q, release: 0
  124.   sleep _q
  125.   play :Fs3, sustain: _q, release: 0
  126.   sleep _q
  127.   play :E3, sustain: _q, release: _q
  128.   sleep _h
  129.   play :B2, sustain: _h, release: _h
  130.   sleep _w
  131.   #--------------------------
  132.   play_pattern_timed [:E3,:Fs3,:G3,:E3],[_h,_h,_h,_h]
  133.   play :B3, sustain: _h, release: _h
  134.   sleep _w
  135.  
  136.   play :A3
  137.   sleep _h
  138.   play :G3
  139.   sleep _h
  140.   play :A3, sustain: _h, release: _h
  141.   sleep _w
  142.  
  143.   play :G3
  144.   sleep _h
  145.   play :Fs3
  146.   sleep _h
  147.   play :E3, sustain: _w, release: _w
  148.   sleep _w * 2
  149. end
  150.  
  151. in_thread(name: :bg_loop) do
  152.   loop do
  153.     background_loop
  154.   end
  155. end
  156.  
  157. in_thread do
  158.   loop do
  159.     two_measure_rest
  160.     2.times do
  161.       opening_horn
  162.     end
  163.     melody_fg
  164.     2.times do
  165.       in_thread do
  166.         melody_fg
  167.       end
  168.       melody_bg
  169.     end
  170.     2.times do
  171.       dark_bridge
  172.     end
  173.     2.times do
  174.       in_thread do
  175.         melody_fg
  176.       end
  177.       melody_bg
  178.     end
  179.   end
  180. end
  181.  
Add Comment
Please, Sign In to add comment