Administrateur

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Groupe Public active 3 days et 5 hours ago

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

tracing inside recursive patch

Auteur 2 Utilisateurs souscrits |
Profile photo of WindFromWest
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).

Juillet 30, 2018 à 22:19 #27322
Profile photo of Jean
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)

Attachments:
  1. print-called

    print-called.png

  2. print-called

    print-called.png

  3. print-never-called

    print-never-called.png

  4. print-never-called

    print-never-called.png

Juillet 30, 2018 à 22:26 #27325
Profile photo of WindFromWest
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.

Juillet 31, 2018 à 00:37 #27330

Vous devez être connecté pour répondre à ce sujet.

Log in now