Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4010

Re: MIDI message sending and receiving, MID file manipulation

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!cyclone02.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe24.ams2.POSTED!00000000!not-for-mail
Content-Type text/plain; charset=us-ascii; format=flowed; delsp=yes
Newsgroups comp.lang.python
Subject Re: MIDI message sending and receiving, MID file manipulation
References <bfb5e9fd-8651-4fa4-9e86-1b2f8fb37cd3@z31g2000vbs.googlegroups.com>
MIME-Version 1.0
Content-Transfer-Encoding 8bit
From "Rhodri James" <rhodri@wildebst.demon.co.uk>
Message-ID <op.vuiqhkf0a8ncjz@gnudebst> (permalink)
User-Agent Opera Mail/11.10 (Linux)
Lines 59
NNTP-Posting-Host 82.8.62.87
X-Complaints-To http://netreport.virginmedia.com
X-Trace newsfe24.ams2 1303776263 82.8.62.87 (Tue, 26 Apr 2011 00:04:23 UTC)
NNTP-Posting-Date Tue, 26 Apr 2011 00:04:23 UTC
Organization virginmedia.com
Date Tue, 26 Apr 2011 01:04:22 +0100
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:4010

Show key headers only | View raw


On Mon, 25 Apr 2011 14:17:50 +0100, Passiday <passiday@gmail.com> wrote:

> Hello,
>
> I'd like to experiment with Python, connecting my Linux PC with MIDI
> device (standard synthesiser keyboard).
>
> I am pretty new to the Python world, so the questions that crop up, I
> assume, could be pretty basic to someone who had spent some time with
> it.
>
> So, here comes:
> 1) Is everything what could be done with Python in some IDE (Eclipse
> for me), can be accomplished in the interactive console? I mean,
> perhaps Python could be used just as programming language and compiled
> in binary code, thus allowing access to some binary libraries what
> might not be accessible from within the interpreter.

This is two, or possibly three, distinct unrelated questions as best
I can tell.

1a) Yes, anything you can do in an IDE you can do at the Python
interactive command line prompt.  Or by running your script directly
in a terminal window.  Personally I find it less hassle to do it that
way, since IDEs usually don't work the way I want them to.

1b) Python can be compiled down to binary if you try hard, with
utilities like Py2exe.  You don't usually want to do that, though.

1c) ...because there are plenty of ways of wrapping up libraries
so that Python scripts can use them.  ctypes (in the standard
library) is a good place to start.

> 2) Is there a way how to run Python script in event-driven mode, ie,
> run the script, it registers some function as keyboard event handler,
> and then calls that function whenever I press any key. Is such
> behaviour possible in the interactive mode? Since I want to test the
> MIDI message exchange, having a function sitting on the timer event is
> what I'll need for playback, and an event that is triggered by
> incoming MIDI message for recording.

Probably.  It sounds like what you really want is a framework of
some sort that knows about things like "the timer event", and using
it from the interactive prompt won't be for the faint of heart!
Someone must have walked this path before, though.

> 3) Of course, I need some Python module to actually get this MIDI
> communication happen. Sending and receiving MIDI messages to and from
> my MIDI device.
> 4) As for manipulating the MIDI files in Python, I have searched up
> this: http://www.mxm.dk/products/public/pythonmidi  However, this lib
> doesn't try to provide actual communication with MIDI device.

The Python In Music wiki page (http://wiki.python.org/moin/PythonInMusic)
has an entire section on MIDI packages.  I've never used any of them,
so I can't comment.

-- 
Rhodri James *-* Wildebeest Herder to the Masses

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

MIDI message sending and receiving, MID file manipulation Passiday <passiday@gmail.com> - 2011-04-25 06:17 -0700
  Re: MIDI message sending and receiving, MID file manipulation "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2011-04-26 01:04 +0100

csiph-web