I release midi c, e, g (C major) play note c.

Please provide an example of a script that will only trigger a note on a chord.
example:
I release midi c, e, g (C major) play note c.
I have no idea how to go about it.