Generic Bulk Data Interface
- Send Frame Header
- Send Frame Buffer
GOTO 10
The Frame Buffer
- 16 Bit per Pixel [bbbbbggggggrrrrr]
- (little endian)
- XOR with 0xFFE7F3E7 (signal shaping)
NEED PIXELS
Canvas, my old friend
data = ctx.getImageData(0,0,960,160).data
r = data[pixel * 4 + 0]
g = data[pixel * 4 + 1]
b = data[pixel * 4 + 2]
The Magic (and danger) of Electron
const { initPush, sendFrame } = require('ableton-push-canvas-display')
initPush()
// DRAW STUFF
sendFrame(ctx)
Building a sequencer in JavaScript
Challenges
- Timing (-Stability)
- Latency
Solutions
- Use WebMIDI scheduling
- Uses performance timers
- Use Workers for scheduling the scheduling
- Prevents throttling on blur
- Generally is more stable
WHY?
Because I can
Because learning
It's my Instrument
This actually makes a difference!
Also, {live:js}
One good thing about Music, when it hits, you feel no pain!