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 understand some OpenGL, 
but the pyglet.graphics module will take most of the pain out of working 
with the actual OpenGL primitives. Give this a read over, and post back if 
you have any questions. We're always interested in improving the 
documentation : 
https://pyglet.readthedocs.io/en/latest/programming_guide/graphics.html

You can also check out this example in the repo as well:  
https://bitbucket.org/pyglet/pyglet/src/89bc2c4825e13a73ed156d3232159cb481aabc9d/examples/graphics.py?at=default=file-view-default
You might want to make some template classes for the various shapes, 
similar to the Torus. For a project of this scale, keep it simple and just 
use GL_LINES and GL_TRIANGLES for everything.

This is an interesting sounding project. If you plan to make this open 
source, you should post a link to your repository. 

-Ben








On Monday, February 5, 2018 at 2:53:27 AM UTC+9, Eelke Johnson wrote:
>
> Hi community!
>
> I'm a newbie and a muscician and I want to programm a live python midi 
> interface to visualize my favourite song when I play it on my keyboard. 
> I've started learning python, installed Ubuntu, configured my 
> environnement and searched for online libraries.
> I found here  those 
> libraries:
>
>
>
>
> *-pygame-pyglet-pyopengl*My purpose was to use pygame's midi librairies 
> to listen to my keyboard and use pyopengl for the graphics. 
> The problem was that I didn't found anywhere sufficient documentation for 
> learning pyopengl and I gave up until I discovered Piglet!
>
>
> I'm not sure if I can implement the pygame's midi library and integrate it 
> with piglet. Is this possible? or should I use pygame with pyopengl instead?
> My question is : *Can I use piglet to programme my app with pygame's midi 
> library?*
>
>
>
>
> *What I want to do:*
>
> Here is an animation more or less simillar than my idea ( I only want 12 
> sectors and of course map it with my midi keyboard)
> https://www.youtube.com/watch?v=4kkNbtbWbm8
>
> First step,
> I want to draw a circle with sector like this (in 2d or 3d)
>
> 
>
> But first thing first,
> I started with hello world and then writed a simple app who draw a circle (
> https://www.youtube.com/watch?v=dEZDPjVegT4)
> But then,
> I want to do this shape with 12 sectors and I don't know how to proceed. I 
> looked for the GL_POLYGON method but I don't know how to implement it.
> Can someone help me with a basic example or procedure to follow? 
>
> *(for instance :*
>
>1. *make an array with all vertices *
>2. *draw a polygon shape with GL *
>3. *fill it *
>4. *change the camera projection*
>5. *etc...*
>
> *)*
>
>
>
> I'm motivated to learn piglet, opengl and python but I seek for 
> ressources, example and support
> Sorry for my bad english I'm not native.
>
> Eelke Johnson
>

-- 
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.


Re: Discussion on adding a 3D Model class to pyglet

2018-02-04 Thread Benjamin Moran
Hi Nick, 

Firstly, nice progress you've made. I would be happy to add your library to 
the projects section in the documentation:  
https://pyglet.readthedocs.io/en/latest/index.html#projects-using-pyglet 
Just let me know the description and preferred link, and I'll add it in. 
It's not much, but we don't have a proper website at the moment. 

About this model module, it's mainly just about getting the abstractions 
right, such as what attributes make sense to expose. We should also ensure 
the codec system makes sense for adding additional model parsers. Similar 
to the Sprite class in scope. 

As you might know we are planning to move pyglet's core to GL3+ in the 
future. I would be very interested in talking with you regarding this work. 
Some necessary internal classes for supporting everything are necessary, 
such as shader/shader program abstractions. These are duplicated in 
projects like yours, but in the future it would be nice to ensure the 
built-in classes are useful by other projects as well. The current rough 
implementation of the shader module for example, is here: 
https://bitbucket.org/HigashiNoKaze/pyglet/src/aec97ee54c670ce983041b39284b9794f78ceac0/pyglet/graphics/shader.py?at=shaders=file-view-default




On Saturday, February 3, 2018 at 5:58:54 PM UTC+9, Nick Del Grosso wrote:
>
> Hi, 
>
> In response to this addition,  I'd like to recommend my 3d model package 
> Ratcave again as an extension package for Pyglet and Pygame users. It has 
> been quite improved since I last suggested it on this mailing list, with a 
> cleaner interface and more tests. It uses modern opengl and shaders to stay 
> performant, and it works as a drop-in extension to any opengl context. 
> Models are drawn with draw(), cameras, lights, shaders, etc. use context 
> managers, which keep things cclean-lookin, and it also includes an OBJ file 
> parser. Finally, deferred rendering is made simple with context manager 
> FBOs and Textures, which has made it an effective teaching tool for 
> shaders. 
>
> https://github.com/neuroneuro15/ratcave
>
> https://ratcave.readthedocs.io/en/latest/tutorial1.html
>
> For simple games and apps, it has been more than enough.  There's 
> certainly still room for improvement, of course. Any contributions and 
> suggestions are welcome! 
>
> Best wishes, 
>
> Nick 
>
>
> On Friday, February 2, 2018, Benjamin Moran  > wrote:
>
>> Hi everyone, 
>>
>> I know this has been quiet for a while, but I figured it was a good time 
>> to think about merging in the basic framework for the model class. I think 
>> this work gets a lot more interesting with GL3+, but at least we can get 
>> some things worked out in the mean time. You can find my pull request here, 
>> and feedback would be greatly appreciated:
>> https://bitbucket.org/pyglet/pyglet/pull-requests/108/3dmodel/diff
>>
>> This consists of a new pyglet.model module. The structure is very similar 
>> to pyglet.image. There is also a single codec for obj files, which was 
>> based on some older /contrib code. This codec is crude and unfinished, but 
>> works well enough for a placeholder. 
>>
>> The pyglet.model.__init__ file contains the new `Model` class, as well as 
>> two Groups (for textured, or non-textured meshes). The main thing we need 
>> to flesh out is the `Model` class. In particular, which attributes we need 
>> to consider. Currently there is a `vertex_list_map`, which contains a 
>> mapping of the vertex lists and which Groups they are using (as some models 
>> have multiple meshes with different properties).
>>
>> I'm thinking at the least we should add an `add_to_texture_bin` method, 
>> similar to Animations. This would also be useful for the resource module, 
>> so models loaded through there could optionally be added to the interal 
>> resource module texture bins (as Animations can be). 
>>
>> I'm not an expert on these things, so any feedback is appreciated!
>>
>> -Ben
>>
>>
>>
>>
>>
>>
>> On Tuesday, July 18, 2017 at 4:08:42 PM UTC+9, Nick Del Grosso wrote:
>>>
>>> Hi Benjamin, 
>>>
>>> That makes sense. Thank you for taking a look at ratcave! 
>>>
>>> Best wishes, 
>>>
>>> Nick 
>>>
>>> On Jul 11, 2017 10:24 AM, "Benjamin Moran"  wrote:
>>>
>>> As a follow up Nick, 
>>>
>>> You've recreated a lot of things that will potentially end up in pyglet 
>>> core at some point. This is more related to the other thread about an 
>>> eventual move of the pyglet codebase to GL3+. It looks like we can leverage 
>>> most of the existing pyglet.graphics module when we move forward with that, 
>>> so it makes sense for the Model framework to use the existing API for a 
>>> start.
>>>
>>> I see that you've written a nice obj loader, which is a lot cleaner than 
>>> the quick one I've hacked together :)
>>>
>>>  
>>>
>>>
>>> On Thursday, July 6, 2017 at 11:36:19 PM UTC+9, Nick Del Grosso wrote:
>>>
 Hi Benjamin,

 Thank you for the compliment!

 Best wishes,

Midi Visualizer

2018-02-04 Thread Eelke Johnson


Hi community!

I'm a newbie and a muscician and I want to programm a live python midi 
interface to visualize my favourite song when I play it on my keyboard. 
I've started learning python, installed Ubuntu, configured my environnement 
and searched for online libraries.
I found here  those libraries:




*-pygame-pyglet-pyopengl*My purpose was to use pygame's midi librairies to 
listen to my keyboard and use pyopengl for the graphics. 
The problem was that I didn't found anywhere sufficient documentation for 
learning pyopengl and I gave up until I discovered Piglet!


I'm not sure if I can implement the pygame's midi library and integrate it 
with piglet. Is this possible? or should I use pygame with pyopengl instead?
My question is : *Can I use piglet to programme my app with pygame's midi 
library?*




*What I want to do:*

Here is an animation more or less simillar than my idea ( I only want 12 
sectors and of course map it with my midi keyboard)
https://www.youtube.com/watch?v=4kkNbtbWbm8

First step,
I want to draw a circle with sector like this (in 2d or 3d)



But first thing first,
I started with hello world and then writed a simple app who draw a circle 
(https://www.youtube.com/watch?v=dEZDPjVegT4)
But then,
I want to do this shape with 12 sectors and I don't know how to proceed. I 
looked for the GL_POLYGON method but I don't know how to implement it.
Can someone help me with a basic example or procedure to follow? 

*(for instance :*
   
   1. *make an array with all vertices *
   2. *draw a polygon shape with GL *
   3. *fill it *
   4. *change the camera projection*
   5. *etc...*

*)*



I'm motivated to learn piglet, opengl and python but I seek for ressources, 
example and support
Sorry for my bad english I'm not native.

Eelke Johnson

-- 
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.