Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Everyone a Rockstar: Using Mobile Technology in...

Everyone a Rockstar: Using Mobile Technology in Live Musical Performance

Slides from our RejectJS 2015 talk (http://rejectjs.org/speakers/#JocelynHo_PianoKirbySaysHi)

Presenters: Jocelyn Ho and Drew Petersen

Code is here: https://github.com/kirbysayshi/synae-server
Eventually a recording will be made available!

Andrew Petersen

September 24, 2015
Tweet

More Decks by Andrew Petersen

Other Decks in Technology

Transcript

  1. Jocelyn Ho @JocelynHo_Piano Young Steinway Artist Adjunct professor at Adelphi

    University. Drew Petersen @KirbySaysHi JS Engineer at Spotify
  2. SYNAESTHESIA PLAYGROUND A collaborative project (a “playground”) for composers, visual

    artist, and software developer to explore music and the senses.
  3. SYNAESTHESIA PLAYGROUND A collaborative project (a “playground”) for composers, visual

    artist, and software developer to explore music and the senses.
  4. Rhizome https://github.com/sebpiq/rhizome A messaging server, with automatic support for: Websocket

    Clients OSC Clients Connection Management pub/sub serving static files (optional)
  5. Typical Realtime Server App Server (has state & logic) Client

    Yo, what's going on? Here's your /world-state Here's stuff you missed because I know everything
  6. Distributed Messaging Server App Server (has last message state) Client

    SuperClient (has state & logic) Keep me informed about /world-events OK! Hey tell every body about the new /world-events! New /world-events for ya!
  7. Distributed Messaging Server App Server Client Conductor (has state &

    logic) Client Client Client Performer Windows Laptop Kinect
  8. Distributed Messaging Server App Server Client Conductor (has state &

    logic) Client Client Client Performer Windows Laptop Kinect
  9. Distributed Messaging Server App Server Client Conductor (has state &

    logic) Client Client Client Performer Windows Laptop Kinect
  10. Distributed Messaging Server App Server Client Conductor (has state &

    logic) Client Client Client Performer Windows Laptop Kinect
  11. Distributed Messaging Server App Server Client Conductor (has state &

    logic) Client Client Client Performer Windows Laptop Kinect
  12. React must always be mentioned during a JS talk, even

    in passing. Valid answers also include: one-way state, virtual DOM, etc.
  13. React JS No, seriously the one-way data flow worked really

    well. World state flows from the conductor client… …to each audience client …which statelessly render. Each client is simply a terminal that knows its potential.
  14. Also Browserify + Babelify ES7 property initializers are super cool

    http://babeljs.io/blog/2015/06/07/react-on-es6-plus/
  15. 50.

  16. Be your own DNS https://github.com/tjfontaine/node-dns https://github.com/kirbysayshi/synae- server/blob/master/bin/dns Audience typed: http://playground.go

    var onMessage = function (request, response) { response.answer.push(dns.A({ name: request.question[0].name, address: RHIZOME_HOST, ttl: 600, })); response.send(); };
  17. –The Windows Start Pane Button Thing “Do you want to

    program your own body, appendage, and finger tracking?”
  18. –The Windows Start Pane Button Thing “Do you think you

    can do what others have spent entire PhD programs working towards in two weeks?”
  19. You win, Windows. I'll use the SDK. (Actually he did

    —->) @TheOperatore https://github.com/theoperatore https://github.com/wouterverweirder/kinect2
  20. You win, Windows. I'll use the SDK. (Actually he did

    —->) @TheOperatore https://github.com/theoperatore https://github.com/wouterverweirder/kinect2
  21. Truly, they are not. And we all wondered why there

    aren't many fun gesture-based games… Dynamic Time Warping Hidden Markov Machines Support Vector Machines Signal Processing
  22. DTW Sliding window of N accelerometer events. Given a pattern,

    match the stream against that pattern regardless of time stretching. devicemotion((e) => { let { motions } = this; motions.unshift(e); if (motions.length > 32) motions.pop(); let xs = motions.map(e => e.acceleration.x); let ys = motions.map(e => e.acceleration.y); let zs = motions.map(e => e.acceleration.z); let slashDTWX = new DTW(); let slashDTWY = new DTW(); let slashDTWZ = new DTW(); let slashCostX = slashDTWX.compute(xs, [-0.2486258743215352,-0.2486258743215352, ...]); let slashCostY = slashDTWY.compute(ys, [-0.35158794388510284,-0.35158794388510284, ...]); let slashCostZ = slashDTWZ.compute(zs, [0.14063087035836652,0.14063087035836652, ...]); let stillDTWX = new DTW(); let stillDTWY = new DTW(); let stillDTWZ = new DTW(); let stillCostX = stillDTWX.compute(xs, [0, 0, 0, 0]); let stillCostY = stillDTWY.compute(ys, [0, 0, 0, 0]); let stillCostZ = stillDTWZ.compute(zs, [0, 0, 0, 0]); let slashCost = slashCostX + slashCostY + slashCostZ; let stillCost = stillCostX + stillCostY + slashCostZ; if (slashCost < stillCost) { dbg('dm cost: slash', slashCost); dbg('dm cost: still', stillCost); this.triggerSound(); motions.length = 0; } });
  23. DTW Images From: FastDTW: Toward Accurate Dynamic Time Warping in

    Linear Time and Space Stan Salvador and Philip Chan
  24. But I used it completely wrong Scores needed to be

    normalized. It works by lucky math.
  25. Generic Force Thresholds Sliding window of N accelerometer events Super

    gross. But it worked given the short time to implement. devicemotion((e) => { let { motions } = this; e.timestamp = Date.now(); motions.unshift(e); if (motions.length > 32) { motions.pop(); } let average = motions.reduce((sum, motion) => sum + motion.acceleration.y, 0) / motions.length; if (average > 1.8) { this.triggerSound(); this.motions.length = 0; } })
  26. Simplify the Gestures Tug and Pull between tech reality (especially

    given time) and intention of the composer A slow raise of the arm is really hard to detect. What about a sharp reach instead?