Skip to content
Permalink
Browse files

slow to fast to ?????

  • Loading branch information
schollz committed Dec 17, 2020
1 parent cec1f8f commit c286ef1f20cf3b7860581ad065535e2141a2286d
Showing with 42 additions and 0 deletions.
  1. +41 −0 lib/parts.lua
  2. +1 −0 song.lua
@@ -4,6 +4,8 @@
local parts = {}

function parts.init()
parts.quarter_beat = 0
parts.sixteenth_beat = 0
-- parts.whatever_we_need = 0
end

@@ -26,6 +28,45 @@ function parts:quarter_notes(phase)
engine.amp(.5)
engine.hz(880)
end
self.quarter_beat = self.quarter_beat+1
local beat = self.quarter_beat
if beat>32 then
-- rest
elseif beat%31==0 then engine.hz(493.88/2)
elseif beat%29==0 then engine.hz(523.25/2)
elseif beat%27==0 then engine.hz(392.00/2)
elseif beat%25==0 then engine.hz(329.63/2)
elseif beat%23==0 then engine.hz(329.63/2)
elseif beat%21==0 then engine.hz(329.63/2)
elseif beat%17==0 then engine.hz(261.63/2)
elseif beat%15==0 then engine.hz(329.63/2)
elseif beat%11==0 then engine.hz(329.63/2)
elseif beat%9==0 then engine.hz(246.94/2)
elseif beat%7==0 then engine.hz(329.63/2)
elseif beat%5==0 then engine.hz(329.63/2)
elseif beat%1==0 then engine.hz(220.00/2)
end
end

function parts:sixteenth_notes(phase)
self.sixteenth_beat = self.sixteenth_beat+1
local beat = self.sixteenth_beat
if beat<64 then
-- nothing
elseif beat%31==0 then engine.hz(493.88)
elseif beat%29==0 then engine.hz(523.25)
elseif beat%27==0 then engine.hz(392.00)
elseif beat%25==0 then engine.hz(329.63)
elseif beat%23==0 then engine.hz(329.63)
elseif beat%21==0 then engine.hz(329.63)
elseif beat%17==0 then engine.hz(261.63)
elseif beat%15==0 then engine.hz(329.63)
elseif beat%11==0 then engine.hz(329.63)
elseif beat%9==0 then engine.hz(246.94)
elseif beat%7==0 then engine.hz(329.63)
elseif beat%5==0 then engine.hz(329.63)
elseif beat%1==0 then engine.hz(220.00)
end
end

function parts:dotted_half_notes(phase)
@@ -34,6 +34,7 @@ function init()
softclock.add('b', 1/4, function(phase) parts:quarter_notes(phase) end)
softclock.add('c', 3/4, function(phase) parts:dotted_half_notes(phase) end)
softclock.add('d', 11/17, function(phase) parts:crazy_part(phase) end)
softclock.add('e', 1/16, function(phase) parts:sixteenth_notes(phase) end)
super_metro:start()
redraw()
end

0 comments on commit c286ef1

Please sign in to comment.