Forum > Audio and Video

MIDI commands

(1/3) > >>

Chip:
Can I somehow send MIDI commands or other instructions
to the soundcard to select instruments, play notes etc.
Or is there some UNIT available for this.

Ñuño_Martínez:
Yes, you can.  But AFAIK there's not an "standard" way.  You can use a game library, such as SDL (may be you'll need an add-on) or Allegro.pas (version 5 doesn't has MIDI support so you should use version 4 instead).

lucamar:
Also, if you are in Windows, you can use the multimedia services of the system: there should be a JEDI translated unit somewheree in the FPC sources/binaries. Check Microsoft's docs to see how that works.

Linux (and presumably MacOS) shoud have something similar but AFAIK the headers are not (yet?) translated to Pascal ... unless it's in some framework or engine for games, as indicated by Ñuño.

sash:
Probably not very useful info for a beginner, but ...

There's a very promising C++ library RtMidi I wish I'd translate (currently finishing another project), and there are chances I will, at least I'm going to test it as is.

Interesting part it is crossplatform, has C interface (suitable for Pascal), supports multiple MIDI backends (Jack, Alsa) on Mac and Linux.

morknot:
There is the BASS audio library (BASSMIDI) for Windows, Apple and Linux. It is free for non-commercial use. I haven't used BASSMIDI but I have used BASS for playing mp3s etc. for which it works very well. For BASS itself there are quite a lot of examples for Delphi, perhaps there are some for BASSMIDI as well. There is a very useful site forum as well.

Find it at https://www.un4seen.com/.

Navigation

[0] Message Index

[#] Next page

Go to full version