Saturday, 28 March 2015

Project Explained Part 1 - Arduino, MSGEQ7 and Audio to Colour Theory and Practice

I have had tons of stuff going on recently with the project, so today is going to be a catch us on the written side of it all.

First off I feel like I should give you an update on some of the difficulties that I had been having with the LED side of the project. Firstly, once again I am no electrician and this is all new to me, I have done a lot of reading trying to get my head around electronics and I think I have a stronger idea, but to say I fully understand it would be an exaggeration.

Also, without the code and guidance from a man named Russell, who has been helping via online chat through Blogger and Youtube, I certainly wouldn't have achieved this. He will be credited as such in my dissertation.

I have also had difficulty in getting parts. Well, more the time scales that they come. I completely underestimated how long it would take for some things to arrive, my longer breadboard took 5 weeks!!

I am now nearly there though, all I need to get my hands on is a female TRS Jack input for the audio in, and a 10K resistor, though I may just be able to use one of the 220k ones I already have for that purpose. I also need to soldier the button I got into place, as it is not very Breadboard friendly.

Also my ignorance in implementing the code into the Arduino was also holding me back. I have since figured out what it was that I was doing wrong, so now the Arduino is loaded with the code it needs. By the end of this coming week I should have a working audio-reactive acoustic diffuser. I think it may be the first one in the world! Wouldn't that be exciting. The next post today after this shall be dedicated to the Diffuser build and where that is at, but for now its all LED.

