Final Project (Final Update)

I tried to make an instrument tuner and display whether you were in tune with 3 leds. One green led would say you are good, 2 red leds would say that you are too high or too low. I tried to do communication from a p5 sketch to an arduino with OSC. I couldn’t get it to work though, so it is kind of unfortunate.

I tried to do serial communication at first but that didn’t work because it just doesn’t work well on Windows computers? So I switched to OSC, but I also had a lot of trouble with it. I can get a basic sketch to work which lights up an led according to where the mouse is. I’m kind of disappointed. I thought once I got a basic sketch down, I could apply it right away to my p5 sketch I already had, but it didn’t work out like that. I feel like it has to do something with the order setupOsc is in my setup function as well as where my sendOsc’s are in my draw function. I can get what I want to send in my console; I’m not sure what’s going wrong. It also doesn’t connect to node.js. I don’t know I stayed up and tried to make it work, but it just doesn’t. I feel like I was a bit too ambition, but also I feel like I could have gotten it done. I was just so busy this semester.

But I guess it can be like some kind of strobe light that goes off while I play the guitar. Just so it could be a little more flashy, than just seeing me play the guitar.

The thing is I really want to get this working, so I’m going to continue working on it. It seems like a waste just to stop here and give up.

UPDATE

So I tried to change the way my tuner would work. Since I was not getting the code to work the way I wanted to, I thought trying to make the p5js sketch only recognize one string frequency would be easier, but like before when I added osc into my sketch the sketch stopped working. It just didn’t work at all.

Instead of that I tried to make the arduino send a digital signal of a button over to a p5js through osc. When the button was pressed it would make the p5 sketch play the sound of a string, with which the use could use to tune their instrument by ear and also help them to gain better pitch detection. The led on my board was so that I could see that the button was actually working, when I was not looking at the serial monitor. I don’t know if it was the order of the code or something, but some things in my sketch wouldn’t load while others would depending on order. I know that my p5 sketches worked by itself because I demonstrated them in class but, when adding osc in it stopped working all together. All my code is here in my github. Even the ones that didn’t work. Below is the button I wired up to play the E string of a guitar. As you can see in my new video the p5js sketch connects and also receives the messages, but the sound just doesn’t play. 

I feel like I just made things harder for myself, instead of trying to think about what I could do. If I thought of easier ways to do this, I think I could have done the project better. I thought that once I could get serial communication done, everything would be smooth sailing especially since I had everything else done. But I just ran into troubles right when I started using serial communication. When I started using osc, I thought it would be easy to do everything especially since it was an easier to use, but again I ran into trouble.

This is my led layout for my tuner I wanted to make.