Midinote in messages

Good morning all !

is there a way to send midinote messages from an external devices to tidalCycles?
I would like for example to play chords on my external synth and then send midinote messages to tidal that could I use with other synths

have a nice day

Mario

MIDI | Tidal Cycles then Control Busses | Tidal Cycles ?

I think saw this working for control messages (turn knobs on an external MIDI controller), don't recall whether I used it with notes.

now I got something working ... similar to Controller Input - TidalCycles userbase , but with this:

		MIDIFunc.noteOn({ |val, num, chan, src|
		  osc.sendMsg("/ctrl", "noteon", num);
		});

then, in tidalcycles, do

d1 $ s "superreese*4"
   # n (segment 1 $ cN 0 "noteon" - 60  )

when you press a key on the MIDI device, the key's number is sent as the attribute of a "noteon" message, which is decoded by cN, and can be used to control the argument of n in tidalcycles. This ignores val (which should really be named vel, for velocity).

NB: I don't see how this could be used:

osc.sendMsg("/ctrl", num.asString, val/127);

it will send the note number as the key of the message, and velocity as attribute, but then the key varies, and cN 0 "48" (etc.) will only detect the note-on event for one specific key (C4, in this case?)