Saturday, 25 October 2014

Raspberry Pi Halloween project at the Lost Gardens of Heligan!

This is brilliant, so I have to write about it, plus I had absolutely nothing to do with it, so I'm not blowing my own trumpet.

We met Stuart Pemberton about four weeks ago when we were installing some art at the Lost Gardens of Heligan. Stuart is an electrical contractor at Heligan, and as we cut and trimmed wires, discussed onions, went up and down ladders (him, not me) and shot the breeze our common Raspberry Pi interest came up. Unlike me with my 34 long years of coding experience, Stuart is strictly a wires and volts guy, and had not yet written a line of code in any language. But he had stepped up to the plate in a big way and volunteered to get to grips with enough Python to put together a hardware / software project for Heligan Halloween - an interactive exhibit with infra-red sensors, audio playback and owls. And I like a nice owl, so I thought the whole thing was dead cool, and was very interested to hear how it all went on.

And here we are, four weeks later, back at Heligan to deinstall some art, and flipping heck, he's only gone and done it! Dude!!! In a remarkably serendipitous bit of timing,  Stuart had just finished attaching the final wire and run the final tests when we bumped into him at lunch yesterday, so we had to take a look.

There's a grey box with a Pi, an audio amplifier, a PIR sensor to detect passing warm bodies, and a loudspeaker up a tree. Some Python, an OMXplayer, a recording of a tawny owl hooting, and hey presto, instant Halloween attraction, with passing children enchanted by the hooting owl and wondering a) where it is and b) how come it hoots every time they walk by. Brilliant!

Here he is with his baby - the Pi, PIR and audio amp are in the grey box, hidden under leaves, the pair of 12V batteries powering the whole thing are also hidden under leaves slightly out of shot to the left.


Here's a badly-shot video of the thing - if you listen carefully the owl hoots a couple of times during this. 


