Hi Simone
On 12/17/12, Simone Baracchi <
simoneb...@gmail.com> wrote:
> I wrote this simple script:
>
> from mididings import *
> from mididings.engine import *
> from mididings.event import *
>
> run(Filter(NOTE) >> KeyFilter(36) >> [
> Print("test"),
> NoteOff(37, 10),
> NoteOff(38, 0),
> NoteOn(55, 100),
> ]
> )
>
> my idea is that it should mute instrument #37 and #38 when #36 is struck
> (#36 being the hi-hat foot sound, and #37 and #38 being the hi-hat cymbal
> sound).
> However, it doesn't create the NoteOff events.
> The NoteOn event which I placed there just for testing is played fine. Why
> aren't my NoteOff events being played?
Running the script here and checking with aseqdump shows that the
NoteOffs are played:
$ aseqdump -p mididings:1
Waiting for data. Press Ctrl+C to end.
Source Event Ch Data
128:1 Note on 0, note 36, velocity 127
128:1 Note off 0, note 37, velocity 10
128:1 Note off 0, note 38, velocity 0
128:1 Note on 0, note 55, velocity 100
128:1 Note off 0, note 36, velocity 127
128:1 Note off 0, note 37, velocity 10
128:1 Note off 0, note 38, velocity 0
128:1 Note on 0, note 55, velocity 100
The above is the output of a single hit followed by a release of key 36.
So all the notes get generated on release as well. Considering that
this is a supposed to be a footpedal (if I understand correctly) I'm
not sure this is the right behaviour.
Also, why are you using such low velocities for note offs? Just set
both to 127 velocity.
> How should I create midi events and how should I route them to output?
You're doing it right in your script.