In any case, to fill a clip with notes you need a sequence of function calls as described in the LOM.
But it may be helpful to organize the task in 2 steps.
(1) store generated notes in [coll] and (2) write [coll] data into the clip.

Beside going too deeply in M4L programming, I tend to directly record the output of a M4L track with a second MIDI track. Simply set the output of the MIDI track with your M4L device to the second track and record a clip on that track.
Probably not what you are looking for, but it is really easy and efficient. I use this a lot when using the M4L pattern sequencer to control a sampler.