• torchflame

    Hey everyone,
    I'm currently writing an external that accepts a list of arbitrary length (say ``a'') and does some processing on it. In my particular case the list is comprised entirely of floats. My problem is I need the output to be a list where the length is dependent on the size of the input list. I've been looking through the list source code, but I can't figure out exactly how to create a list of any length. If I always knew the length of the input list, I could just create that many outlets, but I don't want to do that for this case. Does anyone have any pointers?

    posted in extra~ read more
  • torchflame

    Okay, I think I get it. It was the class_addmethod that was mixing me up. Thank you so much!

    posted in extra~ read more
  • torchflame

    No, I'm sorry, I'm not quite getting it.
    If, for example, I have *inletA = t_inlet inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("foo"), gensym("bar"));. how would I go about assigning this to a method, say floatmethod, for a float coming in?
    I guess I'm asking more for a more concrete way to think about this routing, because I'm not even sure where to start with it.

    posted in extra~ read more
  • torchflame

    Hi everyone,
    I'm starting to branch out in my externals, and I'm starting to approach the point where I need multiple inlets. My problem is that I'm not quite sure how the code works here. For example, I know about the inlet_new() function, but I don't know how the inlets are distinguished.
    For example, if I place inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym(""));
    in the constructor, I can access these inlets in the class setup as
    class_addlist(test_class, listMethod);
    and
    class_addanything(test_class, anythingMethod);
    but I have no idea how this actually works. If I try to take in two lists by replacing the "" in the constructor with "list", I get a number of compiler errors.
    So, I guess my question is: how does pd actually handle inlets, and how do I distinguish between multiple inlets of the same type in code?
    Thanks,
    Brian

    posted in extra~ read more
  • torchflame

    Hi everyone,
    I'm working on prototyping a few functions through externals, and every time I try to iteratively build up the C code I'm forced to quit pd, wait a few seconds, and then reopen to get pd to reload the pd_darwin file. This works, but is annoying and repetitive. Is there any way to force pd to reload the libraries its using without restarting?

    posted in technical issues read more
  • torchflame

    Hi, I'm looking to create an abstraction which takes a symbol as a creation argument (i.e., [ABSTRACTION symbol]) which then selects one piece of data coming in to it. I'm using OSC, and I get in a data stream like "/a 0 /b 4 /c 5 /d 8 ...", and I'd like this abstraction to have creation arguments so that [ABSTRACTION /a] returns "0". The actual project is a bit more repetitive, so I'd like to use abstractions, but I'm having trouble actually selecting the specific data. I know that [route /a] would work, but is there a way to tell [route] what to route? I know [route $1] doesn't work, but I'm looking for something that could possibly work like that.
    Thanks in advance!

    posted in technical issues read more
  • torchflame

    Hi everyone!
    I found this thesis from 2008 online and was reading it, when it occurred to me that the author's ideas about quasi-periodic sounds being more pleasing could be tested and mocked up in pd. Here's the outcome! Because of the thesis, this had to be licensed under Creative Commons 4.0 BY-NC-SA. Sorry!
    [rosc~] takes two creation arguments, and every cycle of the sine wave it generates a random frequency in a specific range to use for the next cycle. I played with it a bit and found that a range of 2 sounded the best to me, but it does require some calibration. Sorry if I'm not too clear right now, it's really late, and the help file should clear up most confusions.
    Hope someone enjoys it!

    http://www.pdpatchrepo.info/hurleur/rosc~.zip

    posted in abstract~ read more
  • torchflame

    Hi everyone!
    I was looking through the boards to try to find the answer to a problem and I found a request from two years ago for the ability to turn a decimal input into a fraction, and I thought of it as an interesting programming challenge. Here's the result!
    [dec2frac] works with float inputs of up to 5 decimal places due to the limitations of the float type. If anyone's interested, I'm more than happy to share the source code, even though this is a really simple external. I hope someone gets some use out of it!

    http://www.pdpatchrepo.info/hurleur/dec2frac.zip

    posted in extra~ read more
  • torchflame

    Hi everyone,
    I'm working on two externals for a personal project, and being new to writing these I have two questions. I'm working on Mac OS 10.8 in Xcode 5, and I've worked through the standard tutorial.
    First, is there some way to take a list as an inlet? In the external, would this read to an array?
    Second, I have a bunch of sends in a patch that need to be manipulated in a certain way which is easy to do in C, but tough to do in pd. Is there some way to retrieve sends of a certain format (e.g., data1, data2, ... dataN) into an external?
    Thanks!

    posted in extra~ read more
  • torchflame

    Wow! Apparently my laptop went all weird. It seems that [route $1] does in fact work.

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!