Jump to content

Easiest way to add click track / Metronome in OM


Recommended Posts

Hi Everyone,

I was just wondering what the easiest way would be to audition my score with a click track, something I've found to be helpful for slower scores with long note values/slurs.
I'm guessing I should make a function for that using setf, any recommendations or best approaches?

- Jor

Link to comment
Share on other sites

I suggest you simply and an explicit track to your score with repeated note values, e.g., quarter notes (crotchets), perhaps like the following.

 

   (make-omn :length (gen-repeat 16 '(1/4)))

 

In your MIDI setup you may assign this to a percussive instrument, if you prefer.

 

Best,

Torsten

 

Link to comment
Share on other sites

This example illustrate how this could be done:

 

  (metronome
   :omn (metronome phrase-lh)
   :channel 16
   :sound 'gm
   :program 'woodblock)

 

Function:

(defun metronome (sequence &key (pitch 'c4) (velocity 'ff))
  (let* ((ts (get-time-signature sequence))
         (len (loop for i in ts
                collect (gen-repeat (last1 i) (gen-repeat (car i) (list (/ 1 (second i)))))))
         (vel (loop for i in ts
                collect (append (list velocity) (gen-repeat (1- (car i)) (list 'mf))))))
    (make-omn :length len
              :pitch (list pitch)
              :velocity vel)))

(setf sequence
      '((-h.) 
        (-e g3cs3 mp arp fs3b2 arp-down
            g3as2 arp-down gs3as2 arp) 
        (-e - fs3c3 f fs3as2 g3cs3 a3as2 gs3c3 gs3cs3) 
        (-q._q)))

(metronome sequence)
=> ((q c4 ff mf c4) (e c4 ff mf c4 c4 c4) (q c4 ff mf c4 c4) (e c4 ff mf c4 c4 c4))

 

Score example:

(setf phrase-rh
      '((h. cs3gs2as5cs5cs4as3gs3g3as4gs4g4 f arp)
        (-e g5d5g4 mp arp fs5ds5fs4 arp-down
            g5ds5g4 arp-down gs5e5gs4 arp) 
        (-e - a5d5 f c6f5 d5b5 g5d5 gs5ds5 gs5e5)
        (-e h c6d5cs5g4cs4g3d3 p arp-down)))

(setf phrase-lh
      '((-h.) 
        (-e g3cs3 mp arp fs3b2 arp-down
            g3as2 arp-down gs3as2 arp) 
        (-e - fs3c3 f fs3as2 g3cs3 a3as2 gs3c3 gs3cs3) 
        (-q._q)))

(setf ts (get-time-signature phrase-lh))

(def-score arpeggiation-chords-3
           (:key-signature 'chromatic
            :time-signature ts
            :tempo 60
            :layout (harp-grand-layout '(rh lh)))

  (metronome
   :omn (metronome phrase-lh)
   :channel 16
   :sound 'gm
   :program 'woodblock)
  
  (rh
   :omn phrase-rh
   :channel 1
   :sound 'gm
   :program 'orchestral-harp)
  
  (lh
   :omn phrase-lh)
  )

 

I will add the METRONOME function to the next release.

JP

Link to comment
Share on other sites

Wow, that is fancy :)

 

Here is one that is even slightly more fancy, where the resulting softer velocity values also react to the velocity input, and also the pitch of easy beats is slightly different.   

 

(defun metronome (sequence &key (pitch 'c4) (velocity 90))
  (let* ((ts (get-time-signature sequence))
         (len (loop for i in ts
                collect (gen-repeat (car i) (list (/ 1 (second i))))))
         (vel (loop for i in ts
                collect (append (get-velocity (list velocity) :type :symbol)
                                (gen-repeat (1- (car i)) 
                                            (get-velocity (list (- velocity 25))
                                                          :type :symbol)))))
         (pitch (loop for i in ts
                  collect (cons pitch
                                (pitch-transpose 
                                 -2 (gen-repeat (1- (car i)) pitch))))))
    (make-omn :length len
              :pitch pitch
              :velocity vel)))

 

TA

Link to comment
Share on other sites

I like the easy beats :-)

 

This function works with omn-form sequence and time-signature-form sequence:

 

(defun metronome (sequence &key (pitch 'c4) (velocity 0.8))
  (do-verbose ("metronome")
    (let* ((get-ts (if (omn-formp sequence) (get-time-signature sequence) sequence))
           (ts (loop for i in (lists! get-ts)
                 collect (cons (if (listp (first i)) (apply #'+ (first i)) (first i)) (rest i))))
           (len (assemble-seq
                 (loop for i in ts
                   collect (if (equal 1 (last1 i)) (gen-repeat (first i) (list (/ 1 (second i))))
                             (gen-repeat (last1 i) (list (gen-repeat (first i) (list (/ 1 (second i))))))))))
           (vel (loop for i in len
                  collect (cons velocity (gen-repeat (1- (length i)) (list (- velocity 0.15))))))
           (pch (loop for i in len
                  collect (cons pitch (pitch-transpose -2 (gen-repeat (1- (length i)) pitch))))))
      (make-omn :length len :pitch pch :velocity vel))))

 

Link to comment
Share on other sites

Yes! thanks so much, this is what I was looking for! 
I'm going to need a bit of time to figure out exactly what is happening in the function, but this seems like a very straightforward method.

There are actually a couple of handy thing to learn from this example for me (didn't even know about get-time-signature yet, that's amazing!)

 


 

Link to comment
Share on other sites

Example:

(setf omn
      '((h. cs3gs2as5cs5cs4as3gs3g3as4gs4g4 f arp)
        (-e g5d5g4 mp arp fs5ds5fs4 arp-down
            g5ds5g4 arp-down gs5e5gs4 arp) 
        (-e - a5d5 f c6f5 d5b5 g5d5 gs5ds5 gs5e5)
        (-e h c6d5cs5g4cs4g3d3 p arp-down)))

 

With omn-form sequence:

(metronome omn)
=> ((q c4 0.8 bb3 0.65 bb3)
    (e c4 0.8 bb3 0.65 bb3 bb3 bb3)
    (q c4 0.8 bb3 0.65 bb3 bb3)
    (e c4 0.8 bb3 0.65 bb3 bb3 bb3))

 

With time-signature-form sequence:

(metronome '((3 4 1) (5 8 2) (4 4 1) (5 8 1)))
=> ((q c4 0.8 bb3 0.65 bb3)
    (e c4 0.8 bb3 0.65 bb3 bb3 bb3)
    (e c4 0.8 bb3 0.65 bb3 bb3 bb3)
    (q c4 0.8 bb3 0.65 bb3 bb3)
    (e c4 0.8 bb3 0.65 bb3 bb3 bb3))

 

Link to comment
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.

Guest
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