• oid

    I guess I went off on a tangent there, went into implementation and lost focus. The important thing there is that abstractions are not functions which you return from or objects you point to, they are macros which expand in place. We can sort of use them like objects or functions but they are macros from the users perspective and that is what we need to keep in mind.

    posted in technical issues read more
  • oid

    Probably best to skip this post and just read the next, will leave it here since it could result in useful replies from those who understand the internals of pd and perhaps some people here are as interested in these sorts of details as I am,

    @ddw_music I think pd uses the stack in exactly the same way but the difference here is that pd lacks a return stack (and stack/instruction pointer manipulation); abstractions are actually macros which are expanded, they are not functions which are pointed to and returned from. The unique ID given to an abstraction when it is expanded allows us to use them sort of like functions and mimic scope but pd is a very simple globally scoped imperative language.

    Edit: I guess pd does have very basic IP manipulation, [send] is essentially a goto. The big difference with pd and dataflow is that the IP carries a bit of our data with it as it moves through the patch. The result of an operation does not go onto the stack but is carried with the IP. Or maybe data is only carried with the IP in a conceptual sense and result actually is TOS? Think I will have to investigate pd's stack when I have the time.

    Edit2: I guess wires are also gotos then. I suppose what this really is is that pd is a 2d language, [send] and wires only seem like gotos if we try and think of pd as a 1d text language.

    Edit3: (last one) Pd would have a return stack, but the returns always point to branches. A [t b b b b] is essentially push and drop commands for the return stack, rightmost bang pushes, leftmost drops. End of the branch having an explicit pop so it can return to the [trigger] or where ever the code branched. More like other languages than I thought in stacks, assuming my reasoning is sound, the big difference being that pd has no concept of anything remotely function like. IP probably carries the pointer as well as the data, would save popping everytime it return which means no return stack and back to my original point of pd lacking a return stack (subrosa edit4.) But that would mean the IP caries a return stack in a rather funge like way, which it might, the return stack is part of the IP object and not the interpreter proper (subrosa edit5.)

    posted in technical issues read more
  • oid

    @ddw_music said:

    "Return to caller" as in any structured or object-oriented language is nicer

    I think this thread may have convinced me that the idea of return to caller is antithetical to dataflow, it goes against the flow of data and my solution which you said side stepped it is just restating the problem into dataflow. Not that this was my intent, didn't even realize I sidestepped it until you mentioned it but it got me thinking. Not sure if it is even possible or practical to avoid but I think I am going to try and be more rigid with the flow of data for awhile and see what happens.

    Here, I'm referring specifically to

    That is what I originally thought but the previous post confused me, I now realize that you weren't addressing my patch directly but offering a summation of what you got from the thread in your reply to me.

    whereas most other solutions posted here seem to assume it will always be a single float):

    Just replace [array] with [text] and make a tiny change in stream.pd/add other abstractions asStream can load/change the arguments it is loaded with. I switched from [text] to [array] because you used an array in your SC example and I switched tactics to confront your example head on. Originally I thought your ignoring the suggestion of [value] was that you wanted to use things other than floats and then thought that what you were having issues with is the methodology. This is probably a part of the problem porres mentioned about people having issues transitioning to pd from another language, you have a good grasp on programming and when you ignore a solution which seems the easy/obvious solution to us it is easy to assume you have a good reason for ignoring it. These sorts of assumptions are probably reasonably common in such situations, we all gave up on the suggestion of [value] early on and it came back into the discussion purely on accident.

    It has been an interesting thread, the failures in communication ended up surprisingly insightful on many fronts.

    posted in technical issues read more
  • oid

    @porres I am more than happy to answer any questions you have about using it or how it works. As I said in the other thread, I hate doing documentation, it tends to turn into a rabbit hole for me and eat up a good deal of time; once I start thinking about usage I start seeing how some things are not right in the abstraction and I start fiddling which means a change to the docs and it quickly turns into a feedback loop. That small change to the manual I suggested in the other thread caused/required me to reread much of section 2 and reread a few sections many times even though I had it all typed out after reading two short section once.

    I don't think extending pd would solve this issue, the question was not really how to do this in an isolated situation but about the methodology. How do you do something like functionA (functionB (1 2) 849 functionC ($1 $2) asdf) in pd? In a one off situation it is generally a fairly simple problem to solve but to make it so at anytime you can do the equivalent of [abstractionA [abstractionB 1 2] 849 [abstractionC $1 $2] asdf] is a much more complicated issue and one which externals don't solve and often make it seem more complicated than it actually is because they have a tendency to make pd feel like a higher level language than it is, keep the user from ever really learning the nuances and techniques of the low level dataflow paradigm that is pd. The one off solutions which often come up in these threads result in what I think @ddw_music refers to as "spray everywhere," to try and build that solution into every abstraction so you can use it everywhere but to get the equivalent of abstractions calling abstractions would require you to fill your abstractions with [v ]s and [send]s and [receives]s in the vain attempt to cover every possible situation and very complicated/convoluted bit of inter abstraction communication. All my posts since the first asStream screenshot post have been about methodology, how to build higher level paradigms in a low level language like pd and avoid spraying everywhere, this is what asStream is meant to show. Like any well founded low level language pd is quite good about giving you the tools to build out higher level functionality and adapt it into your own language. At least that is what I got from this thread.

    asStream has the potential to be a really useful abstraction but still has some issues, I can help you understand it and flesh it out, just ask your questions, they will probably make it a better abstraction than either of us could make on our own. As an exercise I will attempt to repatch it in your heavily subdivided patching style on my next break from my projects, I will probably fail but it will be interesting, I get the logic of the style but it obfuscates the dataflow for me and anytime I want to understand the work of a subdivider I have to remove all that subdivision, I can't even see how it could be subdivided into discrete, well named subpatches of highly singular/specialized function, for me it already is that.

    posted in technical issues read more
  • oid

    @porres No help file, usage notes in asStream.pd, this thread is the documentation. If I ever get it to the point where I don't think there will be any major changes I will upload it with help files over in Abstractions. But a new version, reworked it as an array object since that is what it really is. Also added looping. Still needs lots of work to be a useful abstraction for more than learning from, it is kind of fun though and eventually I will develop it more.

    asStream.pd
    stream.pd

    @ddw_music said:

    Though this means that your approach could be used only in self-timed situations,

    Just need to change [obj 10 10 stream $1 $2 $3...( to [obj 10 10 $1 $2 $3...( and add in some simple logic and now asStream can load the abstraction you specify through methods/arguments. As I said earlier, you design the interface and the protocol which is what those sends and receives and values and dollar arguments in asStream are, an interface and protocol for communicating with the stream.pd abstraction or any other abstraction designed to work with that interface. Object names themselves can also be filled in through arguments, [$1 $2] can be either a metro or a receive or anything else but [$1 $2 ....] are actually [list]s so they only give you two inlets and one outlet, if you need more than that you need to resort to editing the abstraction in a text editor, patch it together with any object with suitable io and then open it in a text editor and edit that object into $1 $2... And there is plain old dynamic patching to programmatically create the required patch. Lots of option and they can all be mixed.

    posted in technical issues read more
  • oid

    Realized my errors finally, extra output was because I forgot to add a [- 1] after a [list length]. The [v ] not resetting was order of operations but decided that the logic of automatically resetting to zero was flawed so now it resets only if you send [start( when it is at the end up the array. The stupidest mistakes are always the hardest to see. Fixed and added an optional delay before the metro so they don't have to all start at the same time. Fixed [append( as well and give it a right inlet for appending without the [append list( which is probably how it should be? Still could use some logic to make sure you don't duplicate streams and perhaps the ability to configure individual streams but that is for someone else or some other day. Added some usage notes in the patch.

    Improved version below.

    posted in technical issues read more
  • oid

    @ddw_music Value has been mentioned multiple times in both threads :) It has been fun. I took a break from my projects and threw together asStream, it will be awhile before I get back around to it but here it 99% complete, there is a stupid error on the append so it is actually insert and for some reason I just can not figure out it is not resetting the [v] when it completes. You can solve those if you care. Oh, and it spits out an extra repeated number second to last, at least with my simple test, not sure why but worst case a [change] between the [array get] and [s] in stream.pd will fix that. Report back if you figure out why it is not resetting to zero, driving me nuts but I have other things to do. Patch in next post.

    Not sure what you mean by "spray everywhere," these are targeted approaches and there is no copying. Does reallocate on resizing the array but that could be avoided easily enough, just use an array bigger than you will ever need and only use what you need.

    posted in technical issues read more
  • oid

    @ddw_music said:

    The latter is what I'm after

    Oh, that is simple enough to do, just replace the [f ] in the stream abstraction with a [v ] shared between the abstractions like the array. Getting there?
    maybe.png
    Obviously you would want asStream to create the [array define]s as needed and the symbols for the array and value having their own iterators so it can manage multiple streams but that is simple enough. Oh, and register its array and value symbols so you can grab them as needed and append to the array and what not.

    posted in technical issues read more
  • oid

    @ddw_music said:

    Seems to me English is not up to the challenge here.

    We just needed to identify the actual issue here, which is not patching but low level language. To do the sorts of things you want to do means you have to define an interface and a protocol, those things which high level languages like SC take care of for you. Pd has no concept of an instrument and if you want to use such a paradigm it is up to you to implement it. One way would be to send the instruments args to a master abstraction which then takes the necessary actions, a quick and simple example which is not fully fleshed out but should show the logic:
    d.png
    Started adding in my $0s halfway through. You would probably want a [text] in [register] to keep track of all this stuff and it can also keep track of values you can query for in the various abstractions and what not through their send methods. [stream] would need some more logic, needs a [receive] to start/stop it and probably would want a way to change its settings as well as an [iemguts/canvasdelete] so you can clean things up as your patch changes. [synth1] seems pretty complete and a solid instrument, I wouldn't change it.

    posted in technical issues read more
  • oid

    @ddw_music Had some free time before bed so read your link, don't see anything there which would not translate to pd/data flow without issue.

    each player needs its own [metro], and a way to pull from the stream.

    like this?
    a.png
    All of this can easily be worked with each instrument being an abstraction using the right inlet on the array get or arguments or sending the pointer. Skipped some of the details but duration and getting the stream into the individual abstractions is straight forward enough and more of the same. I can't tell if I am missing something, life outside of data flow has become weirdly abstract for me, I am one of those sorts who really took to it. I am very interested in know what I am missing if I am missing something, I have been trying to cure my data flow myopia, it has become a bit of a disability in the last year or two.

    Edit: Or is it that you just don't like that each needs its own metro? If so I think your issue is not with patchers/data flow but low level languages, pd is low level. But that is what abstraction and externals are for.

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!