Text controlled MIDI through Ableton

Hello, I have made an alphabet by drawing it into the Ableton MIDI keyboard. I have a sequence of MIDI notes for each letter in the alphabet. I want to make a code which will let the user type in a sentence, a MIDI sequence will then be created combining each sequence corresponding to each letter in the sentence and playing it all in a row. I have never worked with MIDI on processing, I was wondering if this is possible? And could you present me with some general guidelines on which direction to take with this?

Answers

  • Sounds possible.

    • What does this sequence of notes look like? Is it like C3 = a, C#3 = b, D3 = c and so on (sequential), or is it something like c d e = a, d f# a = b, a e c# = c, ... (chord equals letter)?
    • To clarify: the MIDI notes need to be recorded in Processing and displayed on screen as a sentence?

    For MIDI I tend to use TheMidiBus library which allows you to listen to a MIDI device and run a callback function when a note is received. Your code can be something really simple like

    String sentence = "";
    MidiBus bus;
    
    void setup()
    {
        size(800,600);
        //select the first available device (probably not the one you want)
        bus = new MidiBus(this, 0, -1);
        fill(255);
    }    
    
    void draw()
    {
        background(0);
        text(sentence, 10,10);
    }
    
    //The MidiBus library will call this automatically when a new note is received
    void noteOn(int channel, int pitch, int velocity)
    {
        sentence = sentence + getLetterFromNote(pitch);
    }
    
    String getLetterFromNote(int note)
    {
        //convert a MIDI note 0-127 to a letter
    }
    

    You will need a MIDI device that links Ableton to Processing. If you're running Ableton and Processing on the same computer you need to have a virtual MIDI device. I use LoopBe1 which is free for one device. I think OSX has a native virtual MIDI device (but am no expert).

Sign In or Register to comment.