Hi Eelke,

I just tried it out. Good job! 

I am not very familar with MIDI, but I think I can offer some 
suggestions.   The rtmidi callback will always be called for any key action 
(up, or down).  However, you can see if the key is pressed or relesed by 
looking at the message[0][0] data. For example, look at this message data:

*([144, 36, 100], 0.0)([128, 36, 0], 0.551361)*
The "144" is always a key press, and "128" is always a key release. You can 
check this inside your callback, and decide what to do. 

For  improvement suggestions, maybe you can ask the user which midi device 
to open. 
1. Print out all midi devices.
2. Ask the user to press a key. 

Another suggestion: 
1. Use the key press strength value to affect the animation. Harder key 
presses could be a different color. 





On Monday, April 30, 2018 at 6:18:24 AM UTC+9, Eelke Johnson wrote:
>
> I solved the problem of the two call of the printer function with a toggle 
> function but now when I play an octave I got the same problem...
> Have you any idea to separate the hit/release piano key event on the 
> port.set_callback ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to