|
|
@@ -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) |
|
|
|