[PD] First time PD troubles: A programmers confusion.

Uğur Güney ugurguney at gmail.com
Thu Nov 8 23:34:36 CET 2007


# Hi,
# The framework of PD is somewhat different than Java and Phyton. Java is a
language in which the code is first compiled then run. While running, the
objects are created in memory according to code.
# In PD, you are creating the objects in realtime. If you create (put) an
object its place in memory is allocated automatically (and deallocated when
you deleted it) It is something like a debug mode.
# To have something similar to double or float in Java there is an [float]
object, [f] is its abbreviation.
# [f] is similar to "float x;" and [f 10] is equivalent to "float x = 10;"
# In Java the code is run sequentially, one line after another. But in PD
there is no such sequantial listing. You have to connect events in an
cause&effect manner.
# |bang( is a message which activates the primary purposes of the objects.
For example [f] holds a number. If you send a |bang( to its inlet it outputs
what it keeps, and this output can be used to trigger another objects. You
can feed the inlet other things than bang. (You can look at their help to
learn which inlet is what for)
# so, the idiom "x=x+1" can be done in PD way: Create an [f 0] object. This
allocate a slot for a number in memory and initializes it with 0. Create a
|bang( message and connect to [f]'s left inlet. Create an [+ 1] object and
connect the outlet of the [f] to the left inlet of [+]. When you click on
bang, it sends a bang message to [f], [f] outputs the value in it and this
value goes to [+ 1], plus is triggered by the incoming number and outputs
the incremented number. So, this way we finished the "x+1" part. let assign
this value to x. This is done by connecting the output of [+ 1] to the right
inlet of [f]. Right inlet of a float assigns the incoming number to the slot
in the memory like the left inlet. But unlike it, f does not output if right
inlet is used (which is called "cold inlet") if you use left inlet (don't
use it!) as you can see, the patch will fall in a loop.
# This is some kind of explanation in the perspective of traditional
programming.
# Good luck!
-uğur-



On Nov 8, 2007 11:12 PM, Timothy Sikes <trs164 at hotmail.com> wrote:

> Hi
>
> First of all, this is my first email to this email group, so, I want to
> make sure that asking 'newb' questions is okay, and that this would be the
> place to email those 'newb' questions.
>
> I'll tell a little bit about some things that might be helpful in
> answering my questions.  I started Python when I was in 7th or 8th grade,
> and loved it.  I started working through one of the O'Reilly's Python
> books.  Now, I am taking a Java class, and loving it too ( have a 103%).
> So when I got PD, I thought I would just have to learn how to apply these
> things I've learned in Python and Java to PD.  I went through the
> documentation, and just got confused.  Next, I tried to find some basic
> tutorials on the web with no avail.  Finally, I looked at the examples that
> came with the installation. These were by far the best introduction to PD,
> and I understood them... Until I got to the flow of control ones.  It's the
> one where the counter counts up to ten, then stops, with another that is a
> counter that goes up by one, and you clear it by pressing the -1 button.
>
> Remember, I program,  so if it could be explained as if I were
> programming, that would probably help me.  I don't understand what the term
> 'bang' refers to in these examples, along with why certain 'inlets' connect
> to certain 'outlets',  or the flow of control in the programs, or where the
> 'count' variable is and how to manipulate it.  I feel that once I understand
> these things, I'll be able to have loads of fun with PD.  So, Please help,
> and:
>
> Thank you.
> ------------------------------
> Climb to the top of the charts!  Play Star Shuffle:  the word scramble
> challenge with star power. Play Now!<http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20071109/94a5c5a2/attachment.htm>


More information about the Pd-list mailing list