Posts

Showing posts with the label midi

Midi musical intrument controllers and synthesizers with python and pygame

Image
Musical Instrument Digital Interface (Midi), is for letting digital musical instruments talk to each other in 'real time'. It came from the early 80s, and is still used today. The main idea is that rather than sending audio data, it sends small control messages. This is great for fast real time low bandwidth communication. I'm going to show in all the different ways midi can be used with python/pygame with three separate programs, and how to set up a virtual synth (I've included instructions for Win, Mac, and Linux). Full article is available for patrons first as an "early access" before it becomes available to all in a month:  https://www.patreon.com/posts/midi-music-pygame-python-43826303 You can support my pygame development and read my development log at: https://www.patreon.com/pygame

pygame -- better OSX support, midi virtual keyboard example, basic camera module on windows, imports in ironpython (the .NET/C# python).

Image
Some fairly exciting pygame updates... Brian has removed the dependency pygame had on pyobjc. This is important because pyobjc has become not well enough maintained for pygame. It is part of the apple supplied python, but not other versions of python commonly used on OSX. We had to make a binary of it ourselves for the last release -- because there wasn't one supplied by the maintainers. OSX pygame needs testing as a result of this change... You can download the latest auto-build from svn that passes all the unittests here: http://thorbrian.com/pygame/builds.php The midi module also works on OSX now... to go with the linux, and windows support. The above automatic builds also include the midi stuff for windows/mac. So you can attach midi devices (like keyboards, drums, guitars, synths etc) and use them to control your game (or robots). Camera update: There is now a simple implementation of the pygame.camera module on windows using the vidcap module. This is a python module t...

pygame.midi -- midi in, and midi out.

Image
I started adding more midi support to pygame . Pygame can already play midi files, however it can not get midi input, or send midi output to devices. Nicholas played around with some midi stuff in our eye stabs computer game... where it turned notes from a real guitar using pitch detection into midi events. This experiment used portmidi, and it seems to work ok in a cross platform manner. I hooked up my USB midi controller, and am able to get midi events! I've also added some code which converts the midi events into pygame events, and posts them to the normal pygame event queue. This simplifies things for people already used to handling events with pygame (like mouse, keyboard, and joystick events). I can also get it to write to midi outputs, but haven't really got a use for that yet. However I would like to hook it up to my casio keyboard to get some retro sounds out of it... but I have no midi output converter anymore. It is possible to get USB->midi converters fair...