Monday, December 17, 2018

Final Project


My inspiration for the final project was initially to force myself to make a musical instrument using left over parts and sensors that I had lying around from my other musical projects where I had a shopping list for. So it was going to be a "Stone Soup" type of instrument.

I also wanted to use the Teensy 3.2 micro controller board because I really have fallen in love with it's small size, copious inputs, and capacitive touch pins. I just so happen to have had one lying around from a different project so I went to work removing the headers so I could get to more of the pins on the back side of the board.... An hour later I put in an order to Amazon for a new Teensy because I totally mauled some of the copper inserts on the board and rendered a few of the TouchSense pins unusable...Derp
All was not lost though I had enough working pins to put together I small touch keyboard!


Ordering a new Teensy also gave me the chance to splurge for some LED buttons because I had to spend 35$ for next-day shipping. While I waited for Amazon I got to work in Adobe Illustrator planning out the template for the instrument to laser cut. I took an inventory of buttons, sliders, dials, lasers, light sensors, and copper tape and went to town.




I was thankful for the work I put into learning how to laser cut and laser print earlier in the semester because I was pleasantly surprised for everything to some out nicely on the first try. Yay practice!





I mounted the buttons and some pots to see if they would fit and then I got to the grind of it... wiring and solder. Luckily for me I find it sort of therapeutic. It feels rewarding to take pieces and make wholes. I remembered to take lots of pictures because I knew a lot of things would be connecting to this tiny board. 
Big plans for a small thing

TouchSense Soldering First

Early Mockup

Pots and buttons next

Getting messy

Buttons are lit, copper tape is live!
I couldn't keep myself from trying it out as it was at this point in the build. 



It was all going together so well... until the lasers.
I had issues with the lasers shorting themselves out and damaging the diodes which made them useless in triggering the light sensors I was using to trigger the notes....Another order to Amazon.

I got the lasers a wired up but the grab bag of photoresistors were proving difficult to work with. Let me correct myself...The photoresistors were working exactly how they were supposed to, but not how I wanted them to work. After consulting Prof. Dec I was able to use a multimeter to choose resistors that are better suited for the mystery photosensors. The photosensors are normally analog sensors but I wired them as a digital on/off sensor using a voltage divider but I was using resistors that were too high and no light could be bright enough to trigger the sensors the way I had wired (3)them. A minor setback, but a real learning experience.

I had planned on coving the lasers and light sensors up after learning the hard way with my laser harp. I would use hot glue to aim the lasers and would not have to worry about aesthetics because they would be out of sight! Hopefully it would all work out according to plan.
Poking out through the top with a little hot glue

Secured with hot glue!

Nestled in their laser-cave
The last part was getting the drum pads to work. They can't flop about but they also need some breathing room to move when hit/tapped because the movement of the sensor generates a small electrical signal that signals a note-on message. After some trial and error I got them working to a point where you could get away with a light tap instead of a whack.

I also had a goal of writing the code myself, or as much by myself as I could as a test of what I have learned. I found the using the MIDI_Controller.h library was easy to work with and allowed me to change MIDI channels as necessary(because I would want to assign a separate instrument for the harp, buttons, drums, etc.).

At this point in the build the meat and potatoes were all ready(meaning all of the electrical things were working and I needed a bottom(something I hadn't planned out before. I printed a bottom and had a think about how I might use spacers or dowels to bridge the top and bottom.

I headed to the Thingspace to put everything together(maybe) and chopped up some dowel rods and glued them into place. I took some inspiration from Jackson Pollock and drove the "Palette" idea home with some paint splatters.







Here is the Final Product:






Rube Goldberg Machine

I'll start out by saying OKGO is a inspiration in many ways to me. The way they think and brainstorm in creating their music videos is fodder for my own creativity as well as my students. I particularly love their video Needing/Getting. I would show This to Shall Pass to my classes when I taught EFL in Korea once a year for a summer camp lesson. We always had a fun time planing and explaining them. 



I decided to keep it simple because I know that there would be some troubleshooting needed when the group was going to be putting it all together during class the following week. I erred towards reliability and predictability in my servo code. I had envisioned some sort of ball or cylinder rolling along to hit a button that would trigger the code on the servo...which would trigger something else!




During class we started out with a plan on paper and then pieced it together. I had a lot of fun trying things out and seeing where we needed to tweak and reenforce. The first time we did a run through it worked perfectly to our surprise! When we tried it a 2nd time the balloon didn't pop, though... oh no!





Scratch Day

 On December 1st I attended the Scratch Day at TC. I wasn't sure what to expect but I knew that people where going to be there because the registration was filling up quickly and some of the workshops were already at capacity by the time I signed up which was less than a day after registration opened.

 I opted to sign for a double session music-themed workshop that featured the Circuit Playground Express. This is a micro controller that has a lot of built-in capabilities like velocity, gravity, light and temperature sensors in addition to the 10 RGB LEDs on the front of the controller. It's form factor is similar to the LilyPad Arduino I had used before, but after looking at the pinout diagram I saw that this was a very versatile controller.

The theme of the session was to make a "trumpet" that responded to pitch and volume by tilting the controller on it's X-axis and Y-axis. While it is possible to program the controller with the Arduino IDE software we used the Makecode website that had a browser based block dragging coding format similar to what the microbit uses.


I followed the tutorial on Adafruit's website for this, and it was a lot like following some Lego instructions. The instrument itself leaves something to be desired as far as being a responsive musical tool, but I think that the controller could have the potential for some very creative musical projects. 



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: