Recent

Author Topic: DMS MIDI Monitor  (Read 1285 times)

dstrenz

  • Newbie
  • Posts: 6
DMS MIDI Monitor
« on: March 28, 2025, 12:12:20 pm »
Opensource Free midi monitor utility for Windows is now on github: https://github.com/dswwood/dmsMidMonGithub
Lazarus/Free Pascal source is included. Or just download and run the exe.
Good for debugging, learning, modification, general MIDI troubleshooting, and the source code is a good head start at writing a midi device editor.

Why? I noticed that there are few MIDI utilities available with pascal source code.

Thaddy

  • Hero Member
  • *****
  • Posts: 16805
  • Ceterum censeo Trump esse delendam
Re: DMS MIDI Monitor
« Reply #1 on: March 28, 2025, 01:56:07 pm »
Why? I noticed that there are few MIDI utilities available with pascal source code.
????
Nonsense
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

dstrenz

  • Newbie
  • Posts: 6
Re: DMS MIDI Monitor
« Reply #2 on: March 28, 2025, 02:14:59 pm »
Oh? How many are there?

Zvoni

  • Hero Member
  • *****
  • Posts: 2961
Re: DMS MIDI Monitor
« Reply #3 on: March 28, 2025, 02:37:36 pm »
« Last Edit: March 28, 2025, 02:39:07 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

dstrenz

  • Newbie
  • Posts: 6
Re: DMS MIDI Monitor
« Reply #4 on: March 28, 2025, 03:03:51 pm »
Looks like that's for playing midi files.

This one is for monitoring what goes to and from a midi device, like a synth. I couldn't find anything with pascal source that would let me send a sysex message to a device and monitor what the device returns. Years ago, I wrote a more elaborate shareware program for Win3.1 named WinSysex using, uh, I think it was called Borland Pascal back then. I lost the source when my tape backup drive died.

So I write this, make it publicly available with source, upload it to github, 'announce' it on reddit, facebook and here. And literally, the only feedback I've gotten is along the lines of 'bah, nonsense.' I've learned my lesson..

bobby100

  • Sr. Member
  • ****
  • Posts: 271
    • Malzilla
Re: DMS MIDI Monitor
« Reply #5 on: March 28, 2025, 03:14:21 pm »
Don't let the comments demotivate you. I've got through the same treatment from some senior/pro coders here. They aren't really friendly with hobby-coders and/or less-knowledgeable coders.

dstrenz

  • Newbie
  • Posts: 6
Re: DMS MIDI Monitor
« Reply #6 on: March 28, 2025, 03:48:52 pm »
Don't let the comments demotivate you. I've got through the same treatment from some senior/pro coders here. They aren't really friendly with hobby-coders and/or less-knowledgeable coders.

Thanks! Add retired coders to that list. I was principal software engineer at 2 companies for 15 yrs. Our largest customers were ATT and Alcatel. I was the data librarian on Borland's Compuserve forums, to give you an idea how old I am, and beta tested several versions of TP and BP and Turbo ASM. I wrote an ASM Boyer-Moore implementation which Kim K used in TurboPower's Sys-Tools. But I never achieved a high post count in the Lazarus forums. Maybe someday..

bobby100

  • Sr. Member
  • ****
  • Posts: 271
    • Malzilla
Re: DMS MIDI Monitor
« Reply #7 on: March 28, 2025, 07:25:47 pm »
As for your MIDI Monitor - the midi.pas you use there, it is well known and very much used, but it is Windows only.
If you take a look at my GitHub (link in my signature), you'll find a couple of tools dealing with MIDI. I've used the same midi.pas as basis, just like you, and also added some support for Linux and OSX on top of that. Unfortunately, I've added just MIDI Out for Linux and OSX. I didn't get time to finish MIDI In.
If you take a look at midi.pas you're using, there is that whole thing with PostMessage to GUI. I am missing that part for Linux and OSX.

dstrenz

  • Newbie
  • Posts: 6
Re: DMS MIDI Monitor
« Reply #8 on: March 29, 2025, 01:17:46 pm »
Oh, I didn't know you were into MIDI stuff. Interesting! I disregarded linux and osx for this because my daws (except reaper) and synth usb device drivers and librarians are Windows-only. I've never used linux for midi and I don't own a Mac so it would be unfeasible to test them.

Yes, midi.pas made this much easier. The places in midi.pas where he specifically calls PostMessage() can be replaced with procedure variables as he does with OnMidiData, no?

