Wednesday, 1 April 2015

Problems with my Audio Reactive LED circuit

So I finally got all the last parts for the project and set about building the circuit last night with no success, so I have decided to give a photo blog of the build stage by stage for the benefit of Russell who can hopefully point out to me where I have gone wrong.

This is going to be snappy as I have lots to do and don't want to bore Russell. So from the top then!

1) Insert MSGEQ7


2) Connect Caps (Left 33pf, right 100nf). The left wire of thee right cap goes to Ground Pin 6 of the MSGEQ7. The 33pf's right wire connects to Oscillator Pin 8 (connection will be broken with resistor)


3) Connect 3rd Cap, which sits "over" the second cap. The left wire goes to Input Pin 5


4) Insert 220K resistor between 33pf and Pin 8


 5) Insert second 100nf cap. Pin 1 Positive and Pin 2 Negative


 6) Connect Positive and Negative Pins to the power rail via Cap.


7) Next is soldiering two jump wires the positive and ground connection on this little Stereo Jack Input.


8) You see 5 Pins, Ground is the centre pin, closest to the input. The two at the top here (actually on the right) are Negative, and the bottom two are positive. TRS stands for Tip, Ring, Sleeve. Tip is positive, Ring is Negative and Sleeve is ground.


9) Here is the Input with jumpers soldiered on. (And a slightly burnt desk :/)


10) Here is the TRS taped down to the BB with leccy tape. The positive connects through Cap 2 to Input Pin 5, Ground to the Ground Rail.


11) 3 N Channel MOSFET Transistors are added to the board. N Channels have three pins, Gate, Drain and Source from left to right.


 12) Each source Pin is connected to the ground top rail of the breadboard.


13) The 220k resistor is now connected to the bottom power rail - live to left, ground to right.


14) Here is another angle to show the exact connection, the ground wire connects to the 33pf capacitor left wire, not the resistor.


15) Here we connect the ground of the MSGEQ7 to the bottom ground rail.


16) Next I insert the 1K potentionmeter and 10K resistor. They are not connected.


17) Here, the ground rails are connected together, a button is attached via soldiered jump wires. The live rail is connected to the positive of the button, the negative back to above the 10K resistor. I have also attached the bottom live rail to the right pin of the potentiometer.


18) Here, I attach a jumper to the central pin of the potentiometer for data transfer to the arduino, I have also connected the jumper from the left of the 10K resistor to the bottom ground rail.


19) Here the left pin of the potentiometer is connected to the bottom ground rail.


20) Here are the connections for the arduino attached to the gate pins of the MOSFETs


21) Finally, I attach the live 12v top rail connector which feeds the LED strip power.



So as far as I am aware, that should be the breadboard and circuit good to go, next post is about all the connections from the Arduino to the Breadboard, there will be a tutorial just like this for that too. Hopefully these can go towards helping people do this in the future too! Cheers

Monday, 30 March 2015

Project Explained Part 3 - The Diffuser as a PJ mapping screen

So to start off this post, I have a photo of the setup I was using when I first moved into my Uni flat.


A computer, a second monitor and my Event 20/20 Studio Monitors (speakers). Unfortunately I had phone issues about 16 months ago, so this is one of the only photos I have of this time, I wasnt anticipating them being in anyways useful to me for my honours at the time!

All of this was connected to a Focusrite Sapphire 6 Soundcard, kinda an industry standard and pretty shitty piece of gear, as my audio interface. As you can see also, I had gone down the road of acoustic foam, through sheer ignorance basically. If you can imagine a rectangular room behind the camera, big enough for a double bed and a small lane down the right side of the room to walk in - not much floor space at all.

This room actually naturally sounds better than the last room I was in, but it is far smaller. It is also my bedroom, which the last one wasn't. I have found ever since I got here that it is quite a creatively prohibitive space. It's actually a lot of the reason I chose my project. Though it has evolved through the year, it has always been about either Acoustics or Audio reactivity in visuals, in particular how colour can represent sound.

So the center piece of my project is going to be an audio reactive acoustic diffuser, along with projection mapped 1.2m x 0.6m corner straddle traps, acting as screens. The diffusers block faces shall also be mapped.... But hold on, what the hell is a diffuser? I haven't talked about that yet...

