csound / manual

Csound Reference Manual (English)
Other
45 stars 29 forks source link

Update the sketch embedded in the example code of arduinoRead and arduinoReadF #664

Closed TetsuyaMiwa closed 1 year ago

TetsuyaMiwa commented 1 year ago

The sketch embedded in the example code of arduinoRead and arduinoReadF needs to be updated.

Current: int hi = ((senVal>>7)&0x0f) | ((senChan&0x0f)<<4);

Updated: int hi = ((senVal>>7)&0x07)|((senChan&0x1F)<<3);

The updated code is consistent with the comment in the sketch: // The packing of the data is sssssvvv 0vvvvvvv where s is a senChan bit, v a senVal bit and 0 is zero` bit

The updated code is from the article in ICSC2022, 'New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound'. I also confirmed that the updated sketch works but current one does not(Csound version 6.18, MacOS).

tjingboem commented 1 year ago

Thanks for this report!

I do not know anything about Csound and Arduino but will update this text soon, as well as add a link to this article on the manual page.