summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/client/index.js b/client/index.js
index 38f8410..35faf17 100644
--- a/client/index.js
+++ b/client/index.js
@@ -35,6 +35,12 @@ nx.onload = () => {
grid.resize(480, 640)
grid.draw()
+ nx.widgets.scale.choices = scales.names()
+ nx.widgets.scale.init()
+ nx.widgets.scale.on('*', e => scales.pick(e.value))
+ scales.onChange((s) => { buildLabels() })
+ buildLabels()
+
grid.on('*', e => ('level' in e) && buildLabels())
nx.widgets.shiftUp.on('*', e => e.press && shiftUp())
nx.widgets.shiftDown.on('*', e => e.press && shiftDown())
@@ -51,12 +57,6 @@ nx.onload = () => {
nx.colorize('#f4d142')
- scales.build()
- scales.onChange((s) => {
- buildLabels()
- })
- scales.pick(0)
-
loop.start()
Tone.Transport.bpm.value = 108
nx.widgets.tempo.min = 10
@@ -78,10 +78,12 @@ function buildLabels () {
let index = noteCount - i - 12
let n = mod(index, scaleCount)
let ns = (n+1)
+ /*
if (ns == 1) {
let octave = (index / scaleCount)
ns = ns + '<small>' + octave + '</small>'
}
+ */
if (subScale.includes(n)) {
str += '<b>' + (ns) + '</b><br>'
}