simlmx / pyau

Python Audio Unit Host
7 stars 5 forks source link

Support for programmatic midi messages #1

Open lambdamusic opened 11 years ago

lambdamusic commented 11 years ago

Hey this is brilliant! I was wondering, is there any way to send a midi message directly rather than having to pass a file? I was thinking of using this library as a starting point for a livecoding environment...

simlmx commented 11 years ago

Yes there is. Just arm the track (see pyau/example.py). The host should then route every incoming midi message to the track. Right now it's not very elaborate, e.g. doesn't support channels and such, but if all you want is plug a midi keyboard in, it should work fine. Don't hesitate to reopen this issue if for some reason it still doesn't work.

lambdamusic commented 11 years ago

Sorry I should have clarified: what I meant is sending midi messages programmatically, eg playing a single note rather than a midi file.

simlmx commented 11 years ago

Ah I see! I don't think it's in there for now but it should be fairly straightforward to add. I think all you need is wrap a call to MusicDeviceMIDIEvent. I'll have a look tonight.

lambdamusic commented 11 years ago

Great. I can't do that right now but I'm def looking forward to take a look at your project in more depth when I get a chance. I'm a long time user of impromptu http://impromptu.moso.com.au/ and always wondered how to do something like that within Python. Looks like you cracked it :-)

simlmx commented 11 years ago

I checked a bit the code and it should be easier than I though. For example the c++ AudioUnit class I'm using has a method to do this. It shouldn't be too hard to wrap this into python. I don't have time to do it but if you want to I could help.

lambdamusic commented 11 years ago

Thanks. I don't know c++, nor how to bridge it to python, but if you could provide me with an example of such a wrapper that'd be enough to get me started... btw what's the name of the C++ audio library you're using?

simlmx commented 11 years ago

Sorry I didn't reply earlier, it slipped my mind! The whole repo is "such a wrapper" :P The c++ code in the "src" folder and the wrapping in the "pyau" folder. I'm not using any external library, it's all OSX's Core Audio.

bwhitman commented 9 years ago

I added a very simple pull request #3 to address this, if you want to try it

lambdamusic commented 9 years ago

Thanks for letting me know!


Michele Pasin Email: michele.pasin@gmail.com

Web: www.michelepasin.org

On 30 May 2015 at 17:50, Brian Whitman notifications@github.com wrote:

I added a very simple pull request #3 https://github.com/simlmx/pyau/pull/3 to address this, if you want to try it

— Reply to this email directly or view it on GitHub https://github.com/simlmx/pyau/issues/1#issuecomment-107061654.