This forms part of the Heligan Halloween celebrations, running from now until November 2nd (that's 2014 if for some reason you are reading this in the far future). It is along the Woodland Walk, not too far from the Mud Maid and the Giant's Head, and also close to an excellent and a wee bit creepy child-sized spider's web installation. So jump in the car and head for Cornwall right now. 

UPDATE!!! We just heard from Lorna at Heligan that in fact the project was too successful - gardeners and visitors wandering around at dusk were triggering the recording, which was then attracting actual female tawny owls to the tree! Nice if you want to see a female tawny at dusk, but not at all fair - not nice if you're a girl owl looking for a guy and all you can find is a loudspeaker, and of course it may stop other owl pairs breeding in the area if they think a dominant, hooty male is in residence. So the recording is now of a wolf. A nice, non-British sort of animal. And werewolves are very Halloween. We trust the wolf sound is sufficiently alien that none of the native wildlife is either concerned by, or taken in by the sound! 

Thursday, 16 October 2014

PIANA gets its sequencer

But what should it be called? Sequença? Joanna? Rihanna?? Maybe just plain old PIANOLA? I need to come up with a outlandish acronym that fits, I used to excel at that nonsense. The PIANa Orchestration LAnguage maybe??

But anyway - I have lashed up a sequencer, as promised about 2 years ago. I'm nothing if not quick. I've always been a fan of 'code-based' sequencers, ones where the music really looks and feels like code - I wrote my first one in 1988, and this isn't that dissimilar. Except the hardware it's running on is capable of so much more synthesis than an old T414 transputer could manage.

Anyway, 2 years of fermentation and 3 days of rapid coding have yielded a compiler, an 'instruction set' that is textual and human-readable - good for debugging - and it's pretty damn great.

So -

a piece of music is a 'program'. A program consists of 'sections', and a section is a set of 'patterns' that play out on different synths over different MIDI channels.

A pattern is griditized in time, with a maximum 32 steps per pattern. A pattern can contain noteOn, noteOff, pitch bend, program change and CC events right now. The only other smarts are within the program, where tempo can be set up and changed live as the piece plays, and looping is supported, both counted loops, nested, and 'repeat forever' loops that break out when a user callback is triggered. On the Pi this will involve hitting the ESC key. Profound or what.

So it's DEAD SIMPLE but it lets you knock up multi-part music very, very quickly. Which sounds brilliant, brilliant, brilliant. And I now don't need to use Logic to run multiple synths at once. Totally self-contained, it runs as a separate application to PIANA and communicates over an ALSA virtual MIDI port. Or over physical ports via USB. So I can use a Pi to sequence music running on an iPad, AND on the Pi, at the same time. And on a Pi, USB MIDI to another 2 or 3 or 4 Pis ... the Chamber Orchestra just got real, details to follow, and I didn't have to do any hardware.

Cool or what?

Now, it has not as yet run on a Pi, and will not for at least a week as I'm busy doing other stuff, out of town, the usual. But on the Mac it runs GREAT, and consumes so little CPU that Instruments can't even measure it. It spends pretty much all its time going usleep, and when it isn't going usleep it's pushing bytes down a USB port or a virtual MIDI port.

Here is the classic, lovely drummy intro to Being Boiled - yes, it's a bit long but this is an early incarnation, it will take living with this for a while to work out how to make programs more terse. Note the dynamic panning within the pattern by tweaking the 'pan' CC on selected drum hits. Neat.

But the most important thing is - it works. And it is  bloody brilliant.

// Being Boiled on a Pi
// 0 : kick 
// 1 : Ian Craig Marsh
// 2 : CLAP!
// 3 : synth 1
// 4 : synth 2

pattern loadPresetsToSynths (steps=8) { ... }

pattern boiledDrums (steps=32) {
0 : noteOn(note=C3, chan=1, vel=100);
0 : CC(CC=10,chan=0,value=64);
0 : noteOn(note=D5, chan=0, vel=80);
4 : noteOn(note=C2, chan=1, vel=80);
6 : noteOn(note=C2, chan=1, vel=80);
8 : noteOn(note=A4, chan=1, vel=127);
12 : noteOn(note=C3, chan=1, vel=100);
12 : CC(CC=10,chan=0,value=30);
12 : noteOn(note=E5, chan=0, vel=80);
14 : noteOn(note=C3, chan=1, vel=100);
14 : CC(CC=10,chan=0,value=97);
14 : noteOn(note=C5, chan=0, vel=80);
18 : noteOn(note=C2, chan=1, vel=80);
20 : noteOn(note=C2, chan=1, vel=80);
22 : noteOn(note=C2, chan=1, vel=80);
24 : noteOn(note=A4, chan=1, vel=127);
28 : noteOn(note=A4, chan=1, vel=127);
}

pattern boiledClap (steps=32) {
8  : noteOn(note=B3, chan=2, vel=120);
24 : noteOn(note=B3, chan=2, vel=120);
28 : noteOn(note=B3, chan=2, vel=120);
}

section loadPresetsToSynths {
loadPresetsToSynths(chan = 0);
}
section intro {
boiledDrums ( chan = 0 );
}
section introClap {
boiledDrums ( chan = 0 );
boiledClap ( chan = 0 );
}

program BeingBoiled {
tempo ( bpm=204.0, beat=4 );

[ loadPresetsToSynths ];

loop(14) {
[ intro ];
}
loop(80) {
[ introClap ];
}
}

Monday, 6 October 2014

PIANA at the centre of my STEM outreach ...

Here's PIANA, amplified by a Minirig, in my 'insanely portable roadshow' setup. Cool!


UPDATE - here it is playing 7 synths at once with much better sound quality. 




Reinvigorated about STEM stuff

We went to the Bristol and Bath STEM Awards last week at Bristol Zoo, where Ambassadors, teachers, schools and companies won awards for their dedication to all things STEMmy. And I was impressed and humbled and figured, heck, I'd better finish off that packaged presentation and demo I've been working on. Here is a still from what ended up being a dry run - Raspberry Pi in the guise of a Kano doing synthesis, iPad being a really neat oscilloscope so the kids can see the waves, and all I need is to work out which teeny tiny TV to integrate onto the Kano so it can be portable. The Kano keyboard offers some really cute synth opportunities ...


Monday, 22 September 2014

Number one

I feel like Slade. Or Donny Osmond. Or some other long-forgotten crusty old chartbuster. Amazing.


Friday, 19 September 2014

Jordantron is in the store!

It's been quite a while, but here we finally are -


What do I like about this app? Firstly, I did it, top to bottom, so I feel good about that. Secondly, no In-App Purchases - I am so tired of the whole 'keep them paying' concept, so this is it. You buy it, you have it, and any upgrades, any new voices - and we are planning this - will be free. 

So please pop over to the App Store and buy a Jordantron, you know you want it. 

And by the way, look how fast his fingers are!!!! Imagine what it will be like when I get a Raspberry Pi with PIANA into his hands :)

UPDATE - number 3 in UK iPad music sales, number 4 US, number 4 Canada, 5 Brazil. Yay!


Sunday, 14 September 2014

M3000 boot problems

It looks like quite a few people are hitting a problem I can't reproduce when trying to start the latest version of M3000 - it just fails to launch.

If this happens to you just delete the app from the iPad, reinstall it from the store, it should now work. Very annoying and I do apologise sincerely, but at least there is a simple fix.

Monday, 1 September 2014

Aliasing

Here's a before and after - or rather, after and before. Firstly, as it sounds now, in an 'ensemble string' setting. Then, what it sounds like without all the antialiasing / waveshaping work in place. So, had I attempted to do a Phase Distorting synthesizer naively, this is how it would sound.

Yuck.

There are artifacts I'm not happy about, and I can't work out exactly what's causing them, but it's in way better shape than some I've heard!


Sunday, 31 August 2014

Strawberry Sopranotron

People want to hear all the voices in these apps, so I figured the easiest way to manage that was to set up a sequence in Logic that pushes out a MIDI Program Change then plays a sequence, and just replicate that as many times as there are voices.

And here's the first one - Sopranotron in the Fields with Strawberries.


Friday, 29 August 2014

You Rock Guitar and PIANA

This is short and sweet. Sweet ish.


Six notes of polyphony and 60% of the CPU.