On Tue, 2014-09-30 at 23:05 +0200, Andreas Schneider wrote: > I see, thank you. Now that I know how it works, I can see the MIDI > messages. I can translate the numbers to hexadecimal with a calculator. > But with my sparse scheme skills, one large number is not easy to handle > . You offered to extend d-GetMidi to return a list of bytes. That would > make things much easier (though I need to learn how to handle several > return values). OK, I have done that: (d-GetMidi #f) now returns a list of four numbers. for example
(list-ref (d-GetMidi #f) 0) returns 144 for the note on and 128 for the note off. It would have a channel number included as well, but this is 0 on my controller. (list-ref (d-GetMidi #f) 2) returns the velocity Of course you would assign (d-GetMidi #f) first (set! midi (d-GetMidi #f)) otherwise each call would get a different midi event. > > I will try to write some scheme filter next weekend, using AngryDelete ok - there is a call to d-SetMidiCapture in that code, which I don't remember the details of, but I see that it is to do with the situation where you have more than one score open at once. Other than that the code doesn't look too terrible, though I wouldn't use the verbose lambda form nowadays, (let loop () ... is much neater. > as a template. In this context, I have another question: What is the > scheme command to toggle the link to the MIDI keyboard (what the caps > lock key does)? there isn't one - I'm not sure why. > Will it work to use it, as I don't know if the message > to turn the link back on will be received? Maybe it is better to > implement the keyboard link functionality in the scheme filter directly, > i.e. set a variable whether to evaluate the MIDI messages or not (and > wait for the "turn the link back on" message). if you want to switch to hearing the notes set a switch to cause playing the note received in response to receiving one in the loop getting MIDI events. (Besides d-PutMidi, which needs the midi bytes, there are actual commands to play a note passing the note number, velocity, channel etc). HTH Richard _______________________________________________ Denemo-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/denemo-devel
