Powered By Blogger

Thursday 14 April 2011

Sound.

Sound proved to be more difficult than I had anticipated. Spent most of the day working on simply getting a code from OpenProcessing to work when I ran it on my laptop and not through the website. I was able to identify the problem when I looked up minim sound code through the site "Code Log". This made me realise that the URL I was attempting to use must not have been linking to the sound itself. I also found that if I were to use a file upload then I would need that file to be in the correct folder in order for the code to find the sound and use it.

The code that I used as a main source for my own sound input was one by Cameron Greatorex that looked at sound initiated by the click or press of a mouse button. I used his code (Click to see) involving sound for the initiation of sound to coincide with the initiation of movement in the sketch. This required some alterations to his sound code, and also meant I did not have to use all of his sound code.

On a side note, I decided that I wanted the wind noise to continue and not stop and start with the clicking of the mouse, which clears the cloud away. This is because of the cloud movement across the screen, I feel that this movement should be backed with the sound of wind.

I had to make changes to the particle class, in the void mouse() function, due to the fact that I wanted the clouds to only separate when the mouse was pressed. But wanted the animation of clouds to continue when the mouse was not pressed. This was pretty straight forward stuff after all, and I was surprised at how far my coding knowledge has come :)

No comments:

Post a Comment