aboutsummaryrefslogtreecommitdiff
path: root/intervals.lua
diff options
context:
space:
mode:
Diffstat (limited to 'intervals.lua')
-rw-r--r--intervals.lua25
1 files changed, 15 insertions, 10 deletions
diff --git a/intervals.lua b/intervals.lua
index 04141b0..807d970 100644
--- a/intervals.lua
+++ b/intervals.lua
@@ -3,15 +3,15 @@
-- hear two notes;
-- play two notes
--
--- enc2: repeat
--- enc3: skip
+-- key2: repeat
+-- key3: skip
--
-- to do:
--- 1) keep a score
--- 2) select scales
--- 3) select base tone
--- 4) key signatures
--- 5) play from input
+-- 1) select base tone and a range
+-- 2) key signatures
+-- 3) listen to input (tuner-style)
+-- 4) keep a score
+-- 5) spaced repetition?
local ControlSpec = require "controlspec"
local MusicUtil = require "musicutil"
@@ -491,7 +491,6 @@ function play(note, vel)
end
function init()
- -- TODO save
params:add({
type = "option",
id = "output",
@@ -571,14 +570,16 @@ function init()
action = function(value)
intervals_state.midi_out = midi.connect(value)
end})
- params:bang()
+ params:default()
play(60)
end
function cleanup()
- intervals_state.timer:stop()
+ if intervals_state.timer then
+ intervals_state.timer:stop()
+ end
end
function redraw()
@@ -592,3 +593,7 @@ end
function key(n, x)
state_call(intervals_state, "key", {n, x})
end
+
+-- Local Variables:
+-- compile-command: "make upload"
+-- End: