< Back to IRCAM Forum

Totaly Confusion with Recursivity

Dear Community,
I need some help: I’m totally confuse with a Problem of a Recursive Patch.
I try to make a Patch who calculated a Sequence of Keys.
So I have written the Function who calculate the Next Key / Note when the Last is given.
See the Patch FunctionFollower
So I have now the Next Note, so I have to give this Note back again to a other instance of this patch
So I have written a Patch who dos this recursively.
See Patch FunctionSpiner.
So this Patch needs now a Wrapper Patch who dos the first step.
So I have written two Wrapper Patchs.
The Patch Test is a simple modification on the FunctionSpiner Patch so that no more special first Input is needed.
The Patch Melodie_Constructor is the simple Try for the final Wraper aka the ready GUI for the Customer.

So that you could see the Patches here are a tar.gz ball with the Workspace

VersucheZurJazzHarmonic.tar.gz (409.7 KB)

Sorry, I have forgotten the description of the Problem.
Lets imagine were would use the Patch Test:
When you try to calculate one to two Note melody’s you get what you expect.
When you try to calculate more then two Note melody’s you get an Error.:

This is the Error:

Error while evaluating the box FunctionSpinner :
ERROR: EVALUATION OF A NULL-INSTANCE BOX

So I not can find-out who the Error is.
Has anybody a imaginaton, or a simple tip to find the Problem

Hi Creco,

You just have to remove the eval once mode in both your patches:
function follower and functionspinner.
see the attachment. (remove the ‘1’ by clicking ‘b’) on both NOTE objects
Screenshot_2020-02-07_01-15-36
Screenshot_2020-02-07_01-16-07
… and please, nest time try to send a MWE (Minimum Working Example), no need to send a complete workspace. For two good reasons:

  1. By narrowing your own problem, you might find by yourself the problem
  2. It is easier for the users to deal with the problem.

Best
K

Ok ,
but in the functionfollower patch there is a Random selection for the next Note
Would it not product different Notes when I remove the Eval-One Instruction

Ok,
this morning I haven’t the time to lock proper at the resolution of your reply.
So I have changed one thing:
I have disabled the evulate-once Instruction in the Function-Spinner Patch.
And So this System of Patches seams to function properly.
But just I have a problem of the “right Understanding” of Evaluation.
When I do this wouldn’t mean this there would be two Evaluations:
1.) By the first Argument of Append
2.) By the second Argument of the self-recrusivity Patch ( Function-Spinner )

So, could someone please enlighten me about this point of Evaluation?

A very silly:

CreCo :roll_eyes::woozy_face::roll_eyes:

Oh Dear,
I’m so silly.
Just I Understand it.:
I don’t have to say Once-Eval Mode for the Note Object.
I instead have to say Once-Eval for the Function to build the Parameters of the Note Object.
So I have, to say it for the Function-Follower Custom-Function / Patch.

CreCo :confounded::confounded::confounded: