ChucK-plugin-for-ST3 icon indicating copy to clipboard operation
ChucK-plugin-for-ST3 copied to clipboard

midi keyboard to texteditor notes/strings

Open zeffii opened this issue 11 years ago • 3 comments

rather than going mental with importing midi, I wonder if it's possible (and within our means) to add a mode that lets a midi keyboard be used to enter content into the text editor. Sometimes I just want a collection of notes.

If i hold down keys, it should write [30,45,47,58] @=> int notes_{ }[]; when they're let go.

In most trackers (buzz, buze, fasttracker, impulsetracker..) this is possible, they treat a midi keyboard as extended qwerty it's really cool.

zeffii avatar Dec 10 '13 00:12 zeffii

i'll write a small .ck to do it tomorrow.. seen as we can happily run several instances of chuck at once :)

zeffii avatar Dec 10 '13 00:12 zeffii

Hmmm... It's already possible to capture MIDI events - from within a running ChucK instance. It should "just" (LOL) be a matter of stuffing them into an array or possibly writing them to a file.

tildebyte avatar Dec 10 '13 15:12 tildebyte

yep; easy squeezy. (almost exactly taken from the examples ) This isn't exactly what I want.. I'd like the output of this injected into sublime.. maybe if it pisses me off sufficiently

MidiIn min;
MidiMsg msg;

// open midi receiver, exit on fail
if ( !min.open(0) ) me.exit(); 

int notes[0];
int ncount;
while( true )
{
    min => now;
    while( min.recv( msg ) )
    {
        msg.data1 => int mode; 
        msg.data2 => int note;
        msg.data3 => int volume;

        if (mode == 144) {
             chout <= note;
             chout <= ", ";
        }
    }

    chout <= IO.newline();    
    int a[0] @=> notes;
}

zeffii avatar Dec 10 '13 16:12 zeffii