< Back to IRCAM Forum

Tracing inside recursive patch

I’m teaching myself OM and getting back into LISP. I have written a recursive patch to apply a list of intervals to a root note several times. It works sometimes, but not others. I’m trying to trace the values inside the recursive patch, but if I add LISP print commands, I see nothing. The patch is attached, showing where I’d like to print. What am I missing here? The inputs are: 0 - the root note, 1 - the number of repetitions and 2 - the scale that is being built (initially nil).

build-diatonic-2.omp (5.09 KB)

Hi — Your print functions will never be called if they are disconnected from the call graph of your patch.

As print just returns its input (after printing it) you can just replace the first situation below (print-never-called.png) by the second one (print-called.png)

print-called.png

Thanks - I could find no documentation on LISP print, so it’s very helpful.

By the way, I found the problem without tracing. I had built the original based on C, 1200, and was multiplying the root by ‘n’, which works for C, but not anything else. I fixed it by adding 1200 to each previous rootnote and now it works in all keys.