defaultxr / cl-patterns

Library for writing patterns to generate or process (a)musical sequences of mathematically (un)related (non-)compound values in Lisp.
https://w.struct.ws/cl-patterns
MIT License
77 stars 10 forks source link

[Feature Request] Allow CC only patterns #20

Closed TatriX closed 3 years ago

TatriX commented 3 years ago

Hi again!

Consider the following example:

(progn
  (pb :kick
    :type :midi
    :channel (1- 1)
    :quant 1
    :embed (pbjorklund 17 32 :dur 16 :repeats 1)
    :dur 1/4
    :midinote 60)

  (pb :kick-lfo
    :type :midi
    :channel (1- 1)
    :quant 1
    :c-30 (ptrace (pwhite 30 80))
    :dur 1/8)

  (play (list :kick :kick-lfo)))

I'm trying to control CC parameter with an independent pattern, because I want it to run faster then notes themselves. But it seems that right now pattern always sends note-on events.

TatriX commented 3 years ago

BTW, why get-alsa-midi-auto-cc-mapping uses c-NN and not cc-NN?

defaultxr commented 3 years ago

Hmm, both good points! I went ahead and changed the :c- keys to be :cc- instead as one would expect. I also implemented the :set event type for the alsa-midi backend (doesn't work for other backends yet tho).

With these changes you'll also want to use :backend :alsa-midi instead of :type :midi and use :type :set for your :kick-lfo pattern. I tested and they seem to be working, but let me know if you have any issues.