Re: Midi Visualizer

2018-04-30 Thread Benjamin Moran
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

Re: Midi Visualizer

2018-04-29 Thread Eelke Johnson
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

Re: Midi Visualizer

2018-04-29 Thread Eelke Johnson
I solved the self problem. When I call the instance of the window it work ! (obviously) #window.ring.notes[key_map[m]].played() and for now IT'S WORKING :D merci for your help :D any suggestions or improvements? I uploaded the code on my github repo ;)

Re: Midi Visualizer

2018-04-29 Thread Eelke Johnson
Hi, 1) I want to pass the self into the callback because self mean the ring. There are all sector in this ring and when I want to toggle a sector, I have to update it with a method contained into the self object. self -> ring -> sectors -> method on//off 2) The keyboard key. The rt-midi

Re: Midi Visualizer

2018-04-23 Thread Benjamin Moran
Hi Eelke, Rtmidi has it's own internal event loop. You shouldn't have to worry about the pyglet event loop - just use `port.set_callback` to update the methods on your classes. 1. Why are you trying to pass `self` into the callback? I'm not sure what you are trying to do. 2. Do you mean PC

Re: Midi Visualizer

2018-04-21 Thread Eelke Johnson
Hi, It's been a while since I didn't posted anything but I'm back! I've got some problem with the python rt-midi package. I didn't find any useful and complete documentation. I built the sphinx documentation but except the installation, I didn't found something useful and I'm stuck! What I want

Re: Midi Visualizer

2018-03-07 Thread Benjamin Moran
As a quick followup, I found my Midi keyboard, and tried some things. I had good luck with the `rtmidi` module: https://pypi.python.org/pypi/python-rtmidi It's pretty easy to open up a midi device, and create a callback for key presses. Instead of using the "on_key_press" events in pyglet,

Re: Midi Visualizer

2018-03-06 Thread Benjamin Moran
Hi Eelke, Sorry, I've been very busy the last week. It seems like you're making good progress! Not bad for your first project. *In answer to your previous questions:* In simple terms, the on_draw method is called whenever you press a key or resize the window. This is an "event driven"

Re: Midi Visualizer

2018-03-04 Thread Eelke Johnson
Hi community, I updated my small project. I reviewed how my code works and I implemented chord lines between notes. Now, I need your suggestions :) I want to

Re: Midi Visualizer

2018-02-27 Thread Eelke Johnson
Yes of course. I'm stuck on the order of execution and eventually mix it with a midi library. I don't exactly understand how pyglet.app.run() work and when it call the on_draw() event.Furthermore, I already writed a small program who handle midi with pygame but I don't know how to implement it

Re: Midi Visualizer

2018-02-26 Thread Benjamin Moran
That's a good move. I would suggest that you add a LICENSE file to your repository, if you want to attract contributions. Please note that rendering each vertex list seperately with pyglet.graphics.draw is not the most efficient way, but it will be fine if the number of objects not too great.

Re: Midi Visualizer

2018-02-26 Thread Eelke Johnson
Hi Benjamin, I started a Githubrepo because google group's post are too small to contain the code here is my repo : https://github.com/way2key/Midi_Visualizer I merged partially your code with mine and new functions my answer is in the last post ++ Eelke -- You received this message because

Re: Midi Visualizer

2018-02-26 Thread Eelke Johnson
Hi benjamin here is the fusion of our codes: from pyglet.gl import * from math import * class sector(object): def __init__(self, radius, inner_radius, angle, angle_in, points): self.radius = radius self.inner_radius = inner_radius self.angle = angle

Re: Midi Visualizer

2018-02-26 Thread Eelke Johnson
Hi Benjamin, Merci beaucoup for the fast answer! Thank you for idea of the drawing list it will help me a lot! Before I got your message, I already started a

Re: Midi Visualizer

2018-02-26 Thread Eelke Johnson
Hi Benjamin, Merci beaucoup for the fast answer! Thank you for idea of the drawing list it will help me a lot! Before I got your message, I already started a new

Re: Midi Visualizer

2018-02-25 Thread Benjamin Moran
Hi Eelke, You only replied to my email last time, so I'm copying the conversation here so that others can see it in the future as well. I made some quick hacks to your code, to give you some additional examples. Lots of OpenGL primitives should be drawn with batches and groups, but for your

Re: Midi Visualizer

2018-02-18 Thread Benjamin Moran
GL_POLYGONS are only for convex shapes, I believe. That might be why there is the part at the bottom that's connecting together. Since you're just starting out, I would strongly suggest that you use GL_TRIANGLES. On Monday, February 19, 2018 at 4:21:49 AM UTC+9, Eelke Johnson wrote: > > >

Re: Midi Visualizer

2018-02-18 Thread Eelke Johnson
Hi, I began to use openGL and pyglet. Now I'm trying to get a function who return a sector. I want to use GL_POLYGON draw method but I've got weird result... Can

Re: Midi Visualizer

2018-02-04 Thread Benjamin Moran
Hi Eelke, You can certainly use pyglet for this kind of project. I would recommend getting a prototype going first, using PC keyboard input. Most of the work will be graphical, so you can add a library for reading Midi commands after you get something going. To start, you will need to