At present the CMakeLists.txt file in sp_midi is not consistent for building on linux.
There are two solutions. It can be altered to use the included rt-midi code in Sonic Pi, or it can be altered to use librtmidi-dev which you need to install as a package. using sudo apt install librtmidi-dev
In this latter case, you need to look at the CMakeLists.txt lines 26, and 27 in the latest commit to that file commit b02cae1
Simply swap the comment around, ie comment the first line and uncomment the second. Also install the librtmidi-dev package.
That will give a file that will build on linux but NOT on Mac or Windows.
There is a fuller solution that adds extra code and switches to build all versions from internal code within Sonic Pi.
There are pr’s submitted for this, but there are still problems with the operation of sp_midi on linux builds. You will find that midi works, but crashes whenever you add or remove midi sources, after generating a huge number of midi ports. A solution is being investigated.
For the moment you run the line @mod_sound_studio.reset_erlang
which will restart the system.
I have not built a .deb for 3.3dev on linux yet for this reason.
Thanks a lot @robin.newman for these explanations and so it works !!
what i did including the change on line 26 / 27 as you mentionned.
cd spi3.3dev/
2009 cd app/gui/qt/
2010 sudo apt install librtmidi-dev
2011 nano external/sp_midi/CMakeLists.txt
2012 vim external/sp_midi/CMakeLists.txt
2013 chmod u+x linux-prebuild.sh linux-config.sh
2014 ./linux-prebuild.sh --build-aubio
2015 cd ..
2016 cd bin/
2017 ./sonic-pi
2018 cd ..
2019 cd app/gui/qt/
2020 ./linux-config.sh
2021 cd build/
2022 cmake --build
2023 cmake --build .
2024 cd ..
2025 ./bin/sonic-pi
Ok so i gonna test midi without removing midi devices.
By the way, i don’t understand your sentence. Where do i have to execute that command if i meet trouble ?
EDIT
yes the midi port-names are a bit weird. I have raised this already, on the core group. One thing that helps is that use_midi_defaults port: autocompletes available ports, so it can save you some typing.
Do try plugging in a midi device and see what happens. then run the @mod_sound_studio.reset_erlang from a buffer to get it going again. Takes a few seconds.