So we know that we want to absorb frequencies to prevent things like Comb Filtering from early reflections, and standing waves caused by the physical shape of the room and the materials it is made from. However if we were to just use absorbtion then the space will become to dead. Taken to the extreme, the space would become what is known as an anechoic chamber. This is a space where there are no reflections and humans actually find this environment extremely disconcerting (though it is argued over). here is a video showing what an anechoic chamber is and what it does to most humans.


And here is a video arguing the point


Both have great descriptions of what the chamber is and what they are used for. So yeah, back on track. This is not what we are looking for in a music studio control room environment, so we use diffusion to actually reflect some frequencies back into the room. But I thought we were trying to avoid this !?

Well basically a diffuser is designed is such a way as to scatter frequencies back into the room at different angles and tiny timing differences. In the pro studio pictured in the previous post, you can see one type of diffusion used behind the speakers - the curved face to the grey panels behind the speakers will scatter whatever hits it evenly on the vertical plane. To demonstrate different types of diffusion, here are some pictures with a brief explanation of each.


Say what? Yep. It is known that general clutter around a room is good for breaking up sound in a room. The king of this effect in the common house is the bookcase.

Next we can have a look at some mathematically devised diffusers. I should start this by saying that the grounding for these ideas come from the BBC's research in the 50's and 60's into acoustics. Here is a link to where you can get in about that if you want. The first is the BBC's guide to acoustics in architecture.

http://downloads.bbc.co.uk/rd/pubs/archive/pdffiles/architectural-acoustics/bbc_guideacousticpractice.pdf

And then below we have the document specific to diffusion. It goes into the reasoning behind why the BBC chose the design they did, including the diffusion characteristics and materials used.

http://downloads.bbc.co.uk/rd/pubs/reports/1995-01.pdf

So this original design is what is known as a Skyline diffuser, or PRD (Primitive Root Diffuser). The idea with these is to chaotically scatter audio frequencies within a space so our ear cannot tell the direction or exact timing of the reflections of the sound in a room. Here is a screen shot from a program called acoustic calculator that I was originally going to use.


 You can see a grid of squares above, numbered from zero to four, resulting in five different lengths in the diffuser. The pattern of placement is calculated through the equation.

Here is a quote from Wolfram Mathematics.
"A primitive root of a prime p is an integer g such that g (mod p) has multiplicative order p-1 (Ribenboim 1996, p. 22). More generally, if GCD(g,n)=1 (g and n are relatively prime) and g is of multiplicative order phi(n) modulo n where phi(n) is the totient function, then g is a primitive root of n (Burton 1989, p. 187). The first definition is a special case of the second since phi(p)=p-1 for p a prime.
A primitive root of a number n (but not necessarily the smallest primitive root for composite n) can be computed in Mathematica using PrimitiveRoot[n].
If n has a primitive root, then it has exactly phi(phi(n)) of them (Burton 1989, p. 188), which means that if p is a prime number, then there are exactly phi(p-1) incongruent primitive roots of p (Burton 1989). For n=1, 2, ..., the first few values of phi(phi(n)) are 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 4, 2, 4, 2, 4, 4, 8, ... (OEIS A010554). n has a primitive root if it is of the form 2, 4, p^a, or 2p^a, where p is an odd prime and a>=1 (Burton 1989, p. 204). The first few n for which primitive roots exist are 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 17, 18, 19, 22, ... (OEIS A033948), so the number of primitive root of order n for n=1, 2, ... are 0, 1, 1, 1, 2, 1, 2, 0, 2, 2, 4, 0, 4, ... (OEIS A046144)."

Understand? Yeah, me neither. What is important is that it works and looks amazing. Though mine isnt fully constructed yet, this isn't dissimilar to how mine will look. If you can imagine this with the LED strip round the side of the base plate, you can imagine how my project will look. The second aspect is using audio reactive projection mapping as I have talked about. Each face of the diffusers posts will be mapped as an individual screen, will a specially devised colour organ that I have made using Resolume and FFGL plugins.

The main difference between this one and mine, is the maths. I have known for ages that there are two types of acoustic diffuser - Primitive Root/Skyline and QRD. The second is a different mathematical equation, designed again to scatter sound, but this time in a more orderly fashion. It stands for Quadratic Residue Diffuser and it scatters sound on a 1 dimensional plane. Or so I thought... Here is an image of a room employing a few of them :P.


