Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About *alsa-midi-instrument-map* #21

Closed
TatriX opened this issue Mar 29, 2021 · 3 comments
Closed

About *alsa-midi-instrument-map* #21

TatriX opened this issue Mar 29, 2021 · 3 comments

Comments

@TatriX
Copy link

TatriX commented Mar 29, 2021

Hi!
Recently *alsa-midi-instrument-map* was added and it looks like a really nice idea!

I have some immediate thoughts on it, which are of course specific to my workflow, but I guess it is quite common among hardware users.

So, right now to use MIDI device you need to do something like this:

(pb :kick
  :backend :alsa-midi
  :channel (1- 1)
  :quant 1
  :dur 1)

Or with *alsa-midi-instrument-map*:

(setf (alsa-midi-instrument-program-number :nord-kick) 30)

(pb :kick
  :instrument :nord-kick
  :channel (1- 1)
  :quant 1
  :dur 1)

It would be really cool if I could set MIDI channel once for my setup, and make program change more explicit, perhaps like this:

(setf (alsa-midi-instrument :nord-kick) '(:chan (1- 3)))

(pb :kick
  :instrument :nord-kick
  :program '(:pc 32 :msb 13 :lsb 3)
  :quant 1
  :dur 1)

Typically having only program change is not enough, as every device has it's own scheme of switching banks, using all sort of combinations of program change, msb and lsb (http://www.andrelouis.com/qws/art/art009.htm)

@defaultxr
Copy link
Owner

This is a good idea! It'd definitely make the instrument map feature more flexible and useful. I'll see about implementing it soon, thanks!

@defaultxr
Copy link
Owner

Hmm, actually, thinking further, it seems like there might not even be any need to keep this specific to MIDI backends; it could probably be even more useful if implemented as a generalized event processing mechanism run as the last step of pattern processing, before events are sent to the clock. I'm thinking there could be a global list like *event-processing-functions* or similar, containing functions that are applied to the events yielded by patterns. The list could default to (list 'convert-midi-mapped-instruments-to-midi-parameters) for convenience, so that users don't have to manually implement MIDI instrument mapping themselves.

@defaultxr
Copy link
Owner

With commit 49f8dba I added instrument-mapping to map :instruments to arbitrary event parameters, and *post-pattern-output-processors* to process pattern outputs with arbitrary functions.

I'm planning on reworking backends in the future as well so that each enabled backend can have its own list of processor functions that will run on all events the backend receives too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants