Hello, via the serialport RS232 I can read my rotary encoder. I want to use the encoder or the values from it to control the playback speed of a video. Unfortunately I’m a newbie and can’t get it to work yet.
I can see the values of the rotary encoder in vvvv, but I don’t know what to do now:
My range is from 0…endless, because I have a infinite RotaryEncoder that counts endless. I don´t know how to range this with a Map Node.
My second problem: With Filestream Node and IOBox (with Slider) I cannot control the film speed properly. I need it as follows:
When I turn the Rotary Encoder, the movie should play at the speed that the Rotary Encoder is turned. When I stop turning, the film should stop. The speed of the Rotary Encoder and the speed of the film should be directly coupled.
At the moment it is so, that the film stops as long as I turn the Rotary Encoder. When I then let go, the film plays at the new speed. How can I change it as described above?
ok, so we’re not talking about “Speed” then, but “Postion”. for this case you’ll need to use the Player (EX9.Texture) node instead of the Filestream, because it will let you access individual frames. see its helppatch. also note the node takes a sequence of images rather than a movie.
since we’re not talking speed, but direct access of individual frames, maybe you won’t need the map node at all.
note there are two Player nodes. use the one that does not have “Timebased” in its version because you want to control it by directly specifying the frame to view. “Preload Frames” is the (oddly named) input that you’ll have to connect to.
and what exact Rs232 node are you using there? it doesn’t seem to be the default one shipping with vvvv. did you build that one? what are the numbers it returns?
Now I´m using the default RS232 node (before it was a node from a patch I found in one of the contributions on the vvvv site). The numbers of the previous RS232 node provided ascending numbers when turned clockwise. When turned anticlockwise, the previous RS232 node provided descending numbers down to the minus range.
The default RS232 node used now provides something different, see below in the screenshot.
I also changed the player node now (to the one without “Timebased”). Unfortunately, I don’t know how to connect the output of the serial node to the player.
Now I have added “AsValue” to the Serial node. The output delivers strongly fluctuating numbers up to approx. 50. If I now connect the output of this to the player pin “Preload Frames” and turn the rotary encoder, a video image appears. Unfortunately, it is not as it should be. Only one frame is displayed and it flickers.
I followed your example screenshot, but it doesn´t work. When I turn the Rotary Encoder, the video plays at too high a speed. Even when I stop turning, the video still plays at too high a speed. The values on the output go crazy on their own.
well, then, as i said, i only made a guess regarding the protocol from your screenshot. the guess was wrong. i’m afraid we’ll not be able to help you further without you finding out more about the protocol in use here.
if this is an arduino code sending the data, you could upload the code here so we can have a look.
It works. But the playback behavior of the player is not as intended: The playback speed always remains the same, no matter if I turn the Rotary Encoder fast or very slow.
How can I link the playback speed to the rotation speed of the rotary encoder? I tried it with a MapRange node, but it doesn’t work well yet:
Currently there is the Enqueue node used to make sure you’re not missing any of the incoming data. in case too much data is coming in in one frame, it is queued and then one value is returned after the other, frame by frame. maybe this is not what you want. instead you could replace it with a CDR node and always only take the last value that was received in this frame. this should already give you a more immediate feedback.