Jump to content

PatrickMimran

Members
  • Posts

    90
  • Joined

  • Last visited

Posts posted by PatrickMimran

  1. Thank you but what  i am looking for is to create a new function X which could apply his functionality directly in a omn function like 

     

    ( rnd-order '(h. g3 mp e. bb4 mf q. c5 ff e. bb5 mf)) automatically render all omn component , but if i write a function x it will not automatically understand in the list what is pitch or length etc...

     

    I would like to find a way to have direct access without having to extract first length or pitch  and to recombine it in omn later 

     

    Thanks

     

    Patrick

     

     

     

  2. Hello 

     

    i try to write a function who could directly apply to an omn list of that form :

     

    (set melo1 '(s bb5 f c6 mf bb5 f q mf s c6) (s c6 g5 g5 mp q c5 s bb5 f) (h. g5 f e. mp bb4 ff bb5 mf g5 f) )

     

    How may i proceed to access independently pitch , length , velocity or articulation without having to disassemble it . Is there an existing helping function already made on which i could assign a new custom written function .

     

    Thanks

     

    Patrick  

     

     

  3. Désolé  mais je n'arrive pas à 

    le faire marcher en suivant vos instructions 

     

    (defun consxp (rang item lis &key (option1 a) (option2 a) )
      (setq oldlist lis)
      (setq newlist ( nthcdr rang oldlist ))
       (setq litem (list item))
       
      (cond

       ( ( and ( listp item ) (hassublistp oldlist ))
             (if (equal option1 a))
         (append (list-diff  oldlist newlist  ) (list item) (nthcdr rang oldlist ))
         (append (list-diff  oldlist newlist  ) item (nthcdr rang oldlist )))

       (( and ( atom item ) (hassublistp oldlist ))
             (if (equal option2 a)
          (append (list-diff  oldlist newlist  ) (cons (list item) (nthcdr rang oldlist ))))
        (append (list-diff  oldlist newlist  ) (cons item (nthcdr rang oldlist ))))
       
            (( listp item )
             
             (append (list-diff oldlist newlist )   item (nthcdr rang oldlist )))
            
            (( atom item )
             
             (append (list-diff oldlist newlist )   (cons  item  (nthcdr rang oldlist ))))))

     

     

     ( consxp 2 '(a d a) '(a  (d)  c)     )))

  4. Hello

    i tried to have a function who could move one atom or a list anyplace in another list 

    ,  but now i would like to have the options to move this atom or list with or without parenthesis  , see option a option b  option a2 option b2 .

    I have no idea how i can implement several result options in a function  , could you please explain me how to do that 

     

    Thank you 

     

    Patrick

     

     

    her are the functions i'd use as helping functions

     

    (defun list-diff (L1 L2)
      (cond
        ((null L1) nil)
        ((null (member (first L1) L2)) (cons (first L1) (list-diff (rest L1) L2)))
        (t (list-diff (rest L1) L2))
      )
    )

    (defun hasSublistp (lst)
        (cond ((null lst) nil)
              ((listp (first lst)) t)
              (t (hasSublistp (rest lst)))))

     

    This is the final one 

     

    (defun consxp (rang item lis )
      (setq oldlist lis)
      (setq newlist ( nthcdr rang oldlist ))
       (setq litem (list item))
       
      (cond

       ( ( and ( listp item ) (hassublistp oldlist ))
         ; OPTION A    (append (list-diff  oldlist newlist  ) (list item) (nthcdr rang oldlist )))

         ; OPTION B    (append (list-diff  oldlist newlist  ) item (nthcdr rang oldlist )))

     

       (( and ( atom item ) (hassublistp oldlist ))
    ; OPTION A2         (append (list-diff  oldlist newlist  ) (cons (list item) (nthcdr rang oldlist ))))

    ; OPTION B2         (append (list-diff  oldlist newlist  ) (cons item (nthcdr rang oldlist ))))
       
            (( listp item )
             
             (append (list-diff oldlist newlist )   item (nthcdr rang oldlist )))
            
            (( atom item )
             
             (append (list-diff oldlist newlist )   (cons  item  (nthcdr rang oldlist ))))))

     

     

     ;  ( consxp 2 '( a d a) '(a  (d)  c  )) option a ) for example 

     

     

     

     

  5. Hi Stephane 

     

    Based on your example  i tried to apply a transposition list based on your functions but with an exotic scale 

     

    Ex 

    ;; degree selection 
    (setf degr '(1 4 2 5 1 6 4 2 5))
    ;; remove 1 from each degree for use as transposition
    ;; inside tonality for diatonic transposition
    (setf trsp (mapcar (lambda(x) (- x 1)) degr))
    ;;; some material
    (setf arps1 (gen-repeat 
                 (length degr) 
                  '((s c4 e4 g4 c5 e5 g5 c6 g5 e5 c5 g4 e4))))
    ;; apply diatonic transposition (inside tonality) 
    (setf arps.map (tonality-map 
                    '(hyojo :root c4)
                    (pitch-transpose
                     trsp
                     arps1)))

     

    This is the start of the result i gat   with pitches not belonging to the scale 

     

    (s c4 f4 g4 c5 eb5 g5 c6 g5 f5 c5 g4 f4)
    (s eb4 g4 bb4 eb5 g5 bb5 eb6 bb5 g5 eb5 bb4 g4)

    i think the trsp function doesn't work with the Hyojo scale . Is there a way to make a algorithm which would work with any type of exotic scales ?

     

    Thanks

     

    Patrick

  6. Here is the score        

    Very often when rnd repeat of Rhyt is too high i gat this error message when i want to export last score to midi ,maybe a mistake on my part which i do no pinpoint 

    Thanks

    Patrick

    (setf pitch (rnd-repeat '(60) '(c5 d5 e5 f5 e5 bb5 g5 a5 b5 c6)))
    (setf color (tonality-map '(heptonia-seconda :root c3 :remove 1)
                              (rnd-repeat '(60) '(c5 d5 e5 f5 e5 bb5 g5 a5 b5 c6))))
    
    (setf rhyt (rnd-repeat '(1000) '(s -s -e e)))
    (setf rhyt2 (rnd-repeat '(50) '(h q)))
    (setf main-span (get-span rhyt))
    (setf rhyt2-span (length-span main-span rhyt2))
    
    (setf piano-righthand
          (make-omn
           :length rhyt
           :pitch color
           :velocity '(mp)))
    
    (setf piano-lefthand
          (make-omn 
           :length rhyt2-span        
           :pitch color
           :velocity '(f)))
    
    (setf timesigs (get-time-signature piano-righthand))
    
    (def-score Stage-4          
              (:key-signature 'atonal         
                              :time-signature  timesigs            
                              :tempo 80
                              :layout (piano-layout 'piano-rh 'piano-lh))
      
      (piano-rh
       :omn piano-righthand
       :channel 1
       :sound 'gm
       :program 'acoustic-grand-piano) 
      
      (piano-lh
       :omn piano-lefthand))
     
     
  7. Hello

    I try to use the library by trying to retrieve a scale

    (setf row (integer-to-pitch (apply-eval (library 'modes 'iran 'dastgah-mahur))))

    but i can't access it , i gat a message saying

    Error: Undefined function scale1 called with arguments (dastgah-mahur) .
    > While executing: ccl::toplevel-eval, in process Listener-1(8).
    > Type cmd-/ to continue, cmd-. to abort, cmd-\ for a list of available restarts.
    > If continued: Retry applying scale1 to (dastgah-mahur).
    > Type :? for other options.


    Mystery  ...  could you help thanks.

    Patrick

  8. Hello if i do

    It gives me the folowing result, this i understand

    (setf chords '((c4 maj) (f4 m) (f4 m) (g4 maj) (c4 maj)))
    (setf rows (gen-repeat 5 (list '(q c4 cs4 d4 ds4 e4 f4 fs4 g4 gs4 a4 as4 b4))))
    
    (setf tonality1
          (tonality-series chords
                           :root '(c4 f4 f4 g4 c4)))
    
    (tonality-map tonality1 rows)
    => ((q c4 c4 c4 e4 e4 e4 g4 g4 g4 g4 c5 c5)
        (q f4 f4 gs4 gs4 gs4 gs4 c5 c5 c5 c5 f5 f5)
        (q f4 f4 gs4 gs4 gs4 gs4 c5 c5 c5 c5 f5 f5)
        (q g4 g4 b4 b4 b4 b4 d5 d5 d5 d5 g5 g5)
        (q c4 c4 c4 e4 e4 e4 g4 g4 g4 g4 c5 c5))

    but if i do

    (setf tonality1
          (tonality-series chords
                           :root '(c4 f4 f4 g4 c4)
                           :add '(2)
                           :closest '(up)))

    it gives

    => ((q c4 d4 d4 e4 e4 e4 g4 g4 g4 g4 c5 c5)
        (q f4 f4 gs4 gs4 gs4 b4 b4 b4 eb5 eb5 eb5 f5)
        (q f4 f4 gs4 gs4 gs4 b4 b4 b4 eb5 eb5 eb5 f5)
        (q g4 g4 g4 c5 c5 c5 c5 e5 e5 e5 e5 g5)
        (q c4 d4 d4 e4 e4 e4 g4 g4 g4 g4 c5 c5))

    what i do not understand if :add '(2) adds an interval of two semitones from the root

    why do i get

    (q f4 f4 gs4 gs4 gs4 b4 b4 b4 eb5 eb5 eb5 f5)

    and not

    (q f4 f4 g4 g4 gs4 b4 b4 b4 eb5 eb5 eb5 f5)

    There probably something i miss could you explain this to me


    Thanks

     
    Patrick

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy