[clug] Midi from C (some pygame like api?)
hal.ashburner at gmail.com
Tue Jan 22 06:22:58 UTC 2019
I have timidity installed on ubu 18.04
With pygame installed I can do:
➜ [hal at tugboat 16:58 ~] python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame.midi
>>> p = pygame.midi.Output(2)
Between the calls to note_on and note_off I hear a violin playing an 'E'
note sustaining for as long as I'd like. 
If you've never done it. Do it. Make some noise! Algo-rave the headphones
until your family tap you on the shoulder and say it's time to stop being
DJ |)34|)-|247 now and see to the garbage and dishes. "Do yourself a
favour..." Like it's 1989 and you're rocking Detroit with Kevin
Saunderson. Or Dusseldorf 
I'd like to do just this, again, but from C rather than python for reasons
that may be misguided but they're mine and I'm going with them. (I'd prefer
not C++ for this because C is already in use for the project of which this
is a minor part).
Anyone got a cluebat? I'm not having much luck with libasound-dev examples
or tldp (old) documents trying to open an throw bytes at /dev/snd/seq or
whatever else I'm turning up from search engines and code reading.
I'm not making music (or even trying to), I just want the absolute minimum
to get a sound out using midi for some kind of data sonification
experimental hackery-pokery thing. data in -> transform to midi bytes ->
 instrument 40 is violin
 note 64 is E
 127 is the maximum note "velocity"
More information about the linux