Midi CC?

  • Is there a way to get Midi CC information and note on note off from an external midi controller? The only operator I see right now is MIDINOTE which is good but incomplete for what I would like to do. I'd consider trying to extend the MIDINOTE operator or make a MIDICONTROLLER operator myself but I'm not a fluent programmer and just figuring out how to run (or even find the file?) 'make' to compile stuff seems to be beyond me.

  • There's is a MIDI CC operator in development. Not sure of its status though.

    " // input: channel, control num
    // outputs: value "

  • Great thanks emergencyofstate. I will work on different scenes for now.

  • ezra has this done, it's getting rolled into the next bees build, we'll set a date.

  • @eos, status is, it works fine and took like 15 minutes to add. bend and aftertouch are similarly easy. midi out has some issues still, need to carve some time for it.

  • If you could include midi note on and midi note off as well that would be great. I have a feeling something weird is going on with my op-1 as midicontroller as I'm unable to get a note to sustain and then release on release of key just using velocity information. Thanks zebra keep up the good work!

  • I would think you'd just use the MIDINOTE operator for NUM and VEL messages.

    I believe to achieve note off you'd just look for VEL 0..I could be wrong though

  • Yeah i thought so too and thats how the tutorial 3 does it but it does not work with my op1. Ive read that some controllers do not follow the midi protocol for including velocity 0 with note off. In any case note on note off might be a more transparent approach than looking at velocity

  • Op1 implementation presents much strangeness, from the look of things:
    http://ohpeewon.com/discussion/1686/op-1-accepts-midi-note-onoff-from-usb-ports/p1

  • I have a bunch of modded MIDI-fied instruments that will drone hung notes if they don't get a note off or ALL note off command.

  • Might I recommend modding those better?

  • we do check the com byte for note off (0x8) as well as for zero velocity. op-1 is one of our test controllers, works here.


  • static void op_midi_note_handler(op_midi_t* op_midi, u32 data) {
    static u8 com;
    static u8 ch, num, vel;
    op_midi_note_t* op = (op_midi_note_t*)(op_midi->sub);

    // check status byte
    com = (data & 0xf0000000) >> 28;
    if (com == 0x9) {
    if(op->chan < 0) {
    num = (data & 0xff0000) >> 16;
    vel = (data & 0xff00) >> 8;
    net_activate(op->outs[0], op_from_int(num), op);
    net_activate(op->outs[1], op_from_int(vel), op);
    } else {
    // note on
    ch = (data & 0x0f000000) >> 24;
    if(ch == op->chan) {
    // matches our channel, so perform it
    num = (data & 0xff0000) >> 16;
    vel = (data & 0xff00) >> 8;
    net_activate(op->outs[0], op_from_int(num), op);
    net_activate(op->outs[1], op_from_int(vel), op);
    }
    }
    } else if (com == 0x8) {
    // note off
    if(op->chan == -1) {
    num = (data & 0xff0000) >> 16;
    vel = (data & 0xff00) >> 8;
    net_activate(op->outs[0], op_from_int(num), op);
    net_activate(op->outs[1], op_from_int(vel), op);

    print_dbg("\r\n op_midi note off ; num: ");
    print_dbg_ulong(num);

    } else {
    ch = (data & 0x0f000000) >> 24;
    if(ch == op->chan) {
    // matches our channel, so perform it
    num = (data & 0xff0000) >> 16;
    vel = (data & 0xff00) >> 8;
    net_activate(op->outs[0], op_from_int(num), op);
    // FIXME: should noteoff be a separate off, retain release velocity?
    /// or, a 3rd output for on/off ?? hm
    net_activate(op->outs[1], 0, op);
    }
    }
    }
    }

  • so, as you see, there is room for discussion. but the current decision is simple: check for note off as status byte and as zero-velocity, both produce the same output. a valid reason to change this would be to get release velocity as well. the downside is you would need a separate operator for on and off, or something.

  • BTW, there is the possibility that something is messed up in the MIDI driver (at a lower level than the operator.) some attention to said driver is right at the top of my todo list, for adding a functional MIDI out. if you think you are seeing a driver bug, running a debug build and sending me the output would be very helpful.

  • @GreaterthanZero, No. Not everything can be modded better, sometimes it's device and sometimes its the MIDI mod. I'm throwing out real world experience and your coming off condescending.

    Thanks zebra for confirmation on note off info, the OP-1 is also a device I use with the Aleph often. I'm looking forward to more MIDI stuff in 0.5 :)

  • Not everything can be modded. That which can, can be modded to industry standard.

    No condescension intended.

  • OK point taken. Yes I am modding gear that definitely didn't get designed that way even though many were professionally modded. So changing a bit of code (not necessary after all) would be a bit quicker then opening and re-modding dozens of devices.