Commit 5962d1eb authored by Max-Ferdinand Suffel's avatar Max-Ferdinand Suffel
Browse files

maintance

parent d82fb993
......@@ -36,7 +36,7 @@
}
h1 {
color: #fff;
color: #000;
}
</style>
......@@ -188,32 +188,32 @@ RefreshFrame = function () {
};
// var socket = io(EEG_SOCKET_SERVER);
// socket.on('connection', function() {
// socket.on('get-EEG', function (data) {
// data = JSON.parse(data);
var socket = io(EEG_SOCKET_SERVER);
socket.on('connection', function() {
socket.on('get-EEG', function (data) {
data = JSON.parse(data);
// if (data.attention > 0 && data.meditation > 0) {
// RefreshFrame();
// var min_nbrPoints = 48;
// var max_nbrPoints = 96;
// var min_data = 0;
// var max_data = 100;
// nbrPoints = min_nbrPoints + ((max_nbrPoints - min_nbrPoints) * (data.attention - min_data)) / (max_data - min_data);
if (data.attention > 0 && data.meditation > 0) {
RefreshFrame();
var min_nbrPoints = 48;
var max_nbrPoints = 96;
var min_data = 0;
var max_data = 100;
nbrPoints = min_nbrPoints + ((max_nbrPoints - min_nbrPoints) * (data.attention - min_data)) / (max_data - min_data);
// eegData.push(Math.cos(data.attention - 0.2 + 0.3));
// eegWaveform.update({
// data: eegData
// });
// } else {
// eegData.push(Math.cos(90));
// eegWaveform.update({
// data: eegData
// });
// console.log('Connecting...')
// }
// });
// });
eegData.push(Math.cos(data.attention - 0.2 + 0.3));
eegWaveform.update({
data: eegData
});
} else {
eegData.push(Math.cos(90));
eegWaveform.update({
data: eegData
});
console.log('Connecting...')
}
});
});
// On web page is loaded:
......@@ -234,7 +234,7 @@ window.onload = function () {
MIDI.programChange(3, 104);
MIDI.programChange(4, 1);
setInterval(RefreshFrame, 200);
// setInterval(RefreshFrame, 200);
},
callbackPCM: function (pcmBuffer) {
sendAudioData(relaySocket, pcmBuffer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment