Angel’s Status Report for 3/26

This week I worked on sending dummy data and then sending fingerings from buttons over Bluetooth from the Arduino Nano BLE to the Raspberry Pi. I was able to write code on the Nano to create characteristics for the fingering, and then update the value in it with the bit mapping created from all 9 buttons. The code on the Python reads this data over BLE and displays the bit vector when the values change. I tried enabling the notification functionality but was unable to, so the Python program uses polling. I played around with different latencies, and found out that using delay() in the Arduino library wastes cycles, so I switched to setting the latency between sending new data with the millis() function instead, and checking the intervals of time with if statements. Right now the Arduino is set to send data ever 20 ms. I have not recorded the latency between the Arduino and Pi, but it is much less than half a second. I estimate it is around 100 milliseconds but I will have to time this. I am now much more confident that we will be below our latency goals for feedback.

           

I also started working with Sonic Pi, as we plan to use it to play the notes the user is playing (when they blow and have a valid fingering). I downloaded some flute samples that Robin Newmann uploaded specifically for working with Sonic Pi.I also downloaded and used his associated code that manipulates the samples to represent a range of notes, tempos, and pans in a way that is more user friendly. I had to modify it slightly to get to run, but I was able to play the notes that we plan to play with our device. Additionally, I started working with the live_loop functionality in Sonic Pi, which allows you to modify what is being played in real time. I was also able to use OSC to send commands from a python program to Sonic Pi. Combining these functionalities will allow me to control the notes being played from the python code that receives the fingering and breath data.

Next week, I hope to combine the sending of fingering data from buttons to the Pi and the subsequent playing of the note in Sonic Pi. I will also start working with Vivian to create the Flute Controller and send over the gyroscope data. I am still on schedule due to the amount of things I was able to do this week once I got the Bluetooth connection finally working. I will have to start thinking about how to set the note duration since it will be as close to real time as latency allows.



Leave a Reply

Your email address will not be published. Required fields are marked *