I want to know if there is a way in c++ or objective-c to get the BPM of a Mp3 file.
i found until now a source code for stuff that do it on wav files and not on mp3 file,
BPM (or beat) detection is a complicated algorithm that involves analyzing the sound stream in different ways. For this to happen, at least internally the MP3 must be decoded. Typically these are things you'd actually write in a language such as but not limited to C++ or Objective-C.
There are many libraries / pieces of code available that solve both problems, or in the case of beat detection: take a shot at it.
There's certainly no way to do BPM detection in the core C++ or Objective-C languages. You need to write the functionality yourself or take advantage of one of the many libraries that provide it.
If you can't find a suitable library that supports MP3 directly then you're going to have to decode to PCM first.
Related
How can I play MIDI files with VB.NET? I tried using WAV, but they are too big. Any help?
look at this article i used it before and it works.
http://www.codeproject.com/Articles/8506/Simple-VB-NET-MIDI-Wave-Play-Class
just copy paste that code in your project.
create variable which holds your midi and
call the play method.
you can also try this.(not sure about it.)
http://support.microsoft.com/kb/141756
Using MIDI files can be a good idea in regard to size, but IMO a horrible idea when it comes to actual sound (or lack there-of :) ). You can find users which do music too, and has a little better alternative set up or connected to their system, but to make users fire up their MIDI instruments and so forth to listen to a MIDI-track in a software can be a bad idea if unexpected.
Most users though are stuck with the built in wave synth from Microsoft which is a torture instrument (pun intended) and should probably not be used ;)
Why not consider compressing your wave data instead using MP3 or some other excellent compressor such as AAC, Ogg Vorbis ?
This will reduce the original data amount to at least 1/10 of the original size and unless you are providing a whole album, should be overcome-able.
You can find various ways to do this, from simple such as this one using the Media Player, or more low-level such as this one which decodes the MP3 file.
Also take a look at SlimDX.
For reasons that are hard to understand, since Audio Queue Services are a pure-c wrapper, the only example for recording, SpeakHere:
Is a pretty large and interesting working application, which is a lot to parse for an example
Includes .cpp files and even some .mm files. For the obj-C programmer that only occasionally uses pure C, this is a big hurdle.
Are there any examples of using AudioQueueServices, especially recording, via a simple example that does not use C++?
I'm developing experimental multiplayer roguelike for iOS. Players will be connected via GameKit API and they'll be put in one dungeon. There is various actions that players can perform, so I want to make one device be a host, and to implement some sort of RPC for sending/receiving of this actions (and pretty complicated state of dungeon when game starts)
I need some compact and fast serialization. I'm choosing between protobuf and binary plists. Binary plists looks pretty simple to use for objc objects serialization/deserialization (this is important point, cause its experimental non commercial project), but it looks inefficient. Protobuf looks efficient, but totally alien. Any alternatives?
Edit: just found http://msgpack.org/. Looks like a way to go
Protocol buffer serialization should be faster than binary plist.
Also, if you want to make the game again on android or any other platform then protocol buffers will be your friend. (platform independence)
Working with protocol buffers on ios can be a pain in the beginning. Just setting up the project with XCode takes up a lot of time.
Initially i tried to work with objective c version of protobuf, but i had to drop it completely because of some limitations in the library.
I have now added the google source code directly on Xcode, ands its working perfectly. check out this answer. Through this you'll be able to start working with protobufs in your project easily.
Are there some particular library files available on OS/X that are relevant, I am just not sure where to start.
You'd probably want to use the QuickTime for that. There is some sample code that does this. However, it's not the nicest way to access metadata. The newer QTKit Framework somehow still requires you to fall back to the C-based APIs. There is another example from Apple embedding meta data writing into a Objective-C method. This might be the best starting point for you.
Are there any Open source APIs available for wav to midi conversion? You find many open source software, but I couldn't find APIs. Is there any way I can find them? Also are there any Open source APIs available for music transcription? (i.e. generating a digital version of a music sheet). Greatly appreciate any form of direction or assistance. Advance Thanks
Converting from wav to midi is a very difficult and error prone operation, not often done as far as I know, which will very often give poor results, so having an API to do that would be silly, though libraries may exist for it used in the Open Source software you mention. .wav files have no useful metadata that can help you get back to midi. It's much harder than speech to text to do well! (harmonics and noise matter). Will probably work OK for single instruments playing though, with strong fundamental frequencies that can be picked out with fourier transform.
For OCR of sheet music, I have found a piece of GPL'd software called Audiveris. This task isn't as hard as the previous thing, but is still a highly complex operation, probably requiring manual intervention to correct errors, that having a simple API for is pointless.
If you are making some Open Source software yourself, you can of course attempt to adapt swathes of code from these projects for whatever use you have in mind, though I doubt it would be worth the effort.
If any of the software you find has a command line interface to start a conversion, you could execute shell commands from your own software to make them do the required conversions automatically.