diff --git a/Source/Processors/GenericProcessor.cpp b/Source/Processors/GenericProcessor.cpp index 729f23ccc5d63f135d76d88c34596bb97f6cec82..1c9306941f922b2a7e0b9b191eef3fa0078f3b26 100755 --- a/Source/Processors/GenericProcessor.cpp +++ b/Source/Processors/GenericProcessor.cpp @@ -471,8 +471,11 @@ void GenericProcessor::addEvent(MidiBuffer& eventBuffer, data[3] = eventChannel; // event channel memcpy(data + 4, eventData, numBytes); - eventBuffer.addEvent(data, // spike data - sizeof(data), // total bytes + + //std::cout << 4 + numBytes << std::endl; + + eventBuffer.addEvent(data, // raw data + 4 + numBytes, // total bytes sampleNum); // sample index //if (type == TTL) diff --git a/Source/Processors/RecordNode.cpp b/Source/Processors/RecordNode.cpp index d6471fee55ca5567b4712cbe4924112abd1a9ad4..4c0e6d63111071fb9fa3f0d84e1df27853a67a62 100755 --- a/Source/Processors/RecordNode.cpp +++ b/Source/Processors/RecordNode.cpp @@ -597,14 +597,14 @@ void RecordNode::handleEvent(int eventType, MidiMessage& event, int samplePositi { const uint8* dataptr = event.getRawData(); - // std::cout << (int) *(dataptr + 11) << " " << - // (int) *(dataptr + 10) << " " << - // (int) *(dataptr + 9) << " " << - // (int) *(dataptr + 8) << " " << - // (int) *(dataptr + 7) << " " << - // (int) *(dataptr + 6) << " " << - // (int) *(dataptr + 5) << " " << - // (int) *(dataptr + 4) << std::endl; + std::cout << (int) *(dataptr + 11) << " " << + (int) *(dataptr + 10) << " " << + (int) *(dataptr + 9) << " " << + (int) *(dataptr + 8) << " " << + (int) *(dataptr + 7) << " " << + (int) *(dataptr + 6) << " " << + (int) *(dataptr + 5) << " " << + (int) *(dataptr + 4) << std::endl; // timestamp = ((uint64) *(dataptr + 4)) + // ((uint64) *(dataptr + 5)) << 8; @@ -615,7 +615,7 @@ void RecordNode::handleEvent(int eventType, MidiMessage& event, int samplePositi // ((uint64) *(dataptr + 10)) << 48 + // ((uint64) *(dataptr + 11)) << 56; - memcpy(×tamp, dataptr + 4, 4); // remember to skip first four bytes + memcpy(×tamp, dataptr + 4, 8); // remember to skip first four bytes } } diff --git a/Source/Processors/Visualization/SpikeObject.cpp b/Source/Processors/Visualization/SpikeObject.cpp index 3f20f647d5c68753348e993889ff85af6ce31cce..7522d0b08182a45d7500010a0d4a5d7ab262c80f 100755 --- a/Source/Processors/Visualization/SpikeObject.cpp +++ b/Source/Processors/Visualization/SpikeObject.cpp @@ -77,8 +77,8 @@ int packSpike(SpikeObject* s, uint8_t* buffer, int bufferSize) // Simple method for deserializing a string of bytes into a Spike object bool unpackSpike(SpikeObject* s, const uint8_t* buffer, int bufferSize) { - // if !(isBufferValid(buffer, bufferSize)); - // return false; + // if (!isBufferValid(buffer, bufferSize)) + // return false; int idx = 0; @@ -106,8 +106,8 @@ bool unpackSpike(SpikeObject* s, const uint8_t* buffer, int bufferSize) memcpy(&(s->threshold), buffer+idx, s->nChannels *2); idx += s->nChannels * 2; - // if (idx >= bufferSize) - // std::cout<<"Buffer Overrun! More data extracted than was given!"<<std::endl; + // if (idx >= bufferSize) + // std::cout<<"Buffer Overrun! More data extracted than was given!"<<std::endl; return true; @@ -135,7 +135,7 @@ bool isBufferValid(uint8_t* buffer, int bufferSize) uint16_t integrityCheck = 0; memcpy(buffer + idx, &integrityCheck, 2); - std::cout<<integrityCheck<<" == "<< runningSum <<std::endl; + std::cout << integrityCheck<< " == " << runningSum <<std::endl; return (integrityCheck == runningSum); }