After successfully wiring up the pressure mat and feeling very pleased as I have never wired anything, ever…

It was over to MAX msp, I dutifully read through the tutorials and they are great, max comes with at least 20 or so basic tutorials and these all have working ‘patches’ or files that you can open, look at, play with and alter to get a feel for making your own and understand the syntax it uses for processes.

There seemed to be many people using MAX, for audio, video and interactive projects, the forums were active and lively and I felt confident to start with my own patch.

What I needed to program was the starting video to play and loop until the pressure mat switch was activated and a second video plays until it’s end and then returns to the original video which is still looping.

Doesn’t sound too difficult does it, but I have been testing and trying on and off from the beginning of July to try and get this to work…

I have looked and googled and tried as many different search terms as you like to try and see if anyone else has ever used a pressure mat directly into a computer and MAX msp, but there is no-one out there, or no-one has ever written about it being successful, and last night I’d almost decided that it wasn’t possible, I couldn’t get it to loop and return and the pressure mat thing wasn’t working or hadn’t been successfully recorded anywhere, my idea for simple activity was looking doomed.

I had been able to find a number of people using an arduino to interface with MAX, but at this point I didn’t want to start with another purchase and more software to learn!

I also had doubts about the pressure mat itself, it had come with 4 wires… which ones made the circuit? No paperwork came in the box, I guess you’re supposed to know what you’re doing…

And of course I had wired it to the plug before checking the live circuit.

I had to find an expert… fortunately Phil, one of the MRC technicians was one of the people who had said that MAX was good in the first place for interactivity, so with promises of coffee and or cake (Earl Grey black for future reference!) I managed to get an hour with Phil.

We started with the patch that my husband and I (I’d even roped him in too!) had been co-working on the night before – him more than me as I was about ready to give up at this point – and Phil was kind enough to say we were on the right lines, but needed to input the videos differently, using a bang, or a button rather than reading in the file to loop or play it. Then he tackled the returning to the original video as we had one switching to another on a click, just not by reading the end of the video to trigger the return to video 1.

We had looked at the delay function, but Phil suggested using the pipe command, we had calculated the length of the clip with ‘length’ but this was giving an odd number, that when worked into the pipe function returned to the original video, yay!..but before the end of the clip had actually played. Phil then set about trying to work out the fps and miliseconds needed as the 2720 ‘length’ number was obviously wrong, as he was looking through some of the reference material, I saw a ‘duration’ function which listed as returning ms, just what we wanted, and when he put into the patch, it worked!

This was amazing, I don’t think Phil will realise just how brilliant it was to see this working, for me…

With that working, he turned to the pressure mat, of course the first thing he did was to check which was the live loop out of the four wires… it wasn’t the ones I had hooked up!

So if you ever buy one of these pressure mats from maplin, the active wires that make the contact loop are the two on the inside of the mat, they actually came with a bit of the plastic casing missing, but no diagram, so here’s one I made earlier!

matwires

The red wires make the active loop.

I connected the right wires up to the extended wires and we plugged the now working jack back into the microphone socket.

He put the adc~ code into the patch, but it didn’t register anything, so we looked at the audio input options and here we found it wasn’t on and it wasn’t defaulting to the correct input, so after a bit of jiggery pokery with the audio in on the control panel of my laptop we got a signal.

Phil had put in what looked like a volt meter in MAX so we could read the base voltage and see what it changed to when the mat was stepped on, then he added a greater than value, which would activate the change in state, this worked well, but when you stepped off before the video finished it would return to the looping video, not good as I wanted the whole video to play, so Phil added a ‘gate’ which closed the activation whilst the video was playing.

To put it bluntly Phil is awesome and it all now works, bar the fullscreen which I will sort when it’s actually on the mac I will use for the show as that is different between macs and pcs (I’m working on a pc for these tests)

So just in case you ever fancy doing something like this yourself, here is a screenshot of the patch!

maxpatch

and here it is working!!!!

Advertisements