I kid obviously, this room is completely covered in them. This room is obviously being used for live sound recording. Unlike a studio environment, where we are looking to kill reverberation times (RT60), when recording live acoustic instruments, people normally look for a  bigger space with it's own acoustic character.

In the case of the image above, we see a relatively small room for this purpose, so the goal of using so much diffusion is to actually exaggerate the feeling of space within the room. As I said before, when you scatter sound in a room, the ear cannot detect the direction or the timings of the first reflections. When you do it to the extreme, a room will "appear" to sound a lot bigger than it actually is.

The QRD's with upward facing slats you see above are scattering sound horizontally, where as the ones slatted sideways are scattering vertically. You can know visualize the scatter orientation for the QRD's on the roof too - they on the plane 90 degrees to that of its orientation.

I love symmetry nice nice shape, so naturally this for of diffuser was more appealing to me than the PRD Skyline. My thinking was I could maps each cell division and turn it into a spectrum analyser with projection mapping.

The calculator I showed you before actually has a tab for QRD calculation, however during research I actually found one called QRDude, which is specifically for building QRD's obviously. So I DL'd the program. Here is a screen grab of the 1D QRD diffuser that I designed in the beginning.


But I hadn't really explored the program. You might notice "2D" in the tabs of the window. This is a way to turn the maths that result in a 1D diffuser. It is the ideal solution for my project as it has the visual effect of the Skyline, creating multiple screens, but it also has the symmetrical dispersion and look which ís far more appealing to me. Here is a screen grab of the 2D I designed using this calculator.


Keeping with the idea of symmetry, the circle you see is a phase diagram of the dispersion. In the first design, you can see that it is offset to the right. This is because it has 11 wells. In designs with 11 or less, there is always a phase offset. It is always offset by an exact amount though, so you can reverse the panel and put two side by side, thereby regaining the symmetry.



In my final design, you can see the well number is set at 13 and the phase wheel is symmetrical. This is the smallest panel number we can use for this effect. When you click the 2D tab, you get your new design.


So this is the image of the finalised diffuser I have nearly finished building. And just to bore you, a copy of the calculated guide for the build!

QRDude report for 2D QRD diffuser
===================================

STANDARD PANEL is based on a modulated series of STANDARD 1D QRD panels
Panel does NOT have fins

Panel order =  13
Design frequency  662 Hz
Number of wells =  169
Panel is shifted 7 wells to the left and pulled 7 rows towards the front

One depth unit is equivalent to 20 mm
Build depth is 240 mm

Panel width (no fins) is 572 mm

Period width is larger than design wavelength - good!

Block details
=============
Block width 44 mm

Number of empty wells 12
12 blocks of height 1 depth units, or 20 mm
12 blocks of height 2 depth units, or 40 mm
12 blocks of height 3 depth units, or 60 mm
12 blocks of height 4 depth units, or 80 mm
12 blocks of height 5 depth units, or 100 mm
12 blocks of height 6 depth units, or 120 mm
12 blocks of height 7 depth units, or 140 mm
12 blocks of height 8 depth units, or 160 mm
12 blocks of height 9 depth units, or 180 mm
12 blocks of height 10 depth units, or 200 mm
12 blocks of height 11 depth units, or 220 mm
25 blocks of height 12 depth units, or 240 mm
----------------------------------------
Total block length 21.84 metres


Volume based on solid build using blocks (no fins)
---------------------------------------------------
Volume =  .0422 cubic metres


The next post will be dedicated to the process of that build. I have already chopped all the wood according to the guide that you can export from the program, I also have the base plate cut and ready. Just unfortunately due to the restrictions of living with other people (sigh) I can continue with that today. Plenty of photos etc ahoy though! Here is a building that has been made to look like a diffuser in the mean time.


Aaaaaand. Just because I love it, here is an image of diffusion taken to the absolute extreme, from Studio C at Blackbird studio's. It is extremely strange to see a set up like this in a control room, however it is used for 5.1 tasks. Perhaps having and exaggerated sense of space in the room helps for this kind of work. There is also a lot of absorbtion here too, its just all behind the diffusion. How cool would it be to have every one of the diffuser posts set with its own individual LED! Audio to Colour feedback.