denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Scheme question


From: Richard Shann
Subject: Re: [Denemo-devel] Scheme question
Date: Sat, 25 Oct 2014 22:18:22 +0100

On Sat, 2014-10-25 at 22:10 +0200, Andreas Schneider wrote:
> Am 25.10.2014 um 21:34 schrieb Richard Shann:
> > I think you mis-remembered the name of the procedure - display is a
> > scheme procedure, disp is the Denemo procedure:
> > 
> >   (disp "command " command ", bank " bank ", velocity " velocity)
> 
> You're right, thank you. Now there is still one thing I do not
> understand. With the traditional form of (d-GetMidi) as in angry delete,
> the midi channel is always 0. But if I use the #f option in d-GetMidi to
> return a  byte list (as shown below), the channel is shown correctly.

This is done for backward compatibility - previously written scripts
could fail if the previous behavior were changed.
It should be documented in the help of the command ...

Richard



> ;;; Master keyboard filter
> (let ((midi "")
>       (command 0)
>       (bank 0)
>       (note 0)
>       (velocity 0)
>       (loop 0))
>      (d-InputFilterNames (_ "Master Keyboard MIDI Filter"))
>      (d-SetMidiCapture #t)
>      (set! loop  (lambda ()
>               (begin
>                 (set! midi (d-GetMidi #f))
>                 (set! command (bit-extract (list-ref midi 0) 4 8))
>                 (set! bank (bit-extract(list-ref midi 0)  0 4))
>                 (set! note (list-ref midi 1))
>                 (set! velocity (list-ref midi 2))
>                 (disp "command " command ", bank " bank ", note " note ", 
> velocity "
> velocity)
>                 ;(if (and (= command #x90)(= bank 0))
> ;(d-PutMidi midi)
>                 (if (= command 0)
>                     (display "Filter stopping")
>                     (loop)))))
>      (loop))
> (d-SetMidiCapture #f)
> 
> Andreas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]