Sending MIDI Program Change?

Does anyone know the syntax for this?

The closest I've gotten is:
asap $ control 4 # s "midi1" # midicmd "program"
which does send a program change message but I can't get it to send any value other than 2 for some reason.

I found some docs (here) that I'm not sure are from before SuperDirt MIDI or not. They say it's possible but don't provide the syntax:

Other types of midicmd values include "program", "touch", "polytouch", and "bend".

2 Likes

I think that'd just be:

 asap $ progNum "4" # s "midi1"

(it would be possible to do this with midicmd but this shorthand is more flexible as you can mix it with other commands)

2 Likes

Ah. Beautiful, thank you.

Is there somewhere to find a list of available MIDI functions and syntax? I remember asking you a while back but I can't find the answer. Once I get my act together and spend some time on the wiki I can try to update the docs if so.

I hope it's all right if I say something to this topic. As far as I can see, all MIDI parameters are defined in the Params.hs, so maybe this helps you:

But I if someone has a detailed list with explanation of course that would be better!

1 Like

Here's the available parameters:

  • progNum
  • midibend
  • miditouch
  • ccn and ccv for cc number and value, or cc for both (e.g. cc "40:20" does the same as ccn "40" # ccv "20")
  • nrpnn and nrpnv, or nrpn for both (as with cc above)

You can also set polyTouch with note, and midichan with any of them

The logic is defined here: https://github.com/musikinformatik/SuperDirt/blob/develop/classes/DirtEventTypes.sc#L38

3 Likes

Thank you!

There are other midi commands available in supercollider which don't have these easy shorthands, but which are still available via midicmd. I think midi clock is the most useful one: https://tidalcycles.org/index.php/MIDI_Clock

1 Like

has anyone had any luck figuring out the syntax for sending pitchbend messages via MIDI? tried something like this but i am not getting any results. any help is appreciated!

d1
  $ stack [
    note "c*4"
  , gain "1*8" # midibend "8000" # midicmd "bend"
  ] # s "midi"

@yaxu @ben @nilhartman hail mary request here...bumping this to the top in hopes one of you could sort me out on this :pray: :pray: :pray: looking to send MIDI pitchbend data from Tidal to Ableton. no luck so far combining the # midibend and midicmd "bend" syntax. any help is appreciated!

I looked through all my notes/code and midibend only came up twice. I haven't tested this in a while so not sure how helpful it will be?

I was trying to do some MPE type stuff in d1, so maybe d2 is more clear?
lmk if it works~!


d1 $ slow 2 $ stack [
  n "c4 c5 d5" # midichan "0 1 2" |+ 0 # vel 50,
  midibend ("<0>" ~> (segment 128 $ range 0 8192 isaw)) # midichan "0 1 2",
  miditouch (segment 128 (range 0 127 saw)) # midichan "0 1 2" 
] 
  -- # midichan "0 1 2"    
  # s "midi1"

d2 $ midibend (slow 2 $ segment 32 $ range 8192 10000 sine) # s "midi1"
2 Likes
d1
  $ midibend "8000" 
  $ note "c*4" 
  # s "midi"

Looks like it could be that simple? ...I haven't played with midi control outside of tidal (beyond basic notes)... this is piquing my interest :smiley:

2 Likes

Hey !
This works here :slight_smile:

d1
  $ stack [
    midibend $ (slow 8 $ struct "t*256" $ (range 0 8192 $ sine))
    ,
    n "0"]
  # s "midi"
4 Likes

@ben @nilhartman OH MY GOSH! these worked thank you so much for your help! today is a good day :sunny: y'all are the BEST. enjoy your weekends :slight_smile:

3 Likes

short little experiment with midibend. not nearly as flexible as iā€™d like (impossible to add conditionals) but getting some nice results. adding some oddness into the mini notation via a modulus will grab parts of the arpeggio at interesting times and throw the sounds around nicely.

2 Likes

Hi, i'm suspecting a bug using tidal and my synth MicroMonsta 2 on MIDI. I need to monitor what it's sent from SC to my midi out audio port where my synth is plugged. I'm no able to monitor using midi-ox or midiview. Tanks a lot.

Hi @kit-christopher , what are you using as synth/sample? to generate this patch?

@cyberik Ableton Wavetable

Hello, what's the purpose of midicmd "polyTouch" ? I don't ear change when added.

Is there a way to generate "velocity" on midi mode? By default velocity is set to 50. It could be interesting using this parameter to "humanize" keyboard melodies.

Thanks a lot.

I think you're looking for # amp

ref:

Thanks @cleary . I monitored midi port output to check and here the results:
# amp 0.1 --> velocity 12
# amp 0.2 --> velocity 25
# amp 0.4 --> velocity 50
# amp 0.7 --> velocity 88
# amp 0.95 --> velocity 120

I also noticed that generated midi code for notes is 1 octave lower.
Ex: a1'min'4 chords contents A0 A1 C1 E1 notes but generated code is A-1 A0 C0 E0, so to get a1'min'4 chords you need to write a2'min'4 in atom editor.