MIDI CC Data Increment to Flash

Hi there,

got new questions about MIDI patching in vvvv.
I have a university project running that needs to control variables in Flash AS3.
I’d like to use a Doepfer Dial electronics board (also known as pocket dial) with 6 endless rotary encoders (connected via MIDI to my Audio Interface) to increment and decrement these variables in Flash.

I got this dial board to work with the MidiController (device relative) node. But it works only with MIDI CC’s
(using its preset 85).

The device has also a preset for CC:Increment/ Decrement.

Is there a way to use this preset?

Maybe it’s easier to patch with the working CC’s. But here I could need some help on how to make this incrementing/decrementing my Flash variables.
So the patch needs to increment/decrement a variable in the Flashrenderer by a specific value if I spin the rotary encoder up/down. As I’m new with vvvv I dont’t know how to get this working.

Thank you for any hints how to solve this!


Ok, am I right using the counter node for this?

Now I can count a value up using the change node for the rotary output. But I still have to find a method to count down, when the rotaries output is getting smaller.

Hi m0m,

have a look at TogEdge(animation), that will give you different outputs depending on increment or decrement.

Taking to flash as3 isn’t too straight forward. Communication with AS2 can be done using the Renderer(Flash) node via the ActiveX control. For AS3, you have to use the OSCEncoder(Network) node in vvvv to talk to a program called flosc, which then talks to flash through xml sockets. (I think this issue with the Flash renderer and varibles in AS3 is being looked into.)

You ll find some examples on the flosc website (linked from link above). You’ll also find a lot more info here.

Any problems, please ask.

Hi xd_nitro,

thanks for your help! Just tried TogEdge for my patch. The problem here is, that it toggles only when it get’s 1 or -1. But my MIDI CC value changes only ~0,035 with every rotaries position change.

So I first need a way to get the changing appearing as 1 or -1. But if this would work, I won’t need any counters for adding this to my variables :-)

Maybe there is a way to save a rotarys value, and when getting the new value by spinning rotaries, substract the saved from new. round this to 1 and add it to varXY. Little complicated but should work, don’t you think so?

I’m sure there is a better solution using TogEdge, please betray it to me.

Thanks again!

I read some about flosc couple minutes ago. This option would’t be so bad, because the flash interface controls some sounds…

What about setting the value of the rotary encoder to 0 after every changing? This way I would always get 0,035 / -0,035 and no additions of these values. By rounding this up to 1 / -1, I could use the TogEdge I think.

now the output value jumps to 1 / -1 on rotary up / down.
problem is that TogEdge isn’t working correctly, think I forgot something?

TogEdge behind output value, then counter, connected with up and down.

The counter’s output swaps 1 up but immediately 1 back down on rotary up. On rotary down nothing happens to the counters output.
If i remove the connection between the TogEdge’s and Counter’s down pin, counter’s output works fine on rotary up.

patch is attached, thanks for your help, guys!

MIDIController Doepfer Rotary.v4p (9.8 kB)

togedge is working different: bangs if value change from 0 to 1 or from 1 to 0.

you can use >0

MIDIController Doepfer Rotary.v4p (8.6 kB)

great! thank you so much

you can also do it with + and framedelay, like you suggested. but here we all can see, how urgent the framdelay needs a slicewise initalization…

MIDIController Doepfer Rotary-1.v4p (7.9 kB)

Thank you tonfilm, too! Framedelay is an intersting node.

Here’s my patch sending OSCpackets created from the Midi CC Output on change. Receiving in Flash with flosc-0.3.1.fla works fine.

Now I have to get this to an AS3 document’s var. This is kind of hard for me, cause every tutorial I found uses AS2. I’m relatively new with Actionscript, I started with AS3 and unfortunately have no idea of AS2.

Does anyone has some examples for me? AS3 codes receiving var values from flosc?

Any other hints on how to start this up? Maybe using an AS2 file as a bridge to AS3 file, or something like this would be great.

MIDIController_Doepfer_Dial_1_Rotary.v4p (12.9 kB)

i have some as3 samples somewhere, will dig them out and get you something in next day.

Looking forward for your examples!

I found this package including AS3 classes for setting up server connection, build and send XMLDocument-encoded OSC packets here.
But I’m not sure if this fits for me and how to use it. So I am still looking for example AS3 codes…

there is an easier way to communicate to flash as3. check out this discussion, patch included

I’ve attached a zip with an AS3 sample project along with a vvvv patch. You need to make sure you have flosc running.

The method u7angel has pointed you to does work but it is a bit of a hack and it might not be as efficient because the it relies on checking and renaming variable’s every frame.

My samples is based on event handlers so if no data is being sent flash isn’t doing a lot other than listening. Mine may be more scalable in term of allowing much more complex data structures and could be developed further so it works dynamically with spreads from vvvv.

Let us know how you get on. (11.2 kB)

it is very efficient and you dont have to rename variables. if you just want to send values just leave the names as they are. and you dont have to use another program (flosc) just to communicate with flash.

and hacks are cool if they work and make life easier :)

Thank you both!

xd, this works fine! Glad to have such an easy AS3-example. Works even fine with my vvvv-patch, if you use the package I linked. In this version you can also use type i (integer) arguments. I think this is the only change. I’ll integrate this to my code, today.

u7, I read this thread a few days ago. It seems easier, but I decided don’t using the FlashRenderer node might be better, because it doesn’t likes the flint particle system I use in my AS3 code(???). If I can make this work in the FlashRenderer, I can spend this time to get flosc running. Flosc is quite better for my project, cause NI Traktor gives an audio-output and understands osc, too.

Glad it has done the job. I haven’t looked at the integer arguments side of things, please post a sample.

hey xd, will post sample zip if everything works fine…
have you tried sending OSCpackages from AS3 with the fwiidom package? I haven’t get this working yet

sending from flash works fine, now. as3 document is a little messed up, but will clean up and post, soon.

i want my patch to hit a counters reset on incoming OSCpackets. Problem is, that the default value it should use, is also from the incoming OSCPacket. I tried several delays and buffer nodes without success: the reset is absolutely in the same frame like the incoming value gets to default in. so i always get 0. can someone please tell me which node i should use for that?

here’s my patch

MIDI_to_Flash_&_backv4p.v4p (24.3 kB)

I don’t totally know what you’re trying to achieve but from looking at your patch you may just need a framedelay(animation) node somewhere between your Arguments and the reset or default pins on the counter. You could also make use of the OnReceive pin on the OSCDecoder (Network) pin.

If this doesn’t work and you need more help are you able to post a patch that simulates the data coming in so I can run it without trying to setup a flash file etc?