Wednesday, November 28, 2018

A Fantasy Musical Instrument


It was fun to let my imagination run wild for this project. Of all of the projects so far I think this one got rolling the quickest.

My initial idea was some sort of VR musical instrument, I was inspired by lots of things but, somewhat embarrassingly I drew quite a bit of inspiration from the Holophonor from the Futurama Animated Series. Upon further investigation of this I found that the writers of Futurama were inspired to create this instrument from an instrument that Issac Asimov includes in the Foundation series of novels called the Visi-Sonor.

My device will have the player interact with a grid laid out in front and around. How the player moves his arms/fingers through the space in front of them will manipulate the sound that the device produces.

This requires some sophisticated sensors and computing power, but it could be a simple monophonic instrument like any wind instrument or a multi-phonic instrument limited only to how the user customizes the interface. For example, the piano is limited to one sound being played on up to 10 different notes. The interface could allow a single finger to play multiple notes depending on the depth the user is occupying in the virtual grid.


I imagine this might appear first on a heads-up type of display or even a google glass device.

I want to have the note and tambre selection isolated in the arms/hands/fingers. So the note velocity could be dictated by a breath controller. These already exist as a potentiometer. I would add some sort of haptic feedback device to help the player establish a better affinity with the virtual device. 

Thursday, November 15, 2018

I was excited to get this little touch screen shield for the Arduino to work with I want sure how I was going to use it because I knew that the complexity of the code would be limited because the memory of the uno was just 32k. I was hopeful at first, it was Adafruit product so there would be some decent documentation.... My hope was my downfall. 


I'll was expecting to have to upload a library... But not three libraries, I missed one of them and it caused me about two hours of strife... Learning moment I guess. Eventually my hard headed approach worked and I got an example sketch to run...I needed that as I was getting frustrated. I still want sure how I was going to do my project but I knew that it worked, even if I barely knew why. 



I thought it might be a good start to use one of the sensors I got in my starter kit but never got around to using. I found a temperature/humidity sensor that, taking into account the changing weather might be interesting to get to know. I found through the model number on the back that this was a fairly common sensor that had well supported libraries. I choose to not see it up with the touch lcd screen yet as I thought it was best to tackle one new thing at a time. I set it up with a 16x2 lcd screen I had used in a prior project and copied some coffee into the sketch and fiddled with the program to have it display both Fahrenheit and Celsius. After I was more confident manipulating the sensor code I focused on the touch lcd.


I ended up taking a few lines of code from example sketch and using the sensor code from the small lcd sketch to, eventually, make it work. There was a few troubleshooting issues that I had to address: whatever is displayed stays displayed until you cover the whole screen in another color, I used black. This has the effect of resetting the display. 
When the sensor is powered on it takes about five seconds for the sensor to give reliable data so I put in a waiting screen in the code. It doesn't actually relate to the sensor's loading progress but it does allow the sensor to boot up and give an accurate first reading. 



I was happy with how it was running so I experimented with some shape drawing, I can better describe this in the demonstration video. I know that there is a more efficient way of drawing Therese shapes but I wrote the coffee how I understood it and I had very few errors and bigs to troubleshoot! I learned some things!

Thursday, November 8, 2018

MicroBit Alarm

To create an alarm device using the MicroBit's sensor(s) I partnered with Marianna (after successfully stabbing a balloon via MicroBit) with to sort out how to make an alarm device with our two combined MicroBits.

We had a head start using some of the blocks from the balloon pop code that outlined how our MicroBits would talk to each other. After trying out the different light, sliders, sound and water sensors we decided on using the light sensor to make an alarm that could be triggered by opening a drawer or box.

Mariana's MicroBit would be the "sensor" and mine would be the alarm/recorder. Using the speaker add on for my microbit I wrote a code that would play a sound when the light sensor on the other MicroBit triggered a radio message. I also added a block of code that kept track(roughly) of how long the box/drawer had been open.



There were/are a few bugs like the LED images not reseting and sometimes a line of code will not run completely. We tried inserting some "pause" lines but the bugs weren't gone completely. 


Thursday, November 1, 2018

MicroBit Light Sensor Instrument

I dove into this project with the idea of using the speaker add-on that allows the Microbit to play sounds with a little more elegance than using alligator clips and a stereo jack.

I have used micro-controllers as musical instruments before, but never with the Microbit so I was a little unsure on how I wanted to use it.

I decided on viewing the Microbit through the lens of a student, and concentrated less on what I was making but how I was using the tools to create my project.

I started by cruising the music project lists on the website before clicking on this guitar-type thing that had a few different projects within the instrument. I liked the way the light sensor tone production project looked and started following the tutorial.

It was not very hard to replicate the project. The drag and drop code blocks were similar to scratch so it was easier to try and find the right blocks to use(compared to the first time using Scratch).

When I ran the code with the light sensor, I noticed a few things:
     1. I need to calibrate the code to the space I am using it in.
     2. It seemed very sensitive.
     3. The sound does not stop.

I then was inspired to find solutions to these observations by changing the code to better suit my vision.

Step 1: Calibration

I could adjust the scale that was graphed by the  Microbit to get a better feel on how much light was 255 and how much light was 20 and all the differences in between.

Step 2: Limit available notes

I wanted to be in control of what note was being played so I decided to make the amount of notes availible to be played less. Specifically just 6 notes, a pentatonic scale C-D-F-G-A-C. I then made some code blocks that made the microbit play a certain note if the light level was between two numbers.


Step 3: User controlled sound

This was the most simple of the solutions. All I had to do was replace the "Forever" block with the "When A button is pressed". Boom! now I have a user, controlled light sensitive instrument!

Here is the finished code:
Video of the Microbit: