notes-Turtle1331

Notes from Turtle1331

Projects

Tutorials

Using MIDI

How to Run Allolib From Anywhere (on Linux and possibly macOS)

  1. Create a file in allolib_playground called alrun.sh with the following:
    if [ -f "$1" ]; then
        if [ ${1: -4} == ".cpp" ]; then
      FILE="$(realpath $1)"
      cd /path/to/allolib_playground
      ./run.sh $FILE
        else
      echo "Error: $1 does not end in .cpp"
        fi
    else
        echo "Error: $1 does not exist"
    fi
    

    Replace /path/to/allolib_playground with the path to the repository on your system.

  2. Add an alias in ~/.bashrc or a similar shell startup script:
    alias alrun='/path/to/allolib_playground/alrun.sh'
    
  3. Restart your shell or re-run the startup script, e.g. source ~/.bashrc
  4. Run Allolib .cpp files from anywhere, e.g. alrun 01_SinEnv.cpp

How to Connect MIDI Devices Over the Network On Linux With ALSA

  1. Connect one computer to a MIDI device.
  2. Run aseqnet to start the server.
  3. In a separate shell, list the MIDI device IDs with aconnect -i. You should see something like this:
    ...
    client AA: 'your MIDI device'
    ...
    client BB: 'Net Client'
    ...
    

    Make note of the IDs (noted above as AA and BB) for your MIDI device and the network device.

  4. Connect the two devices: aconnect AA BB (using the numbers from above)
  5. On another computer, connect to the server: aseqnet HOST where HOST is the hostname or IP address of the first computer.
  6. Run a MIDI application (see programs listed below). It should connect to the networked MIDI device, allowing you to play notes across the network.

Tutorial Programs With Allolib Support

Here are a couple of programs from tutorials/synthesis with modifications for basic MIDI support:

Playing MIDI Files with Allolib on Linux

It is possible to play MIDI files in a cross-platform way within Allolib, but I haven’t implemented it yet, so here’s a workaround.

  1. Run one of the tutorial programs above. The output should look something like this:
    ...
    Opened port to Midi Through:Midi Through Port-BB AA:BB
    Parameter OSC Handshake server running on 0.0.0.0:16987
    [100%] Built target 08_SubSyn_run
    

    Make note of the client and port numbers (noted above as AA and BB) for the connected MIDI device.

  2. Prepare to receive the notes in Allolib (e.g. change parameters, start a recording).
  3. Play back a MIDI sequence file: aplaymidi -p AA:BB path/to/mysequence.mid. Replace AA and BB with the client and port numbers and path/to/mysequence.mid with the path to the MIDI file to play.
  4. The MIDI sequence should be playing in Allolib now. You can adjust the parameters as the sequence plays. If you are recording, these adjustments will be included in the recording.

Resources

Using OSC