We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello all,
I am very new to Processing so would appreciate your help.
I have 4 objects painted with BARE conductive electric paint. I have 4 short video clips for each object. Each object has its own video clip. I need a video clip to play when an object is being continuously touched, and for it to pause when the hand is taken off the object.
I have connected a Makey Makey + Alligator clips to the conductive painted objects and also the space bar on the makey makey board. I used the paint on the table surface, so when touching this and the painted object the cursor space is moving in a text doc (just to test).
One of my videos is called M1.mov
The code I have at the moment is but I don't know if it is any good?
import processing.video.*; Movie M1;
void setup() { size(640, 360); background(255); M1 = new Movie(this, "M1.mov"); }
void draw() { background(0); }
void keyPressed() {
if (key == 'r') { image(M1, 0, 0); println("r"); } }
void movieEvent(Movie m) { m.read(); }
Many thanks to all who can help, Vara
Answers
Please edit your post and format your code. Select your code and press ctrl+o and have an empty line above and below your code.
You need to call
M1.play()
orM1.loop()
in setup for the movie to play. However this does not do what you want. The following does.Kf
Thanks kfrajer
I get the following error:
2017-02-24 20:10:59.991 java[13518:2017315] 20:10:59.991 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
https://forum.Processing.org/two/discussion/16476/how-to-make-keypressed-respond-to-the-number-of-times-the-key-is-pressed
This seems very complex?
If I could test with one object just to start off the with, it would be great. So i touch the object and .mov file starts playing the video.
Actions ( I hope to achieve)
One end of Aligator clips is attached to object and the other on earth on the makey makey. I touch my hand on conductive paint on table and touch object and movie starts playing.
Need help with code aspect of this please
Thanks
please don't post duplicates. i have deleted the other.
@vvara19 --
The key thing to understand is this (from the Makey Makey website):
So you need a sketch that, when you press a key it plays a video clip (if it is not already running).
When you release a key, it pauses the clip.
(This is the design of @kfrajer 's example above.)
Once you have this working for one clip, do this with different key values for multiple clips.
There are working examples in Processing Examples that show you how to work with video. Look under
Examples > Libraries > Video > Movie
If the video library isn't working for you at all, even with just testing the pre-installed Examples, you may need to solve this issue first.