@@ -28,6 +28,7 @@ var express = require('express'),
2828
2929app . use ( '/static' , express . static ( __dirname + '/node_modules' ) ) ;
3030app . use ( '/torsk.css' , express . static ( __dirname + '/torsk.css' ) ) ;
31+ app . use ( '/torsk.js' , express . static ( __dirname + '/torsk.js' ) ) ;
3132
3233app . get ( '/' , function ( req , res ) {
3334 res . sendFile ( __dirname + '/index.html' ) ;
@@ -38,7 +39,11 @@ app.get('/chords', function (req, res) {
3839} ) ;
3940
4041app . get ( '/drums' , function ( req , res ) {
41- res . sendFile ( __dirname + '/drums.html' ) ;
42+ res . sendFile ( __dirname + '/drums.html' ) ;
43+ } ) ;
44+
45+ app . get ( '/sequence' , function ( req , res ) {
46+ res . sendFile ( __dirname + '/sequence.html' ) ;
4247} ) ;
4348
4449io . on ( 'connection' , function ( socket ) {
@@ -57,12 +62,17 @@ io.on('connection', function (socket){
5762 shell . exec ( command , { async : true } ) ;
5863 } ) ;
5964
60- socket . on ( 'beat' , function ( msg ) {
61- var drum = drums [ msg ] ,
62- command = 'play -q ' + drum ;
65+ socket . on ( 'beat' , function ( msg ) {
66+ var drum = drums [ msg ] ,
67+ command = 'play -q ' + drum ;
6368
64- shell . exec ( command , { async : true , silent : true } ) ;
65- } ) ;
69+ shell . exec ( command , { async : true , silent : true } ) ;
70+ } ) ;
71+
72+ socket . on ( 'playSequence' , function ( msg ) {
73+ console . log ( msg ) ;
74+ // todo play sequences.
75+ } ) ;
6676
6777 socket . on ( 'disconnect' , function ( ) {
6878 console . log ( 'a user disconnected' ) ;
0 commit comments