So first off, here is an overview of what is going on. Compared to my last post about Arduino control of LED's, you can see the Breadboard that I waited five weeks for is in place. Damn I wish China wasn't so far away. And amazong was more obvious where you were buying from :( Aaaaanyway.

 

So rather than using the power brick plugged into the Arduino, I am just using the stripped ends of the 12v power brick that came with the LED strip. Hopefully Russell can confirm wether this will work or not, if not then I know how to connect it up his way too, that's fine.


Next we have the potentiometer circuit. Once the board is fully equip with the button, this circuit will allow the user to cycle through the 8 states contained within the code. One button click cycles through these states, where the potentiometer controls the intensity of each program.


 The next circuit is doing the hard graft. Above the middle of the Breadboard, you can see 3 capcitors - 33pf, 0.1uf and 0.01uf (Left to Right). You may have already noticed that the two on the right are twisted together. I shall get some clarification exactly why that is, but I think it is to with stepping the signal down from the audio input, which will be connected this week.



Sticking with the image above, I shall explain what the little black box straddling the middle of the breadboard is. It is called the MSGEQ7 and it is really the brains of the operation here. It is a seven band audio splitter - it splits incoming audio into 7 separate frequency bands from Low to High frequencies.
Below is a small snippet of the Datasheet for the MSGEQ7. It shows the most important signal flow diagrams though. You can also see the specific band passed frequencies it outputs information for.

 
So here you can see a physical diagram and block electrical diagram of the chip (Top Right). If you imagine twisting that diagram round 90 degrees to the left, you have the orientation of the chip on the breadboard. So as I said before, the audio signal comes in through the top right pin, Pin5 (in that orientation). One left, we have the Ground Pin6, nothing to interesting. Next, Pin7 resets the multiplexer operation, on the board this is connected . Pin8 controls the chips onboard oscillator, which is responsible for selecting the frequency of the multiplexor, or how fast the strobe cycles through the audio frequency bands. When the input of Pin8 is high, the multiplexor is reset. When the signal goes low again it enables the Strobe Pin4, which is on the lower side of the chip. Pin3 is the Output, which is the Multiplexed signal. This is connected to the fourth analogue input on the arduino (A3) which unfortunately I forgot to wire up for the picture, but is now in place. Pin1 and Pin2 are the positive and negative power inputs for the chip, the power for which is controlled by the second 0.1uf capacitor.

Next we have the third stage of the Board, which is controlling the LED's. So trying to keep it basic, as I said before the MSGEQ7 spits out a multiplexed output, which means a stream of repeating data. That stream of data contains the volume information for each of the 7 frequency bands that the MSGEQ7 split the audio into.

What we need to do then is convert that data into RGB data which can be turned into coloured light that represents frequency via the LED strip. This is the part of the process that the Arduino takes care of.

If you have read my earlier work on this project, you will know that light and sound are inherently tied together, and one octave of the musical scale (F# through to F#, 370hz - 740hz) can be exactly converted to the octave of the visible light spectrum (Deep Magenta/Red through to Dark Blue/Purple, 406.8ghz - 813.6ghz). To get the exact colour to tone, you multiply the audio frequency by 2 to the power 40. Now we have some context for what I say next.

There are (very basically) three levels of colour. These are known as the Primary, Secondary and Tertiary Colours. The primary colours are out basic building blocks - with them, we can make Secondary and the Tertiary colours. Our primary colours are RGB, Red, Green and Blue. When we combine these together, we can (just about) make any colour in the rainbow. For example, if I wanted to create the colour Yellow from light, I would mix together equal amounts of Red and Green light. It is vastly more complex than this, but an easy way to think of it is how beat frequencies work, it's a form of frequency modulation.You can demonstrate this to yourself by use of some simple maths, though some of you have no doubt got it by now... If you take average between any to colour frequencies, you will get another colour.








Basically, if send varying R,G&B voltage amounts to the LED strip, then we will get a colour representation of the full audio frequency spectrum. Bass shall be represented by pure red, the Mids by green and the Highs by Blue. This can obviously be changed quite easily in the code, but for now it shall be remaining the same as I want to test this as a metering source. The three black things you see sticking out the breadboad are N-Channel Mosfets. They are special resistors that you can think of as Envelope Followers and are what control the flow of Red Green and Blue signal to each channel of the LED strip. It smoothing basically.

In the picture below I am holding that yellow cable for the benefit of Russell, hopefully he can tell me whether or not I can get away with powering the LED strip this way. You can see from earlier pictures that the Power Brick was plugged into the top rail of the Breadboard. I think this way I can avoid having to get a power brick with a proper connection, as I chopped the last one off for the last arduino project.



 Finally we have a picture of it all together. The code is on the Arduino, so hopefully once I have the TRS and button attached I should be plain sailing! The next post is going to be in a while after I have had a break. Once it is composed, I might just leave till tomo morn to post as I will most likely be very tired!





Monday, 23 March 2015

Resolume Explained pt 1

So I figure it would be a good time to explain in detail what is going on with Resolume for my project, as this is one of the main area I( have developed skills for my project.

Resolume Arena is VJ software. As such, it's primary function is one of a video mixer and effector. At a basic level, it act's much like a DAW does. It has channels, and multiple videos can be stored across them, it then has a range of functions to blend, fade, invert etc.


Above you can see what I'm talking about. It is laid out as a grid, with each Channel containing videos across the horizontal axis. As you can see, there are three Channels employed here, giving the option to have up to three layers of video making up the output.

So that's the top of the screen you see, but what about the bottom of the damn screen I hear you cry. Well, from left to right.... First you see the two mini screens. The top one and bigger of the two simply shows the output of the video mix. If you have a second screen or projector, this can be sent to them... But we shall get to that. the screen underneath is the preview window, this can be thought of as cue for all yu DJ's out there. Next you have the Master control section. Here you can adjust the overall tilt of the screen in all planes, spin it, flip it and you also have opacity controls. As the title suggests, these controls apply to the output video, not individual clips. For these controls you have to move left.

If you are familiar with ableton, then this section shouldn't feel too different. First off you have all the same controls you have in the master section, however this time on a clip by clip basis (select clip by clicking on it). You can do so much more here though, and to bring it to life we have to look to the last section on the right. Here is our browser, where we can search all media and tools related to Resolume. Obviously this includes your main system drives, however it also includes a range of video specific effects. These can be chained at will, again on a clip by clip basis, resulting in some truly spectacular video augmentation.

Next to the effects tab however, we find one called sources. This contains a range Generative graphics, based on the FFGL/OpenGL platform. These each have a range of control parameters, allowing for augmentation of the generative graphics. for example the "Lines" generator does exactly what it says on the tin. However the parameters allow control over the number of lines on the screen, the thickness of them, how sharp the edges are, their rotation, their opacity and so forth. On top of this, as with before, we can then chain as many effects as we desire or require after this. Effectively, resolume has a built in comprehensive, open source video synthesiser built into it.

In itself that is very cool, however ass I have touched on before, Resolume offers accurate FFT analysis of audio signals which can then be mapped to just about any parameter within Resolume, certainly all the parameters we are concerned with here. So the next few posts shall go into details of exactly how I have used these parameters to develop the space in my room. Unfortunately I don't have two computers, so for now I am just able to test my own tracks on the system (and any other track obviously) after they have been written. Tbh it is fun to take it out of the analytical environment of the DAW and then import it into Resolume and test it with the chains I have made so far. I have found it far better than just "looking away from the screen" to get an idea for how things sound. Anyways, I can show you in more detail exactly what is going on within the program, however I need to be up early to get the wood for the acoustic diffuser I am building to use as a screen for the projections! Exciting times.

Tuesday, 17 March 2015

Taken a while, but im getting there with the Arduino and LED side of things

So yeah, turns out learning electronics isnt as easy as I first thought it would be. The thing I have found most difficult has been the parts, I have now got three seperate things wrong simply through not fully understanding exatcly what things were etc....

I have now managed to build a HSV or HSL (depending on which you prefer) LED controller for my lightstrip, through following a tutroial here -

LED HSV Fade Controller

And here are the results.... I had a few issues in loading up the arduino... For some reason the COM porting was wrong at first and again, through inexperience it took me a while to figure out.

I have been playing around with the code and I have figured out how to change loop times of the fade through colours... Although inexplicably the red LED seems to just stay on through the cycle, going to be trying to figure that out tomorrow.

Having said that, hopefully my 880 pin breadboard arrives and I can forget about this and gett on with the audio reactivity!

Anyways, here are some photos from this little side project. It has definately helped in terms of building my confidence with electronics. For example, I have stripped a 12v power supply back to bare wires and am using it for prototyping. I have never really done anything like this beffore, so frankly its a miracle I didnt violently electrocute myself. Still plenty of time to go though! ;)



These still dont show it very well, but the arduino is controlling the light cycle of the He Saturation and "Value", which you can think of as intensity. The resulting effect isnt quite audio reactivity, but for my first shot at electronics, Im pretty happy.

Now that my confidence is there, hopefully I can complete the reactive project, although it is slightly more complex!

Saturday, 14 March 2015

Lost for a While

I have definately had a few struggles over the last few weeks trying to re-engage the writing part of my brain and get a solid angle for the dissertation. I feel I have found one now though, so thought I should give a wee update on here.

I have decided that doing a questionnaire for producers and mix engineers is probably a good idea, I can probably get some pretty strong data about peoples creative experience and habits from this.

I will be sending the questionnaire out to my University peers, however I am also part of a few online communities that I can utillise for some extra data, from people who are actually earning a living from mixing and making music.

I will spend tomorrow (after the Formula 1, of course), constructing the body of the questionnaire and run it by Raz sometime next week. I will also be making a start on my literature review in the next couple of days.

The reason there has not been any post's on the LED system is because despite TECHNICALLY having all the parts, my inexperience in any form of electronics LED me to buy a Breadboard half the size of the one required. Nice. The corrected sized one should be here sometime next week, and as soon as it is finishing that off is going to be my highest priority.

I have personally been using my resolume system to check over my own mixes and music and finding it very fun and inspiring. The only problem just now is that I lack two computers, and I run a PC. the only way to really utilise both Ableton Live and Resolume at the same time on windows based machines is with two separate machines

till my next post, here are some new LED Cube Analysers I have found on Youtube. Need to figure out how to do these on a bigger scale for after Uni!! Festival Soundsystems await....