denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Bugs, Features and Questions


From: Richard Shann
Subject: Re: [Denemo-devel] Bugs, Features and Questions
Date: Thu, 03 Sep 2009 18:03:22 +0100

On Wed, 2009-09-02 at 15:22 +0200, Nils wrote:
> 3)Midi signals in Denemos "Manage Command Set":
> There are many possibilites with MIDI and many commands besides notes
> and musical instructions. There are midi-controllers, hardware, that
> have knobs and motor-faders and additional buttons, and the sustain
> pedal and so on.
> 
> How do you assign these to Denemo-actions? Do you think it would be
> possible to you midi-signals just the same as keybindings? In "Manage
> Command Set" you choose a command, press "Assign Key" and it doesn't
> matter if you press [a] or [tab] now, or use the Sustain-Pedal like a
> "shift" key. So Sustain+tab is a different command than tab.

 I have given this some thought and put the following on the website -
it doesn't cover using modifier keys, but that is just a further
refinement.

Richard

MIDI Shortcuts

It would be nice to be able to assign, say, the sustain pedal to a
command as a shortcut. Here is how I think it could be done. In
denemo.scm we could define a procedure MidiShortcutName that would take
a MIDI message and return a shortcut name, or #f if the event does not
have a name. The names should not clash with any other shortcut names
(mouse, keyboard). Another procedure MidiShortcutNames returns the whole
list of available names. In view.c we can define a command to
enable/disable MIDI shortcuts (I think they may slow down regular input,
and there is another reason - see below). Where MIDI events are received
the state of this toggle is consulted and the procedure MidiShortcutName
is run and if it yields a name the name is looked up in the regular
table of bindings and if a command is bound to it it is executed. On the
right click menu after mouse shortcut setting we can get a choice from
MidiShortcutNames for which shortcut to set and this is done as with
other shortcuts.

The main work will be writing the MidiShortcutName procedure: it can
test the MIDI message passed in, but it will also need to prevent a
flood of similar messages, e.g. from a pitchbend control. To help with
this I propose to create a command (d-SetTimer ms scheme) which sets a
timer which will execute the passed scheme after ms milliseconds. This
would be used to turn off the MIDI shortcut interception briefly for
commands which come in short bursts, only one of which is needed. The
sequence would be

(d-StopMidiIntercepts) (d-SetTimer 100 "(d-StartMidiIntercepts)

which would give time for the burst of activity to pass.








reply via email to

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