Experiments in Flash I

Following on from previous research into cymatics and my wondering whether it was possible to create a virtual tonoscope…

Disco_Flakes_Lewis_3
Click on the image to load Flash in a pop up. Move the mouse to the right to contract/speed up and to the left to expand/slow down the oscillations. Click the icon (bottom right) to start again.

… an instrument which allows you see the pattern a sound creates – I looked for examples that would allow me to play with particle systems in 2D and 3D.

This demo isn’t actually based on the physics of vibration induced standing waves as in cymatics – rather on oscillation, randomness and reflection. But they do have a very similar look about them…

and here’s the source file: disco_flakes_lewis_3.fla with my comments in the code.

I’m no programmer – but I can ‘hack’ code – so I was looking for source material I could play with and adapt. I already knew of robertpenner.com and levitated.net and these led me to bit-101.com and beyond… There’s some truly inspired open source code out there and I must say thanks to those people for their generosity…

I’ve also realised, quite early on, that Flash isn’t necessarily the best platform for this… and so I’ve also started to look at using the ‘open source programming language and environment’ Processing which I’ve been interested in exploring for a while now. That said I’m going to focus on Flash initially…

To be systematic about this I will:
i) choose a key example to adapt
ii) decide what to do with it
iii) then extend and implement control via
– mouse and keystroke
– sound input
Adam Hoyle‘s MIDIRemote – getting MIDI note and controller data into Flash

I’ve started with:
i) Robert Penner’s Disco Flakes which creates simple cymatic-like patterns
I’ve mostly managed to:
ii) strip back and replace the existing particle animation; tweak the equations to explore the maths; dampen things down – its a bit too uncontrollable; create more complex patterns using reflections or multiple particle groups
but still have most of this to do:
iii) retune existing mouse control – implement keystrokes for specific mouse positions i.e. patches; definitely make reactive to sound input – very tonoscope like; use MIDI controllers for mouse x & y values – select additional variables to vary within the equations; MIDI notes to mirror keystrokes

I think the demo shows I may be on to something – which is heartening…

2 Responses to “Experiments in Flash I”

  1. Lewis says:

    I need Flash for Dummies

    I’ve just spent ages trying to implement control via key down for the earlier disco_flakes_lewis_3 example – a struggle which only reaffirms that a little knowledge is a dangerous thing and I’m no programmer… it took me hours to do what any competent actionscripter would have done it minutes… ho hum…

    Since I realise my time isn’t truly wasted I’ll summarise what I’ve learned:
    1. I was trying to work with the keyListener function as suggested in the AS reference but in the end discovered that onClipEvent(keyDown) was what worked – and then only within the symbol definition script itself. There’s obviously a lot about hierarchy, globals and passing on of variables that I still don’t quite get. I should go back and try to rework this example exloring global properties… which I also think will make other data input methods easier to integrate in the future…
    2. Using trace() and the Output window is useful… systematically trouble-shooting the code does help identify where things aren’t working… but unfortunately doesn’t tell me how to fix it.
    3. Using the online Flash reference is helpful if a bit overwhelming – as well a googling for examples… but only when they’re right…

    Globals can wait… I got into working out the code to create a series of bounding shapes for the particles – starting with a triangle… and with a bit of schoolboy maths and some head-scratching managed it. I’ll make another example file which includes all these developments…

  2. Prodical’s Blog » Blog Archive » Demos… says:

    […] 6 of my adaptation of Robert Penner’s Disco Flakes which I first posted a couple of years ago in Experiments in Flash I… and though I typically failed to follow my own development plan and went off at a tangent I […]