Audio/MIDI C++ library for a real-time application
Asked Answered
M

4

15

As I've already said in another thread, I'm working on a project related to real-time graphical programming for audio (something like Pure Data, Max/MSP, Reaktor).

I did a day of research on Internet, looking for a good (maintained, well documented and highly portable) C++ library for low level interaction with audio and MIDI, but I still can not make up my mind about a library.

I'm considering PortAudio+PortMIDI (PortMedia), but they lack of documentation (especially PortMIDI) and there is no official community, just a mail list (and I think forum communities are very important!), same (or worst) situation with RTAudio and RTMidi libraries.

I also give a try to:

  • STK, I dodn't like its file organization.
  • Juce, I think it does too much for me, I need only an easy hardware integration
  • OpenAL, I didn't understand its architecture, it relies on ASIO/ALSA/CoreAudio...? Can I access to MIDI port?

So... My question is: have you any experience with real-time audio/MIDI? Which library do you recommend me?

Thanks

Matazzoni answered 10/4, 2011 at 14:19 Comment(3)
You might consider just audio features and implement MIDI separately. MIDI isn't too complex and latency there is as already low as it is going to get.Helgahelge
OpenAL is very good when it comes to multi-platform. It doesn't have MIDI, though there should be no problem using a distinct library just for MIDI.Scare
FYI the Portaudio community is very active via their mailing list and they are very open too feedback and questions.Cochran
E
6

I've used both PortAudio/PortMidi and Juce with great results on both. I'm in the process of switching a project over from PortMidi to Juce, because for my uses all that other app framework stuff ends up being incredibly useful (and in my experience, it's rock solid.). YMMV.

Emaemaciate answered 10/4, 2011 at 16:41 Comment(0)
C
6

I've created a C++ audio library named "Crosstalk".

Crosstalk is a real-time C++ audio engine that allows you to create and route audio systems in real-time (Pretty much what your trying to achieve graphically), and it's really easy to use.

Here's an example of how to play an mp3 file:

XtSystem system;
XtMp3Decoder mp3Decoder;
XtAudioDevice audioDevice;

long md = system.addComponent(&mp3Decoder);
long ad = system.addComponent(&audioDevice);

system.connOutToIn(md,0,ad,0);
system.connOutToIn(md,1,ad,1);

mp3Decoder.loadFile("../05 Tchaikovski-Swan Lake-Scene.mp3");
mp3Decoder.play();

You can check out the API documentation and licensing details here: http://www.adaptaudio.com/Crosstalk

EDIT (01-12-2012):

Crosstalk has been replaced by an open-source project called "DSPatch". DSPatch is essentially an upgraded version of the routing engine behind Crosstalk that is no longer limited to only audio processing. DSPatch allows you to create and route almost any type of process chain imaginable, and free for personal AND proprietary use :)

Cm answered 7/4, 2012 at 7:47 Comment(0)
W
4

I would also recommend openFramworks: http://www.openframeworks.cc/ It is meant for all kinds of media, interaction, ... and it has a very easy to use/understand API, which is also pretty well documented. Just follow the link above and check it out.

Good luck, Audiodroid

Wits answered 3/5, 2011 at 13:21 Comment(0)
A
1

In this tutorial series there's a post about reacting to MIDI data. It also covers other topics such as synthesis etc.

Ashly answered 5/10, 2013 at 17:38 Comment(1)
Great tutorial for VST/AU development! Actually my question was related to another topic... Anyway thanks a lot, it seems very interesting and well written!Matazzoni

© 2022 - 2024 — McMap. All rights reserved.