I'm considering RTAudio + RTMidi and PortAudio + PortMidi for a new project that requires realtime audio and midi procesing. Can anyone with experience using both libraries recommend one over the other? why?
I prefer a C++ API over a C API but this is not enough for me to make a decision.
I have been locking for the perfect match with that need for a quite long time.
For now I prefer
port audio:
(+) on Windows, supports asio, DirectSound, MME, WASAPI (with header headaches)
(+) on Linux, supports ALSA, OSS, Pulse, JACK
(+) on Mac, supports Core Audio
(+) very active project,and some good gurus are developing it).
(+) used by many very successful apps + the C++ is not native but there is a binding that is integrated to the main branch (since last year i think)
(+) It's really reliable with libsdnfile (which is great)
(-) It's not native c++
(-) the projects, configure, integration is pretty annoying
(-) working well for multiple platforms (debian, osx, seven : my own experience)
(-) much of the documentation sucks and is mostly outdated and contradictory when googling for answers
rt audio
(+) on Windows, supports asio, DirectSound, WASAPI (as of 10-04-2014)
(+) on Linux, supports ALSA, OSS, Pulse, JACK
(+) on Mac, supports Core Audio
(+) native c++,
(+) really easy to get into it
(-) not so much active
(-) much of the documentation sucks and is mostly outdated and contradictory
when googling for answers
other solutions :
Qt :
(-) heavy, not exactly what i'm looking for
(-) real time audio support is recent and not stable
(+) easy to use if you use QtCreator (and less if using QtAddon with visual, and less with xcode)
(+) midi integrated
Juce:
java like design
heavy, not exactly what i'm looking for
simple, and working pretty well (used professional audio)
midi integrated, file reading of aiff and wave, and flac
Here's a relevant thread that came up on the Linux audio devel list. The approach I'll take for my new app(s) is to code for jack and do all my debugging in linux+jack and then use RTAudio for the ports I end up releasing.
Salud!
Getting jack sample rate and buffersize with portaudio
The PortAudio Java bindings are oversimplified. For example, you cannot set exclusive mode or shared mode for device access, which is a shame because it effectively steals 7ms of less latency from you -- especially if you capture microphone input (where usually no shared access is necessary) under Windows 10. If you count in output, you lose out on 14 ms RTT for monitoring your mic/stuff.
RtAudio seems to have WASAPI support now, but I'm not sure if it's better than PortAudio's. But are there Java bindings? Wasn't asked in the question, I know, but still ... :)
Another, rather new project is XtAudio. It exposes exclusive and shared access to devices as different sets of devices to the frontend and in general seems to have a better API support. Don't think it supports MIDI tho.
Related
I'm toying around with constructing a basic music composition system for fun. I can represent music in memory, but I'd (obviously) like to be able to output actual sounds! I don't really care what the format is (MIDI, mp3, ogg, whatever). I just want to be able to load samples into the program and play them in the simplest way possible. I've searched around for a solution but everything I'm seeing is either a) too complex (overhead-wise) for my needs, b) not actively supported, or c) not well-documented. I would love to see an example of sound output or otherwise, some direction on the simplest way to do so.
You might like Euterpea, which isn't on Hackage but was a breeze to install and has quite verbose documentation (it seems it forms the core of an introductory Haskell course at Yale). Hover over the word "Euterpea" in the menu at the top to find more links/instructions.
I ended up using MIDI and sending events to SimpleSynth, on Mac OSX. This was achieved using the hmidi package and the bindings to OSX's CoreMIDI by bkomuves. I had to install a fork of the hmidi package from here to get it working with the latest GHC. I then installed SimpleSynth and enabled an IAC Driver using the Audio MIDI Setup utility on OSX. I then set SimpleSynth to listen from the IAC Driver I set up and was able to use the enumerateDestinations function from bkomuvres' bindings to CoreMIDI to grab the first available Destination and send MidiEvents from hmidi using send. It works like a charm!
With Haskell, you may wish to get a handle on the language fully by utilising other libraries/applications from your code, however the following link is a link to libraries for music and sound.
http://www.haskell.org/haskellwiki/Applications_and_libraries/Music_and_sound
Another idea is to gain familiarity with OpenAL with C/C++ and then from there you will have some familiarity with the structure of HOpenAL (Haskell binding of OpenAL which indeed calls the OpenAL DLL/SO).
Link with straightforward tutorial for OpenAL ago!
http://enigma-dev.org/forums/index.php?topic=730.0;wap2
I hope this helps...
How can I play and synthesize custom waves in Lazarus/Free Pascal? The solution has to be realtime-friendly, as it is for a game engine. It should be also multi-platform, so it can be used on win32, Linux and Mac. FMOD/BASS are out (even if aplicable) as I don't want to pay fees if I will want to use it commercially.
There are solutions to that. My favourite library is Steinberg's ASIO. It is a very simple API, it's got wrappers for Linux, Windows, MAC and i guess some other platforms as well. It is a professional API for low-latency recording / playback. You usually need a soundcard that supports it, but recently some drivers emerged, using native platform API to emulate ASIO device (e.g. ASIO4ALL in windows).
ASIO's got a simple function in which buffers are swapped, where you can generate your wavefrom procedurally to be played back practically immediately (there are latencies in order of milliseconds). That's for the realtimeness.
The API as such is royalty free which means you can use it in a commercial project and don't have to pay anyone.
As for Pascal bindings, I believe you will have to do that yourself. But the whole initialization and operation of ASIO is <100 lines of C/C++ code (and you actually only need to control sound synthesis and maybe device selection - ony two functions that need to be exported by the wrapper) so that really should not be hard at all.
I would like to make a sound synth using the Corona SDK, which means in pure Lua. All the Lua synth programs rely on an underlying C program. Is there any Lua library that generates waveforms?
I have no experience when it comes to Audio.
But here are a couple of links to get you started!
http://www.coronalabs.com/blog/2011/07/27/the-secretundocumented-audio-apis-in-corona-sdk/
http://developer.coronalabs.com/forum/2012/02/09/drone-fx
I don't know if Corona has an audio API that would allow that, but the MOAI SDK is a free, open source, Lua-based engine that targets iOS (+ Android, PC, Mac, Linux) which you could add anything you want to.
Unfortunately, Corona SDK has very weak sound support, and there are not good Lua audio libraries that I know of. MOAI appears to be dead, or mostly dead.
AudioKit seems like the way to write synthesis these days, but it is Swift & Objective-C only. Would love to see it in Lua, but there does not seem to be a push in that direction:
http://audiokit.io/
I am looking for an audio dsp library for cleaning up some speech (voice) recording. I have not decided which language to use yet.
Here are the feature I am looking for:
Work in Linux and Windows
Importing MP3
Working with multiple channels mixing
Noise Filter
Bandpass filter
Compressor
I love to have these as well, but I can write my own if they are not available:
De-esser
multi-band compressor
Expender
Envelopes
(if you can suggest an application that do these in scripting / one mouse click, I will accept your answer too)
What about something like SoX?? http://sox.sourceforge.net/
Take a look at Juce from Raw Material Software.
It is free for non-commercial use, and very reasonably priced for commercial use. it also has a lot of built in audio capabilities (mixing, file I/O, etc.) and has a nice cross platform GUI toolkit as well.
Audacity does most of those things.
I'm looking for an audio processing language or library which will allow me to experiment with different synthesis techniques. I've looked at Processing which I think is great at what it does, but haven't found any inspiring (and simple) audio libraries.
As a baseline, I want to simply create my own sample buffers and play them back (ideally in realtime). As a plus, the ability to handle MIDI events would be great. I'm an experienced C++ programmer so I could do it natively on but had hoped there was a more DSL (domain specific language) approach.
I have access to Windows, Mac or Linux so not too bothered yet about platform. Other languages I can deal with are C#, Java & Python.
Thanks
James
Depending on how much you want to stay out of the low-level housekeeping details, you may want to look at CSound , or if you want to not actually write code, the patching-based system PureData is great to work with. As #Lou points out, ChucK is interesting (but was too buggy to use the last time I checked it out).
If you really do want to write code, look at the Synthesis Toolkit, a set of C++ classes for audio processing and synthesis.
For an app framework, I recommend JUCE, which has incredibly nice cross-platform handling of audio/midi IO and GUI elements.
Max MSP is an audio production tool that is highly expressive.
I guess you could say it's a high-level tool, and not a low-level programming language. My impression of it is that it's geared towards the technical musician or the artistic engineer, but anyway it kicks ass and you could go low-level with it if you want.
I've always been a big fan of SuperCollider. It's designed for Mac OS X but also works on Linux.
The language is mostly based on SmallTalk, and it's pretty easy to pick up if you understand the basics of functional programming. The quality of the sound output by the SC Server is very good and there is plenty of documentation both built into the app environment and available online.
One interesting point of SuperCollider is the usage on android devices, and it's intercommunication with python trough out other modules.
Here goes an example
I know you didn't say Ruby, but check out Archaeopteryx
https://github.com/gilesbowkett/archaeopteryx/wiki
or ChucK
http://chuck.cs.princeton.edu/
Have a look at NAudio, an open source .NET audio SDK for working with audio files and devices in Windows. Some features include:
http://naudio.codeplex.com/
NAudio Features:
Play back audio using a variety of APIs
Decompress audio from different Wave Formats
Record audio using WaveIn, WASAPI or ASIO
Read and Write standard .WAV files
Mix and manipulate audio streams using a 32 bit floating mixing engine
Extensive support for reading and writing MIDI files
Full MIDI event model
Basic support for Windows Mixer APIs
A collection of useful Windows Forms Controls
Some basic audio effects, including a compressor