Quefumas / gensound

Pythonic audio processing and generation framework
Apache License 2.0
81 stars 6 forks source link

Feature Request: Option for connecting midi instrument as input trigger (and mappings for midi input to gensound frequency) #30

Open klei22 opened 2 years ago

klei22 commented 2 years ago

https://www.pygame.org/docs/ref/midi.html

Would be really interesting, especially trying non-traditional scales and setting synth settings in a fully customizable and and very pythonic manner b/c gensound : )

Looking for libraries seems that there has been some work done in midi input interpretation with pygame:

https://www.pygame.org/docs/ref/midi.html

Quefumas commented 2 years ago

Hi,

MIDI integration is of course very desirable (and is planned for the future), but could you describe the exact features that you would like to have more specifically? Including, for example, how you envision the features to be used from within gensound.

Using MIDI data in a live setting is unfortunately entirely impossible using the current incarnation of gensound, not due to the MIDI protocol itself, but due to the current design of gensound, which is purely aimed at offline audio generation and processing. Although, I do have some ideas to discuss on how to implement real time functionality in the future, if you have any suggestions.

That said, I think that using MIDI files as input to a gensound synth in an offline manner is entirely within reach (I think we can rely on mido for midi processing). As for non-traditional scales/tunings, I'm not exactly sure why we need midi for this. If I recall correctly, the midi protocol is not very well-suited for anything other than the traditional 12-tone equal temperament, whereas in gensound it's already pretty easy to mess with the intonation. Perhaps we could find ways to make that even easier to do than it already is.