Tagged: disklavier Toggle Comment Threads | Keyboard Shortcuts

  • Michael Edwards 11:33 on June 8, 2016 Permalink | Reply
    Tags: disklavier,   

    Dan’s advice is to keep Disklavier velocities to within the 30 to 90 range. I’ve just implemented the rescale function to help with this (see below) so if you have events with amplitudes between 0.0 and 1.0 then the following would map those to velocities of 30 to 90:

    (midi-play +jitterbug+ :force-velocity
    	   #'(lambda (event) 
    	       (round (rescale (amplitude event) 0 1 30 90))))
    

    ;;; ****f* utilities/rescale
    ;;; DATE
    ;;; June 8th 2016, Edinburgh
    ;;; 
    ;;; DESCRIPTION
    ;;; Given a value within an original range, return its value withing a new range
    ;;; 
    ;;; ARGUMENTS
    ;;; - the value we want to rescale
    ;;; - the original minimum
    ;;; - the original maximum
    ;;; - the new minimum
    ;;; - the new maximum
    ;;; 
    ;;; RETURN VALUE
    ;;; The value within the new range (a number)
    ;;; 
    ;;; EXAMPLE
    #|
    (rescale .5 0 1 0 100)
    ==> 50.0
    |#
    ;;; SYNOPSIS
    (defun rescale (val min max new-min new-max)
    ;;; ****
      (when (or (>= min max)
                (>= new-min new-max))
        (error "utilities::rescale: argument 2 (~a) must be < argument 3 (~a) ~
                ~%and sim. for argument 4 (~a) and 5 (~a)" min max new-min new-max))
      (unless (and (>= val min)
                   (<= val max))
        (error "utilities::rescale: first argument (~a) must be within original ~
                range (~a to ~a)" val min max))
      (let* ((range1 (float (- max min)))
             (range2 (float (- new-max new-min)))
             (prop (float (/ (- val min) range1))))
        (+ new-min (* prop range2))))
    
     
    • Daniel Ross 12:54 on June 9, 2016 Permalink | Reply

      Misspelling in your code, mate. There is a space between ‘<' and '=' in your unless clause.

      • Michael Edwards 12:56 on June 9, 2016 Permalink | Reply

        there isn’t, it just looks like it :/ saw that yesterday but it’s wordpress screwing display up–if I edit the post there’s no space. anyway, (update-app-src) and you should get all the new glory

        • Daniel Ross 13:13 on June 9, 2016 Permalink | Reply

          Ah cool. It is there if you copy and paste direct from above, but no probs if it’s on the svn anyway.

  • Michael Edwards 13:17 on June 2, 2016 Permalink | Reply
    Tags: disklavier, velocity   

    Dan’s tested the Goldsmiths Disklavier. All keys are working, as are the damper and una corda pedals. He suggests limiting your MIDI velocities to 100 as anything higher is phenomenally loud and liable to disturb the tuning or perhaps even damage the instrument. See the post below for how to handle velocities within the midi-play method.

     
    • Michael Edwards 13:19 on June 2, 2016 Permalink | Reply

      the middle (sostenuto) pedal does not seem to be responding to controller number 66.

    • Daniel Ross 15:52 on June 2, 2016 Permalink | Reply

      MIDI Velocity 90 is LOUD on the dislklav. Go up to 100 at your peril!

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel