Trouble installing rtmidi for audio package

Problem description

I’m struggling with installing the audio package as it is unable to find rtmidi. I have the library downloaded but I can’t work out how to install it for Octave

My system

  • OS: macOS Catalina
  • Octave version: 6.0.9
  • The good news: One can install the audio package on macOS BigSur using Octave 6.1.0 installed via Homebrew.
  • The bad news: I didn’t get the basic example to work, mididevinfo returns an empty list.

I explain the steps here, even they are not leading to a full success. Maybe someone else knows more (no macOS or audio package expert here :beginner: :innocent: )

In general, to use Octave with custom system libraries, I recommend installing Octave via Homebrew. In your case Homebew has already a convenient way to install the rtmidi library:

brew install octave
brew install rtmidi

A little hack is necessary to make Octave find the library. Create a file with an editor of your choice (e.g. vim)

vim /usr/local/lib/pkgconfig/rtmidi.pc

with the content


Name: rtmidi
Version: 4.0.0
Libs: -L${libdir} -lrtmidi
Libs.private: -lc++ -ldl
Cflags: -I${includedir}

Finally from Octave:

pkg install -forge audio
pkg load audio

and I don’t know how to make the MIDI device finally work.

Hope this helped a little further.

That works fully for me.
Thank you very much