I want to compose some basic background music for an iPhone game. What's a good program for OS X (10.5.8)? I'd like to save the audio files in a compressed format that's compatible w/ AVAudioPlayer (aif, aiff, caf, mp3, aac, m4a, mp4, wav).
Perhaps something like Logic Studio Express?
Cheers!
Logic Studio Express is definitely a good option. It is loaded with features, and actually developed by Apple IIRC.
You could also try Reason, if that is the sort of thing you are looking for.
Related
I want my IOSDevice to play a sound. Not just some sound that has a format, but a sound litteraly produced by the system. Pretty much like a buzzer or like a very old cellphone or the most famous of all - the NES!
How can i do that without using non-apple frameworks?
I'm pretty sure that Apple won't let you access things such as system sounds. You mentioned NESynth, but I believe that those sounds were produced with mp3 files, not through the system itself. You could do something similar in your project.
I am porting an iPhone app to Mac. On iPhone I use AVAudioPlayer for playing sounds, but it doesn't exist on Mac. What would be the Mac equivalent for playing audio (hopefully as simple as AVAudioPlayer so I can port my app easily)?
Additionally, are there any open source libraries / samples / wrappers available for playing music and sound files on Mac?
As of OS X 10.7, AVAudioPlayer is available on the Mac and Apple recommends using this wherever possible.
Depending on what capabilities you need, Core Audio might be unnecessarily complex. The obvious simple way is NSSound. It's also possible to use a hidden QTMovieView to play sound.
I've written a framework for audio playback, called SFBAudioEngine: http://github.com/sbooth/SFBAudioEngine
It might be a bit more than you're looking for, but it is more capable than NSSound and supports formats (FLAC, Musepack, Ogg Vorbis) that Core Audio doesn't handle natively.
Take a look at Core Audio:
Core Audio is designed to handle all audio needs in Mac OS X. You can use Core Audio to generate, record, mix, edit, process, and play audio.
Is it possible to play .mid files directly via some API, or one have to convert the midi file to e.g. AAC first?
(2 years later…) You can use MusicPlayer and MusicSequence APIs. Available in iOS 5.
There is no Apple API for this. You could write your own, which i think would depend on what you are hoping it is going sound like.
There is lots of available source code for reading midi files and there are a few open source synths for the iphone - or you could use openAl for triggering samples. It probably isn't going to sound like Garageband tho.
If you want it to sound as good as possible you will have to convert it first.
Can iphone mix two sound files or build custom equalizer?
I have studied for weeks about this problem,
and it seems unable to use iphone-sdk to mix two or more sound files or to build custom equalizer.
Is anyone have the experience to do this?
Yes you can. AVAudioPlayer can play multiple sounds and you can control the volume for each. Or you can use Audio Units and have more control over the audio data.
aurioTouch is a good sample app for what you are thinking of.
For simple playback of sound files you can use the AVAudioPlayer class introduced in the 2.2 SDK. It provides playback and volume controls for playing any audio file. As far as I am aware, there are no restrictions on the number of sound files you can play on the iPhone. The only restriction on playing sound files is that you may only play one AAC or MP3 compressed file at a time, the rest of the files must be either uncompressed or in the IMA4 format.
If your needs are more low-level (If you need to do DSP) you might want to look at AudioQueue Services or AudioUnits - two Mac OS X audio processing APIs that are also available on the iPhone.
Does anyone know if there is a free/cheap MIDI player/synthesizer library that I can incorporate into my iPhone application?
As I understand it the iPhone doesn't have native support for MIDI playback.
To work around this limitation I've created a bank of .caf sound samples that I playback myself but I'd really like to improve the implementation and use MIDI if possible.
Any advice would be greatly appreciated.
Since 10 october of 2011, that is since iOS5, Apple has started delivering basic API for midi files playback. The API is called MusicPlayer along with MusicSequence Check this out :
https://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/MusicPlayerServices_Reference/Reference/reference.html#//apple_ref/doc/uid/TP40009301-CH1-SW1
By setting up an appropriate Audio Unit Processing Graph you can output the sound you like.
Look at TiMidity++; it looks like something that should be portable to the iPhone platform.
TiMidity++ is a software synthesizer. It can play MIDI files by converting
them into PCM waveform data; give it a
MIDI data along with digital
instrument data files, then it
synthesizes them in real-time, and
plays. It can not only play sounds,
but also can save the generated
waveforms into hard disks as various
audio file formats. TiMidity++ is a
free software, distributed under the
terms of GNU general public license.
Many people have ported TiMidity++ into various platforms; FreeBSD,
NetBSD, many Linux distributions,
Windows (and/or Cygwin environment),
and Mac OS are known to have their own
versions.
There is a commercial library available from Crimson Technology
Crimson Technology Library
I have never used it so I can't vouch for it's quality.
This is a library I've used for MIDI synthesis in Android:
https://code.google.com/p/android-midi-lib/
Although it can't be used for iOS, I think you(and anyone who's interested) can still take a look at the implementation of the MIDI file format(i.e. how bytes are written to a .mid file) and possibly implement a MIDI library yourself.