is it possible to open and play midi file in iphone and change its tempo? - iphone

Is it possible to play .mid files directly via some API, or one have to convert the midi file to e.g. WAV first? if any one know please tell me i see others all the similar question but its nt wrkng well so if any one know than please tell. thanx.

You could use MusicPlayer APIs for playback.
To alter the tempo, see MusicPlayerSetPlayRateScalar.

Related

Is it possible to convert audio file with some music notes?

I have a music file with a particular tone(music.mp4). I want to convert existing sound file (speech.mp4) into the tone which is specified in music.mp4. Its like converting a speech into some particular tone. I do not want to play both files simultaneously. I want to convert source file with help of some music file. So, output file will be converted file.
Is it possible? I searched for Audio Unit Hosting and Multimedia guide. But do not get any clue.
Thanks in advance.
The answer is: it sounds (no pun intended) like it would be possible with the iOS. You just need to find someone who knows how to program that specific functionality. I do not know why you would think to find the answer in the Apple Docs. I want to know if it's possible to program music that plays backwards. I want to know if I can program a sound that converts my words into something my dog understands. I can't imagine the documentation could possibly cover everything everyone ever wants to program an iPhone to do.
There are no iOS public APIs for frequency analysis of audio files. You would have to write your own DSP code for that. The AVFoundation and Accelerate frameworks have some audio file conversion and math functions that may help, but that is only a small portion of the code needed.

How can I use ffmpeg on the iPhone

I've been searching a lot for ffmpeg on iphone, and how to use it to steam audio(wma ect.)
but cant figure out how this is done.
can someone please try help me on, how to/what to, download and how i get the ffmpeg lib. into my xcode project, so i can use it to steam some links i have ?
another thing is, i read something about the lisence somewhere. is it really true, that if i use the ffmpeg lib, i need to make my project/code, open source?
There is this existing question on SO, but…
You might want to read the Media Player Framework Docs as the functionality you mention already exists in the iOS SDK for many non WMA files. It is probably going to be less of a headache to convert them to mp3 or another format on your server and go from there using the built-in tech that Apple provides.

Programmatically playing MIDI with OpenAL and SF2

I can create a basic MIDI file from scratch verified using TiMidity++, and I know enough OpenAL to play a streamed source from a file.
I'm just wondering if it's possible to create a program in C to play MIDI files by reading in a SF2 and MIDI file and using OpenAL to play the sound. Do I need to use another library? I want to know beforehand because the SF2 format looks pretty complicated.
Core audio is where it's at!
If you are doing this on a mac, DLSMusicDevice does what you want.
if you are on iOS, you will need to do much 'by hand' but it is manageable (tedious, as well). If you go this route, look at the sample code 'mixer host'.
You need to use an CoreAudio. Create an AUGraph with a Sampler connected to an IOUnit. Look at header files AUComponent.h in the AudioUnit framework. Once you've got your audio graph setup you can play a note using the following function:
MusicDeviceMIDIEvent(sampler, status, note, velocity, 0);

Create video in iPhone

I need to convert image sequences(ie,png) to video file in iPhone. How i can convert the images to video.
Regards,
Just ignore bad advice like "use ffmpeg". That would work on the desktop, but the license issue makes including ffmpeg source code in your iPhone app legally questionable. Apple provides a class named AVAssetWriter that you would use in your app to encode a series of images as h.264 stored in a .m4v quicktime container file. While the apple provided logic does work, it is not so easy to actually use and you will need to read quite a lot of documentation to get the code working. If you want to skip implementing it yourself (and likely save yourself 3 or 4 days of work), please consider using my AVAnimator library for iOS as the h.264 encoding logic is already implemented in the class AVAssetWriterConvertFromMaxvid. Once encoded as h.264, the video can be played with the standard player and it is small enough to upload to a remote server.
You are likely going to need something like FFMPEG

Play midi file on the iPhone

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.