37
LIVE PERFORMANCE EFFECTS Tom Chen a.k.a 湯姆 / yychen [email protected]

Live Performance Effects

Embed Size (px)

DESCRIPTION

Live Performance Effects, short talk @ Taipei.py August 1st, 2014. Using python tornado websockets, pygame.midi and front end technologies.

Citation preview

Page 1: Live Performance Effects

LIVE PERFORMANCE EFFECTSTom Chen a.k.a 湯姆 / yychen

[email protected]

Page 2: Live Performance Effects

WHO AM I?

Page 3: Live Performance Effects

• Full Stack Engineer • Piano / Vocal •有點腦殘

Page 4: Live Performance Effects

其實事情是這樣的...

Page 5: Live Performance Effects
Page 6: Live Performance Effects
Page 7: Live Performance Effects

Full Stack + Music = !!!!!!

Page 8: Live Performance Effects

Back End Programming / PythonFront End Technologies (javascript, CSS, HTML…)

Piano Playing

Page 9: Live Performance Effects
Page 10: Live Performance Effects

其實...

Page 11: Live Performance Effects

也可以找⼈人⽤用⼈人⼯工控制啦 XD

Page 12: Live Performance Effects

但這樣就不屌了

Page 13: Live Performance Effects

當然

Page 14: Live Performance Effects

可以⽤用偵測的⽅方式做同步化也很棒!!

Page 15: Live Performance Effects

BUT HOW?

Page 16: Live Performance Effects

#1 偵測

Page 17: Live Performance Effects

透過 MIDI, 接到數位訊號

Page 18: Live Performance Effects

偵測特定和弦 / ⾳音D#3, A4

G3, C5, D5, G5

D#3, G4, C5, D5

Page 19: Live Performance Effects
Page 20: Live Performance Effects

偵測拍⼦子根據每個⼩小節都只會出現的⾳音,

⽤用 timedelta 算出⼀一個⼩小節有多少 milliseconds

Page 21: Live Performance Effects

偵測結束紀錄最後⼀一次 MIDI signal 的 timestamp,

並在 while loop 偵測每次 timeout 沒有回應的時間是否過⻑⾧長

Page 22: Live Performance Effects

每⼀一⾸首歌彈奏的⽅方式都不太相同 依據彈奏特性找出 Pattern 來做偵測

Page 23: Live Performance Effects

#2 傳輸

Page 24: Live Performance Effects

後端傳到前端⽤用 tornado 的 websocket push signal 到 browser

Page 25: Live Performance Effects

⾃自製 protocol (WebSocket)*notes 按的⾳音符 !signal 事件訊號

@timestamp 時間相關訊號

Page 26: Live Performance Effects

*G3, F5 !clock

!RESET !silence @1.1.1 @2.3.4

Page 27: Live Performance Effects
Page 28: Live Performance Effects

前端傳到後端對 server 做⼀一般的 POST or GET

Page 29: Live Performance Effects

Tornado MIDI Listener

MIDI ControllerWeb Socket

HTTP

Version 1 (PyCon 2014 APAC)

Page 30: Live Performance Effects
Page 31: Live Performance Effects
Page 32: Live Performance Effects
Page 33: Live Performance Effects

Tornado MIDI Listener

MIDI ControllerWeb Socket

Threading

Version 2 (Taipei.py meetup)

Page 34: Live Performance Effects

Tornado MIDI Listener

MIDI Controller

Web Socket

Threading

Version 2 (Taipei.py meetup)

AdminWeb Socket

Page 35: Live Performance Effects

如果你們喜歡我們的表演

Page 36: Live Performance Effects

https://www.facebook.com/21band.tw

Back to the 21 9/27, 10/18 20:00 @ A house http://www.walkieticket.com/product.aspx?P1=0000003240

Page 37: Live Performance Effects

Any Questions?

Back to the 21 9/27, 10/18 20:00 @ A house http://www.walkieticket.com/product.aspx?P1=0000003240