Jump to content

Recommended Posts

Just please the cursor on SETF function and type ⌃⇥ (ctrl/tab)


setf place value




Arguments and Values:


place        a place.

value        a form.




Takes pairs of arguments like SETQ. The first is a place and the second is the value that is supposed to go into that place. Returns the last value. The place argument may be any of the access forms for which SETF knows a corresponding setting form.




(setf pitch '(c4 e4 g4 c5))

=> (c4 e4 g4 c5)



=> (c4 e4 g4 c5)


If more than one pair is supplied, the pairs are processed sequentially.


(setf place-1 newvalue-1

      place-2 newvalue-2


      place-N newvalue-N)


equivalent to



 (setf place-1 newvalue-1)

 (setf place-2 newvalue-2)


 (setf place-N newvalue-N))


Link to post
Share on other sites

Thanks. Just to clarify, my issue is with 'set-assignment' and not setf. I doubt if there are the same functions!


ctrl-tab short cut does not give me the documentation for set-assignment. I also searched in utility bar.



(setf trans '((5/4) (-1/4 1) (-3/8 7/8) (-1/2 3/4) (-7/12 2/3)
              (-2/3 7/12) (-3/4 1/2) (-13/16 7/16) (-7/8 3/8)
              (-15/16 5/16) (-1 1/4)))
(setf mat (make-omn
           :pitch (reverse ; reverse the pitches 
                   (integer-to-pitch '(0 1 2 3 4 5 6 7 8 9 10 11)))
           :length trans))
(setf sets (set-assignment 'mat mat))
(rnd-sample 8 (list mat0 mat3 mat5 mat8 mat10))


Link to post
Share on other sites

SET-ASSIGNMENT function is a private (dev) function.

You know about the function because of the Mozarteum Uni. 

The official name for the function is ASSIGN-VARIABLE, the SET-ASSIGNMENT function name will be removed from the system.


assign-variable index-name lists




Arguments and Values:


index-name        an index name.

lists                    a lists.




The function ASSIGN-VARIABLE provides a way of labelling items as variables. It uses a similar mechanism to that found in the function CREATE-ASSIGNMENT but without the need for additional evaluation.


(assign-variable 'var '((c4 cs4 d4) (ds4 e4 f4)

                        (fs4 g4 gs4) (a4 bb4 b4)))



=> (c4 cs4 d4)



=> (ds4 e4 f4)



=> (fs4 g4 gs4)



(a4 bb4 b4)




(setf perc-motifs


       5 (integer-to-pitch (rnd-number 20 -1 5))))

=> ((c4 c4 db4 db4 eb4) (eb4 e4 db4 f4 db4

    (d4 eb4 e4 db4 db4) (db4 db4 c4 db4 db4))


(assign-variable 'perc perc-motifs)

=> (perc0 perc1 perc2 perc3)



=> (cs4 d4 d4 eb4 cs4)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use Privacy Policy