Group Admins

  • Profile picture of Karim
  • Profile picture of Jean


Public Group active 2 days, 8 hours ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

tracing inside recursive patch

Author 2 Subscribed Users |
Profile photo of WindFromWest

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).

July 30, 2018 at 22:19 #27322
Profile photo of Jean

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)

  1. print-called


  2. print-called


  3. print-never-called


  4. print-never-called


July 30, 2018 at 22:26 #27325
Profile photo of WindFromWest

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.

July 31, 2018 at 00:37 #27330

You must be logged in to reply to this topic.

Log in now