< Back to IRCAM Forum

Help request with :menuins

Hi All,

I am working to an update of my library, and I would like to use :menuins characteristic. I have this code that runs good in preliminary lisp box in a OM patch, but adding menuins I receive the error:

Error while evaluating the box CHORD+FADE 2 : Undefined operator fdsdb_xxth_ct::voices in form (fdsdb_xxth_ct::voices fdsdb_xxth_ct::finalfig)

or, commenting :menuins, the error

No method is defined for these types in box CHORD+FADE 2

Here is the code:

(om::defmethod! chord+fade ((mc list) (fade string) (fig string) (sorting string) (dur number) (quant number) (forbid list) (duratt number))
:initvals '(nil “in” “figures” '> 4000 8 nil 1/32 4000) ; an initial values list
:indoc '(“Chord midicent list” “Fade-in or fade-out” “Function figures or figures2” “Ascending or descending ordering” “Overall duration (ms.)” “Quantization” “Forbidden values” “Duration of attack”) ; an string list with short docs
:icon 125 ; the icon
:doc “chord+fade.
Realize a texture composed by a chord as attack of the same chord in fade out form, or a fade in chord that has a bvrief chord as attack of its delay…”
:menuins '((1 ((“in” 'in) (“out” 'out))) (2 ((“figures” 'figures) (“figures2” 'figures2))) (3 ((">" ‘’>) ("<" '<))))

(let*
(
(in-chord (om::sort-list mc :test sorting))
(finalfade (if (equal fade “in”) '(0 1 100) '(0 99 100)))
(finalfig (if (equal fig 'figures) (fdsdb_xxth_ct::figures-nograce finalfade (length in-chord) dur quant forbid) (fdsdb_xxth_ct::figures-nograce finalfade (length in-chord) dur quant forbid)))
(finalfig-voices (om::voices finalfig))
(fade-voices (loop for i in in-chord for k in finalfig-voices collect (om::make-instance 'voice :tree (tree k) :chords (list i))))
(ratiodur (tree2ratio (tree (first fade-voices))))
(attvoicechorddur (loop for i in ratiodur collect (om::omif (plusp i) duratt i)))
(attack (make-instance 'voice :tree attvoicechorddur :chords (list in-chord)))
)

(x-append attack fade-voices)
))

I have read the page Writing Code for OM | OpenMusic, so any help will be appreciated, thanks in advancer.

Ciao

Fabio

Dear Fabio,

I have downloaded your latest version of your library version 1.3 and the source code of CHORD+FADE method is not there. So I assume that it is a new method you are working on.

In your Message here, it is not code friendly, If you need me to look into it please do send me the code file in attachment. Because Discourse just prints out garbble asccii if you don’t quote it. So copy/paste is rather not helpfull. Just attach the code as a lisp file. I am sure it is not a big issue. And I will be glad to help

And if possible, a patch example, because i think it is a method issue and not a menuin one…

Best
K

Dear Karim,

Thank you for the reply. Yes, this is a new function for a future update of my library. I enclose the files.

Texture.lisp (1.7 KB)
FDSDB_XXth_CT.lisp (9.6 KB)
chord + fade.omp (70.2 KB)

.lisp files are the only modified in my library, for introducing the new menu and function.
The patch (sorry, it is not very refined) contains the lisp box for testing the code.

There is no hurry of course, I know it is a very busy period.

Thanks in advance, ciao

Fabio

Dear Fabio,

No worries,

Here is the corrected code:

Texture1.lisp (1.8 KB)

and it was indeed a problem of a method typing: '> is not a string but a symbol…

Best
K

Dear Karim,

Thank you very much, it runs perfectly. I should have to code on first morning, and not on late afternoon…

See soon, ciao

Fabio