for midi, there is already the midi package which also already has a midin function that currently only supports cc in. It is not yet documented, but you can find out more in the PR. Note in would be a good addition to it. There is also this issue for midi input, maybe we can talk about the details there (or preferably on the discord?).
Audio input is also very desirable for me, for which there is is this issue. I think there are 2 stages for audio input: 1. record samples into the sounds tab 2. record samples from code and loop them instantly (like tidal-looper).