Hello all,
I have just started experimenting with puredata and I have been trying to solve this little problem. Basically, I am trying to add two numbers, but my code is broken down into two separate pd files.
The first file "Add_Two_Numbers_Client.pd" is as follows. It generates a number (in this case a value of 100) every second and called the second file "Add_Two_Numbers.pd" which adds the value of 100 to a number obtained from a hslider and outputs the result back to "Add_Two_Numbers_Client.pd".
Code for Add_Two_Numbers_Client.pd
[toggle]
|
[metro 1000]
|
[100]
|
[Add_Two_Numbers]
|
[print "Sum"]
Code for Add_Two_Numbers.pd
[inlet] [hslider]
| |
| |0\
| /
| /
| /
| /
| /
| /
| |
|
[unpack f f]
| |
[+ 0 ]
|
[outlet]
-----End of code ----
The code doesnt work. I always get the following output irrespective of how the hslider is changed:
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
"Sum": 100
What am I doing wrong? Can someone help me out? From a design standpoint, I have to keep the second number (coming from the hslider) in the second file. This is part of a bigger program.
Any help to fix this will be highly appreciated. Thanks.