I don't know enough about ports/cmake to submit a patch, but I can with some instruction or pointers. This is the just get it to work fix. Add this to the cmake build text (just making sure it includes all the MIDI files): add_subdirectory(src/midi) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include/rtmidi -L/usr/local/lib/ -lrtmidi") find_library(RTMIDI_LIBRARY RtMidi) find_package(RTMIDI REQUIRED) find_package(JACK REQUIRED) find_package(ALSA REQUIRED) find_package(SDL2 REQUIRED) Also change some includes to absolute paths in the midi header because it doesn't read the src/midi includes. Then the MIDI support is working as described in the docs.
Created attachment 239678 [details] Adding MIDI support Breaks the installation, compiles the right binary
Created attachment 239692 [details] Working MIDI support patch This one is good as far as I can tell.
Thank you for the patch. I am looking into it.
The patch looks good. Passes all fine in poudriere. Just curious: I am able to load *.mid files but don't get any audio. Are you able to play midi with output? Is there additional configuration needed?
Sorry, I missed your original message. In order to create a patch for cmake you can do the following: make clean make extract cd work/MilkyTracker-1.03.00/ [create a copy of the file you're editing ending in .orig, eg:] cp CMakeLists.txt CMakeLists.txt.orig [make your changes to CMakeLists.txt] [go back to the ports directory] make makepatch [This will create a patch in ./files/]
(In reply to Emanuel Haupt from comment #4) The description might be better as "ALSA MIDI Support" This is for a MIDI controller, and will enable MIDI for input. The original fix is kind of like a broken patch, so it doesn't need to be made.
What do you think about? RTMIDI_DESC= MIDI input support via rtmidi Other options use a similar wording: # grep MIDI /usr/ports/Mk/bsd.options.desc.mk FLUIDSYNTH_DESC?= MIDI playback support via FluidSynth
(In reply to Emanuel Haupt from comment #7) That's probably good. The description has a couple of reasons to select it or not, and the lib if somebody wants to know more.
Unfortunately it fails to compile: https://critical.ch/people/0d017638-a8ac-11ed-b6c8-10bf48e1088e/milkytracker-1.03.00_2.log In order to test it with poudriere you can just add: OPTIONS_DEFAULT=DOCS RTMIDI to the Makefile in order to enable the RTMIDI option.
I'm on 12.3, but looking at the log it appears that RtMidi is broken on 13.1.
It fails with the same error in poudriere on 12.3 amd64: https://critical.ch/people/2b1c010d-a8af-11ed-b6c8-10bf48e1088e/milkytracker-1.03.00_2.log
I'll see what I can find out with poudriere.
I'm unable to find anything out, it compiles and installs. I can't find a "noexcept" keyword anywhere in MilkyTracker or RtMidi, though. It's a new poudriere install and a jail built from the RELEASE DVD.
The poudriere builds are using rtmidi-5.0.0.pkg, and I used building from source instead of using the packages. The package has the noexcept keywords in it, which I think would have also came up with errors with any other software using the installed /usr/local/include/rtmidi/RtMidi.h from the package. I don't know if a PR needs to be made for RtMidi or if something else is going on.
I've added the rtmidi ports maintainer as cc.
Created attachment 240157 [details] MIDI support patch candidate After restarting from the beginning, I consider this the superior patch. It still gets the same errors with RtMidi. The same .h is also on github.
Created attachment 240164 [details] Good MIDI support patch The problem was MilkyTracker was being compiled with C++98, and the RtMidi lib must have upgraded because I was building with 4.0.0. Thankfully, MilkyTracker is good with the newer standard.
(In reply to Emanuel Haupt from comment #4) (In reply to Emanuel Haupt from comment #15) You may also want to call hselasky@FreeBSD, maybe :) It seems to me that MIDI in milkytracker would require audio/alsa-seq-server, since it appears to go through ALSA. If so... Additionally, if MIDI hardware is not had, install audio/fluidsynth with the option ALSA enabled. Fluidsynth requires audio/fluid-soundfont to be installed in order to output sound. Create the following symlink to omit the setting of the fluidsynth sound font. ${LOCALBASE}/share/soundfonts/default.sf2 -> ../sounds/sf2/FluidR3_GM.sf2 audio/alsa-utils is used to check if MIDI can be played in ALSA. I thought the following command would make it possible to play the rest. service alsa_seq_server onestart fluidsynth -a oss -m alsa_seq -i -s & aconnect -l -i -o # check port of fluidsynth aplaymidi -p 1 some_GM.mid Note that alsa-seq-server cannot convey system exclusives longer than pointer size to software MIDI. Probably something like this.
(In reply to Tatsuki Makino from comment #18) Based from the documentation that level of detail would be on each user's part.
Created attachment 240337 [details] proposed patch for audio/rtmidi (In reply to notbylundzander from comment #19) I have looked into how to use this software. As a result, this appears to have only MIDI input. Therefore, comment #18 is almost irrelevant :) And since RtMidi currently only supports JACK, it is necessary to be able to use a MIDI device with JACK. With the attachment I have brought here, RtMidi will be adding ALSA support. There is also an option to remove JACK, as MilkyTracker has no way to select a MIDI device and uses JACK preferentially, with the behavior of falling down to ALSA when it fails. audio/milkytracker is fine with the patch as per attachment 240164 [details]. If MilkyTracker is to receive MIDI input via ALSA, it must be pre-existed by some MIDI device that will be displayed when aconnect -i is run. If you tap the space key on the PC keyboard while the cursor in the middle dot-encrusted area is at the leftmost position, and when the MIDI device sends some note message, the note is entered successfully. Again, MIDI does not seem to have anything to do with whether or not sound comes out of the speakers.
The MIDI input port is only listening and receiving MIDI signals. Different software has the ability to change how all the ports are configured. MilkyTracker outputs sound so nothing else is needed. All it's doing is allowing an external keyboard device to control the internal keyboard device. It can be a hardware keyboard or a virtual one. MIDI ports can be configured to multiple ports at the same time, so using multiple outputs from the same input is optional. I'm currently using alsa-seq-server. No changes need to be done to RtMidi, unless a different configuration is needed. Which I imagine would be support for more software.
(In reply to notbylundzander from comment #21) > It can be a hardware keyboard or a virtual one. What software keyboards work via JACK on FreeBSD? For now, it seems that if we don't use the attachment 240337 [details] patch, audio/a2jmidid will allow us to use MIDI through ALSA with MilkyTracker. 2 commands are required before MilkyTracker can be started. jack_control start a2j_control --start This means that I have confirmed that it works at mine. vmpk(audio/vmpk) -> alsa-seq-server -> a2jmidid(audio/a2jmidid) -> jackdbus -> MilkyTracker(attachment 240164 [details] patched)
(In reply to Tatsuki Makino from comment #22) I don't know, it all seems irrelevant to me. I'm just the guy that wants the MIDI input port for the Installathon.
The patches LGTM. Yuri, what about the rtmidi patch? Would you like a separate PR for that? The rtmidi patch should probably be committed first.
Umm, please ignore the rtmidi patch in my attachment 240337 [details]. As long as JACK finds a MIDI device, there seems to be no problem. maybe :) notbylundzander's attachment 240164 [details] has logic problems that cannot be solved by substituting Linux for FreeBSD. The choices are... MIDI option, but turn it on all the time. Because when alsa, or any rtmidi that depends on jack, is installed in the environment, those libraries are linked. It seems to me that we need to consider the use of something like CMAKE_DISABLE_FIND_PACKAGE_ALSA, CMAKE_DISABLE_FIND_PACKAGE_JACK or CMAKE_DISABLE_FIND_PACKAGE_RTMIDI.
Created attachment 240437 [details] Good MIDI support patch fix That part of the logic is only used to add MIDI. Now instead of changing the system name it's just changed with a CMAKE option.
(In reply to notbylundzander from comment #26) Your patch doesn't apply cleanly: > patch: **** malformed patch at line 26: PORTSCOUT= ignore:1 Could you maybe re-create your patch with: $ git diff > /tmp/foo.patch
Created attachment 240457 [details] MIDI via rtmidi patch Thanks. Here is the remade patch.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c14e8a660992114f8bbcf8523dd566b317da392c commit c14e8a660992114f8bbcf8523dd566b317da392c Author: Emanuel Haupt <ehaupt@FreeBSD.org> AuthorDate: 2023-02-28 20:59:52 +0000 Commit: Emanuel Haupt <ehaupt@FreeBSD.org> CommitDate: 2023-02-28 21:00:30 +0000 audio/milkytracker: Add MIDI support While here pacify portfmt, portclippy. PR: 269106 Submitted by: notbylundzander@gmail.com audio/milkytracker/Makefile | 27 +++++++++++++--------- .../milkytracker/files/patch-CMakeLists.txt (new) | 20 ++++++++++++++++ 2 files changed, 36 insertions(+), 11 deletions(-)
Committed, thanks!