Skip to content
Snippets Groups Projects
Commit d73eb777 authored by Jonas Blumer's avatar Jonas Blumer
Browse files

added param passing

parent 9998d2a7
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,8 @@ $(function(){
iosocket.on('metronome', function(serverStepPos){
stepPos = serverStepPos;
advanceStep(stepPos);
playSound();
playExternalSound();
playSound();
});
// if bpm changes from other client, update slider pos here
......@@ -116,7 +116,7 @@ function getAllSteps(){
for(var i = 0; i < 4; i++){
grid [i] = new Array(16);
for(var j = 0; j < 16; j++){
grid[i][j] = $('.step' + j + '.row' + i).is(":checked") ? $('#row'+i+' select').val() : '0';
grid[i][j] = $('.step' + j + '.row' + i).is(":checked") ? {sound: $('#row'+i+' select').val(), rate: $('#pitchRow'+i).val()} : '0';
}
}
iosocket.emit('grid', grid);
......@@ -132,11 +132,10 @@ function playExternalSound(){
for(var j = 0; j < 16; j++){
if(externalGrid[i][j] != 0){
if(stepPos == j){
this[externalGrid[i][j]].pause();
this[externalGrid[i][j]].currentTime = 0;
//this[externalGrid[i][j]].playbackRate = pitch;
this[externalGrid[i][j]].play();
this[externalGrid[i][j].sound].pause();
this[externalGrid[i][j].sound].currentTime = 0;
this[externalGrid[i][j].sound].playbackRate = externalGrid[i][j].rate;
this[externalGrid[i][j].sound].play();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment