summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js
index 5fb08fc..6879688 100644
--- a/client/index.js
+++ b/client/index.js
@@ -23,8 +23,6 @@ var loop = new Tone.Sequence(function(time, col){
}
}, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], "16n")
-nx.colorize('#f4d142')
-
nx.onload = () => {
grid = nx.widgets.grid
grid.sequenceMode = true
@@ -49,8 +47,26 @@ nx.onload = () => {
nx.widgets.flip.on('*', e => e.press && flip())
nx.widgets.flop.on('*', e => e.press && flop())
+ nx.colorize('#f4d142')
+
+ scales.build()
+ scales.onChange((s) => {
+ const labels = document.querySelector('#labels')
+ let str = ''
+ for (let i = 0; i < noteCount; i++) {
+ let n = i % s.scale.length
+ str += (n+1) + '<br>'
+ }
+ labels.innerHTML = str
+ })
+ scales.pick(0)
+
loop.start()
Tone.Transport.bpm.value = 108
+ nx.widgets.tempo.min = 10
+ nx.widgets.tempo.max = 1000
+ nx.widgets.tempo.set({ value: 108 })
+ nx.widgets.tempo.on('*', e => Tone.Transport.bpm.value = nx.widgets.tempo.val.value )
Tone.Transport.start()
}