I don't know how the linux and osx messaging system works but I imagine the PostMessage() stuff in midi.pas can be made more generic by using by queuing incoming messages and then enabling a Ttimer to process them?

bobby100

  • Sr. Member
  • ****
  • Posts: 271
    • Malzilla
Re: DMS MIDI Monitor
« Reply #9 on: March 29, 2025, 07:20:34 pm »
TTimer could probably be used for SysEx, but I don't know if it can be used for real-time data like recording from MIDI.
I've read somewhere (probably here on the forum), that TTimer isn't very reliable, and it can "skip a beat" if the system is under heavy load, e.g. if you set it on one second, it may trigger in one second, but it can happen it triggers a second latter.
Yesterday, I saw a post here on the forum mentioning asynchronous calls, and these are cross-platform. I should give it a try, but I can't promise I'll have time for this in the next couple of months.
I've used PortMidi on Linux and OSX. If you take a look at my GitHub projects, I've made an interim unit that uses PortMidi internally, but it has the same calls as the midi.pas for Windows. This way, I didn't need to change the code of the main app.
I am considering to move the whole MIDI In and Out to PortMidi on all the platforms. This wasn't an option for me earlier, because I couldn't find 64bit DLL of PortMidi for Windows anywhere on the internet, but someone here convinced me to compile it myself and I have my 64-bit PortMidi.dll now. Aaaand that is the point where I've stalled with codding at all, a couple of months ago.
As for Linux - a have a dual boot on my laptop and I am using it just for compiling. OSX is another story - you can set it up as a virtual machine, but Apple will not be happy about it. The only legal way is to buy a Mac.

flowCRANE

  • Hero Member
  • *****
  • Posts: 914
Re: DMS MIDI Monitor
« Reply #10 on: March 29, 2025, 08:58:15 pm »
It would be good to remove the dmsmidimon.exe file from the repository. Strange that this file is in the repo, despite the fact that you have a *.exe filter in the .gitignore file. Something went wrong with those filters, so it needs to be corrected.

Besides, nice work — keep going!
Lazarus 3.6 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on a retro-style action/adventure game (pixel art), programming the engine from scratch, using Free Pascal and SDL3.

hukka

  • New Member
  • *
  • Posts: 45
    • Github
Re: DMS MIDI Monitor
« Reply #11 on: March 29, 2025, 09:11:01 pm »
I've had success with RtMIDI on Windows and Linux. (It should also support Macs but I have no experience with them.) I use it in my DJ app that needs to interface with various DJ controller hardware.

bobby100

  • Sr. Member
  • ****
  • Posts: 271
    • Malzilla
Re: DMS MIDI Monitor
« Reply #12 on: March 30, 2025, 02:09:48 pm »
I've had success with RtMIDI on Windows and Linux. (It should also support Macs but I have no experience with them.) I use it in my DJ app that needs to interface with various DJ controller hardware.
Wow, I just love these GUI controls you have there. I am stealing it :)

dstrenz

  • Newbie
  • Posts: 6
Re: DMS MIDI Monitor
« Reply #13 on: March 30, 2025, 03:17:31 pm »
Bobby:
I'm more focused on using midi for device editing which isn't time-critical. You're way ahead of me if you're doing real time midi sequencing. The last time I did anything like that was with a MPU-401 on a 4.7mH PC in the early 90's. Ttimer would certainly not work for that. Its low priority, which works great for notifying that the gui needs updating specifically because it won't interfere with cpu processes that need priority, like the callback itself.

I looked at your github projects yesterday and it was kindof difficult finding midi.pas that we were discussing. I remember seeing something about portmidi but don't remember which project. It's a multiplatform 'portable midi' library, right? I admire your dedication to making it work with FP.

I have a couple of dual boot linux machines too, but haven't used them for music creation. I use a dedicated windows machine for that.


flowCRANE:
This was the first project I've ever uploaded to github. I use git though, and have a small server here on the lan used as a 'remote' repository.

I uploaded the .exe file after the fact so people can just download and use it without needing to compile it. Most musicians I know don't know what a compiler is. I did put the exe file in the 'releases' section, but it's somewhat hard to find. So I manually uploaded a copy to the repo. I wish the [<> Code] dropdown would show the exe. Why would it be good to remove it from the repository?

Thanks for the encouragement!


Hukka:
RtMIDI looks very nice. At a glance, it seems to work somewhat like the MPU-401 protocol. Pretty easy to use at a high level.

 

TinyPortal © 2005-2018