-
Keiko
Hey,
I have some problems in PD (again).
I attached a patch that is not everything I made, but I deleted everything that does not beong to my problem.I want to change the volume by a color controlled detection. That is made with processing and the information is send via OSC to pd. These are numbers between 0 and 240. The transmission is made by "/y".
BUT the volume should only be changable when it is activated by chlicking that key "n". I solved all the things till this moment. But if the n is pressed again the last number that was transmitted should be fixed. I tried to use a toogle, but after it was deactivated the toggle sends 0 and so the volume is 0.
In other programming languages I would you if then else expressions and a variable that saves the number, but no idea how to this in PD.
The patch is maybe a bit complicated, because I tried things that didn´t work, but I didn´t deleted them to show you what I´ve tried. Hope the patch is useful.
Thanks a lot,
Anna -
Keiko
Hi,
I attached a really small patch I created to start a soundfile when a face is infront of the camera.
I use windows, so I use Processing to detect the face. That is the [OSCroute /face] object. /y is another parameter (influenced by a color detection) that should later controle the volume.
If there is a face, than the value of 1 is transferred to /face and the tabplay should start and loop. If there is no face the value of 0 is transferred, but I don`t know how to stop a play. It should stop directly and not after the ongoing play is finished.And moreover, it should stop, if the value of 0 is 2 seconds constant, because the face detection is not always stable.
And another problem, I don´t know how to use the onebang correctly.
Can you help me? That would be so great!
Thanks a lot,
Anna -
Keiko
That looks great. I will use this kind of patch in my version.
Thanks a lot
-
Keiko
Hey,
thanks a lot for your help.
After some time I made a big patch. I used the last one you posted to make it work, thanks for that.But now I mentioned that I need to send two numbers (variables) via OSC over a network to another PC.
A attached another really small patch to show what I want to do.
I don`t know how to tell PD what /key and /keyname is.
I looked at the helpfile, but it didn´t solved this question. I also found this post:
http://puredata.hurleur.com/sujet-2942-osc-messages
But there I can´t find a variable like mine.I hope you can help me (hopefully the last time, I need it ).
-
Keiko
Wow, it´s only one object and it does exactly what I want.
Thanks a lot.
On the one hand it works, and on the other hand I learned how to work with variablesthankful regards,
Anna -
Keiko
Hi,
thanks for your work.
I read the comments and I will have a deeper look into the topics you mentioned.Should the patch as you attached it work? Because now it does the operation (devide with 240) always... it does not check the toggle I think.
You both don´t know how much you help me
-
Keiko
Hi,
thanks for the answers.
I tried to work that out and attached a very small patch that tests what toxonic wrote.It´s getting better, but it´s still not exactly what I want.
What it does now:
if I change the number (right inlet) and then activate the toggle, it divides the number 240. But if the toggle is still activated and I change the number it does nothing until I deactivate the toggle and activate it again.
Another problem: If I deactivate the toggle the number is send.What I want it to do:
At the moment I deactivate the toggle the last number with the activated toggle should be fixed.
For example:
The number is 120 and the toggle is activated, the outlet gives 0.5. After deactivating the toggle it should still be 0.5 no matter if I change the number or not.
AND the outlet should be changable by changing the number at the moment when the toggle is activated.Is that possible?
It looks much better now, thanks.
I thought I have to declare the variables before using that, but it works, not correctly, but I´m working on that.Thx,
Anna -
Keiko
Hi,
thanks a lot for the really fast help.That looks really good! I just tried a bit and I think that could handle my problem.
But one question to the expr object: Is it possible to have more than one input variable? I searched in the help files but I havn´t found an example like that.I want a variable for the toggle and one for the incoming numbers.
"if toggle = 1, number/240, the last checked number"Thanks a lot!
-
Keiko
Thanks a lot, that helps so much.
But I have a question: How does the change object work?
I think it changes the 0 at the ende back to 1 to start the new trigger, but how?So, I try to figure out how to include the counter.
Thanks a lot!
-
Keiko
Thanks for your help, but I have still problems.
I uploaded a rar file that includes a sample and the pd patch.I left out the counter thing, because I didn´t make the stop sample work.
Any suggestions how to solve it?Thx,
Anna