Sending Midi CC's using 'whenmod'

Hi all,

I'm trying to send MIDI CC values to some effects that I have mapped in Ableton.

For example I am sending this message to effect a Bit Reduction effect.

d1 $ ccn "120*128" # ccv (range 127 40 $ slow 2 saw) # s "als"

I would like to do a few things here, namely encapsulate this in something more shorthand, and be able to use the whenmod function so that these messages are only sent at certain points over the course of a song/pattern.

I've named this snippet "redux" by doing this and it evaluates fine without using 'whenmod'

let redux = ccn "120*128" # ccv (range 127 40 $ slow 2 saw) # s "als"

d1 $ redux

What I am looking to do is essentially something like:

d1 $ whenmod 8 7 (# redux)

I'm having a bit of trouble achieving an effect like this. Does anyone have any insight into what I'm missing here?

I've also tried:

d1 $ whenmod 8 7 ($ redux)
d1 $ whenmod 8 7 (redux)

Thanks in advance!

mike

i'd do the following

do
  let redux = ccv (range 127 40 $ slow 2 saw)
  d1 $ whenmod 8 7 (# redux) $ segment 128 $ s "als" # ccn 120 # ccv 0

I added # ccv 0 at the end so that it defaults back to 0

there's also this option:

do
  let redux = ccv (range 127 40 $ slow 2 saw)
  d1 $ whenmod 8 7 (\p -> segment 128 $ p # redux) $ s "als" # ccn 120 # ccv 0

which makes sure you only send 128 events per cycle only whenmod 8 7 is activated, saving some processing power

a third option:

do
  let redux = segment 128 $ ccv (range 127 40 $ slow 2 saw)
  d1 $ (whenmod 8 7 (const redux) $ ccv 0) # s "als" # ccn 120

const is a function which simply returns what you send it, so it'll replace the pattern with redux. note i used the parentheses so that # s "als" # ccn 120 is applied to the pattern structure from (whenmod 8 7 (const redux) $ ccv 0)

1 Like