• oid

    @whale-av What object numbers are wrong for you? They are all correct for me, only thing wrong that I see is an outlet number, it tries to connect the [print] to the non-existent outlet 2. All you need to do to fix it is change the [loadbang] into an [initbang] and then remove the [delay] and [pipe]s, the [delay] causes the iolets to be created after the initialization phase and after the load phase as well most likely. Same issue, just with a few extra quirks thrown in.
    matrix~.pd
    I also replaced the [metro 1]s with [until]s, we no longer need all those tricks. The [print] still does not connect, I am not sure what that is supposed to connect to, guessing there is an outlet #2 being created somewhere in the patch that I did not see? Guessing this also makes it not work with extended.

    posted in technical issues read more
  • oid

    @whale-av said:

    but strangely

    You are experiencing the same issue as @FFW and using [initbang] for the iolet creation will solve it. I believe your method will only work with extended but it might also work with very old versions of vanilla.

    posted in technical issues read more
  • oid

    @FFW Loadbangs happen after the patch is fully loaded, so after all connections have been made/attempted to be made between all the objects/abstractions in the patch, so those dynamically created iolets don't exist yet and the connections fail. Replacing the [loadbang] with [iemguts/initbang] will cause the iolets to be created when the abstraction is loaded but before it has been connected to the other objects in the patch so you connections to those iolets will not fail.

    posted in technical issues read more
  • oid

    @vamoscreciendo I believe the encoders on the mpd226 are relative? If so, you can use those free pads to switch what parameter they control with my cc abstraction in https://forum.pdpatchrepo.info/topic/13385/midi-rotary-encoders-values-get-confused/2 This will let you control a great number of parameters with just your 4 encoders, as many as you want to switch between. It works with sliders and nbx.

    posted in technical issues read more
  • oid

    @ddw_music said:

    at the same time, I'm a bit bewildered why so many things I've tried to say in this thread seem to have gotten a "well, no, that's not it" where I guess I hoped for a "hmm, that's interesting, have you considered?"

    Forgot to address this. It was the stack confusion, your thinking that I meant there was no stack made your posts come across as non-sequitur and saying I am wrong while not explaining why, just explaining your logic in increasingly condescending ways which made it seem like you completely misunderstood what I said and were stubbornly just saying "I am right." I probably came off the same to you. But that was not the case, we were just having different discussions and not realizing it. Hopefully my previous post where I tried to make no assumptions about anything and use it towards both our views will clear things up so we can get back on track?

    I suspect we also have abit of a personality clash and take things from each other slightly askew from what we intended, generally not much of an issue and we just move on.

    Edit: and you understood that despite my forgetting it in the previous post :)

    posted in technical issues read more
  • oid

    @ddw_music

    grep " goto " pd-0.55-1/src/* | wc -l
    283
    

    There might be one or two comments in there but those are predominately literal gotos. Goto being discouraged is a holdover from BASIC which originally only had goto for moving about in code, it had no functions and literally executed code line by line, as BASIC developed and got other ways to control execution they discouraged the use of goto. In any language with functions or objects etc there is no need to discourage the use of goto since no one is going to try and control program execution through goto for any reason other than an academic exercise. A goto is just telling the IP to goto a remote place in the program code instead of the next instruction, happens everytime you run a function. The most basic implementation of a function:

    function f (a b) {  -- push current address to return stack, pop a and b from data stack, set a and b, goto f
        c = $a+$b -- execute f
        return $c -- push c to data stack, pop address off return stack and goto it
    }
    

    Generally stacks only hold one data type so we would also have to set the return type in the function header function int f (a b) so return knows which stack to push to. Higher level languages just do all this stuff for you. In pd it would be the outlets which are the gotos, outlets are structs which hold pointers to tell pd where to goto next. Possibly the pointers in the outlet struct might just be used for telling the GUI how to draw the wires, depends on how it is implemented and I can think of at least a half a dozen different ways it could be implemented to the same ends. If the stack only holds pointers to objects it is easy for pd to function without a return stack, when it hits a branch it pushes the pointer for the branch, goes down the branch pushing the pointer for each object, pops each to execute (possibly each being another goto) finally popping the return and does the goto to the branch point to do the next branch. The object way I outlined above accomplishes the same thing but I believe it would be a bit more efficient, in that case the stack could be a data stack or a pointer stack which also holds pointers to data.

    Back when I was last trying to sort this out I ended up digging into [trace], it actually has its own stack (possibly two, did not deeply analyze it since it was not what I was looking for). When you turn tracing on it enables tracing in EVERY object on the canvas and they all send their messages back to [trace] which puts them on its stack. This is why enabling trace slows down message passing, also why it took so long for [trace] to get implemented, not so simple as just printing what is on the stack. I think the second stack in [trace] might be a pointer to the pd stack and it uses pd's stack to determine which messages to print and maybe gets part of its data from the stack but as I said, I did not dig into it too deeply and that was awhile back. I suspect pd's stack is a pointer stack but I am not sure if it only holds pointers to objects or also pointers to data, if the latter single stack returns could be more troublesome.

    there are a few legit ways to use them, but otherwise, don't; same for gotos.

    In my experience they are generally used for blocks of code which you need to reuse often but do not work well within the context of a function or the like, would need to be broken up into dozens of small functions which would make the code difficult to read and inefficient to run because functions have good deal of overhead and generally have scope and limited in what they can return. Gotos also have the advantage of being able to return to somewhere other than from where they were called from, which can also help makes things more efficient, depends on the language and how things are implemented. In some languages goto is slightly different in different contexts, in a loop it is the same as break and goto and in a function it is return and goto, etc.

    posted in technical issues read more
  • oid

    @ddw_music I never said pd did not have a stack, I said that I did not think it had a RETURN stack. I don't think I can reasonably respond to your post without risking more confusion.

    posted in technical issues read more
  • oid

    @FFW I sort of thought you meant something like that but wasn't sure. I don't think message rate stuff is flattened and can't find anything in the source but I don't really know, I just don't see much advantage in doing it with how slow and simple message rate is. Thanks for the clarification.

    posted in technical issues read more
  • oid

    @FFW said:

    By the way, it's also the order the process stack is filled because the full tree is flatten before it computes

    Is there a process stack? Can you tell me where to look in the source for it? What is actually on this stack? Is my above reasoning regarding the patch just being a chain of objects incorrect? The patch being a chain of C objects explains why we can't turn off message rate and what happens when pd is running out of cpu but I have not quite grasped how pd's scheduler actually works. I'm guessing my previous post is difficult for a non-native English speaker since my grasp is not great and my explanation is probably not the clearest and I am not sure how well you know pd's internals either. I am almost at the point where I will post on the mailing list to get a response from the devs but I want to get enough of it that my post is not just a very verbose way of saying "I don't get this, explain the entire inner workings of pd for me!"

    posted in technical issues read more
  • oid

    @ddw_music All that stuff about instruction pointers and the like was me getting turned around and falling back onto Fourth because that is where my mind goes when I think about stacks. In pd there is no instruction pointer so never any need to return or backtrack or goto. In pd's core, every internal and external object is a literal OOP object and the inlets and outlets are methods of that object. When we create a new object pd creates a new C object of that type and makes an entry for it in glist with its pointer and UI details; when we connect a wire to its outlet pd retrieves the pointers to those objects from the glist and then goes through the outlet method. I am not quite sure how it deals with reaching the end of the branch, I suspect that the last object always has its outlet method run to point it at the branch point and when we append a new object pd just passes that to the new object when it updates the previous end of chain object's outlet method to be the new object.

    Some details there might be a tad off, I am not quite good enough with C pointers to really follow pd's source yet, but I am fairly sure that is the mechanics of it. I have no idea about how Max handles this stuff but I would assume it is quite similar.

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!