Recent

Author Topic: Working MIDI app for the Mac!  (Read 1310 times)

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Working MIDI app for the Mac!
« on: October 04, 2024, 03:29:15 pm »
* Mac Mini M1
* macOS 14.6.1
* Lazarus 3.99
* FPC 3.3.1

I've completed a test app which uses the Apple CoreMIDI library to communicate with a MIDI device, in this case an Osmose keyboard. It was based on a post made in 2013!
It is geared towards my own particular needs, namely to pass a CC0 value followed by a ProgramChange message.

If you search for CoreMidi there are a few hits, pretty much all of them asking for help. Hopefully this will help someone 🙏🏽

« Last Edit: October 05, 2024, 11:00:52 am by carl_caulkett »
"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Working MIDI app for the Mac!
« Reply #1 on: October 06, 2024, 12:11:15 am »
After a day of heavy refactoring and restructuring, I have made the first steps towards making this a cross-platform app, using an interface to decouple the front end from the OS specific code. I haven't started on the Linux or Windows code yet but the macOS code is working nicely!
« Last Edit: October 06, 2024, 01:02:05 am by carl_caulkett »
"It builds... ship it!"

bobby100

  • Sr. Member
  • ****
  • Posts: 283
    • Malzilla
Re: Working MIDI app for the Mac!
« Reply #2 on: October 06, 2024, 03:15:20 pm »
I am using portmidi on MacOS, Linux and on FreeBSD. It works fine. On Windows, I use Windows Multimedia API.
If you want to take a look:
https://github.com/BobanSpasic/PSS-Revive/tree/main
Under ext_units you'll find midi.pas (Windows), and portmidi.pas (Linux, MacOS, FreeBSD).
Under units, you'll find untUnPortMIDI.pas, that is a supplement to midi.pas in order to have the functionality of portmidi.pas.

If you can get your units to have some similar functionality and API, I would be glad to use them instead of portmidi and have one less dependency.

For Linux, MarkMLI did a lot of work on Alsa MIDI: https://github.com/MarkMLl/asound
Unfortunately, for someone like me, who does not understand how Alsa sequencer works, this one looks extremely complicated, and MarkMLI wasn't really friendly in helping with it.
Although I appreciate his work, I needed an alternative. After a lot of experimenting, portmidi worked nice for me, except under Windows 64bit (no 64bit DLL found to download).

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Working MIDI app for the Mac!
« Reply #3 on: October 06, 2024, 03:23:14 pm »
Thanks a lot! I'll certainly check it out 😃
"It builds... ship it!"

Thaddy

  • Hero Member
  • *****
  • Posts: 17170
  • Ceterum censeo Trump esse delendam
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

bobby100

  • Sr. Member
  • ****
  • Posts: 283
    • Malzilla
Re: Working MIDI app for the Mac!
« Reply #5 on: October 06, 2024, 03:43:22 pm »
Thanks Thaddy.

EDIT: got portmidi to work for Win64, thanks Thaddy, and I see now that I finished just MidiOut for portmidi in my app, but no MidiIn. Got to get some free time to finish this...
« Last Edit: October 06, 2024, 04:18:29 pm by bobby100 »

 

TinyPortal © 2005-2018