On Sun, 2014-11-09 at 18:07 +0100, Andreas Schneider wrote:
> How can I convert the byte list from (d-GetMidi #f) to something that I
> can issue to d-PutMidi? I was not able to come up with something usable.
(let* ((midi (d-GetMidi #f))
(value #f)
(command (list-ref midi 0))
(note (list-ref midi 1))
(velocity (list-ref midi 2)))
(set! value (+ (ash velocity 16) (ash note 8) command))
(d-PutMidi value))
I think the values required in d-PutMidi are in the opposite to expected
order (packed inside the integer).
It would be good to have a wrapper that takes the three numbers and
executes d-PutMidi after doing the (set! value (+ (ash velocity 16) (ash
note 8) command)) step, thus hiding the poor design of d-PutMidi (if I'm
right about the order of the bytes).
Richard
_______________________________________________
Denemo-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/denemo-devel