I just need to be pointed in the right direction as I may be in over my head here.
If I wanted to write a program to analyze a sound wave how would I go about this?
I have an idea that it will involve a mixture of a maths package (like mathematica or matlab) and C or C++ but not sure where to start.
I'm only wondering at the moment but any pointers would be greatly appreciated.
I'm new but not inept and a good challenge is always the best way to learn.
Mathematica and Matlab can both take .wav files as inputs.
Related
Lets say I have the audio file for Happy Birthday. I want to convert that audio file into an audio file that sounds like this : happy birthday.
First, I'd like to know if I have the ability to program this? Can a highschooler who's almost finished with APCS program this?
If I can:
How would I change the bpm of the song? I've searched through a bunch of websites, but they weren't very helpful.
I know that audio files can be represented in waveforms. How would I scan for each individual wave in an audio file (I need this to isolate the notes)?
This is a very ambitious project, actually. One reason is that it involves using digital signal processing tools like FFT (Fast fourier transforms) to analyze the sound to pick out the pitches. You might be able to find a library that can do this, but as far as coding such a tool, that would involve a steep learning curve.
If you would like to look further into this, there is a good online resource called "The Scientists and Engineers Guide to Digital Signal Processing". I was able to work through and understand the discrete fourier transform with only high school math (lots of trig) and a bit of calculus. It was a lift, though.
Trying to analyze rhythm is also no easy task. Even with advanced tools provided in professional notation system such as Finale, people have trouble playing rhythms in time well enough for the best transcription tools. Algorithms that "quantize" the beats help but also limit the amount of detail that can be included in the playback.
My guess is that as interesting and worthwhile as this project would be, to bring it to completion before the semester ends would require putting together prebuilt pieces. A lot of programming is done that way, these days.
If you scale the project back to something like just getting your code to analyze a short sample of a single note and give its pitch, that would be both impressive and doable with a lot of work. It could be done with a DFT algorithm instead of requiring FFT, reducing the amount of info you'd have to acquire first. That way, you'd only have to work your way up to understanding and implementing the material on this link which is about calculating the DFT. Notice that there is example code in BASIC. The code examples throughout this book are a big help.
Or even better, how to get the size of the amplitude or the volume of the wave sound every certain time.
In fact I need the two ways, the full waveform and measure it each time. the first one for have a view of the song wave and the second one for visual effects.
this is for Android (NDK) systems.
come on people, I don't ask for the full code answer, I just want you to tell me some advices or something that can help me. You can simply say that the question is hard or makes no sense. but say something.
Whatever, I researched a little bit and I didn't find the answer for the question, but I did find a better solution for the problem, and is a free library named "superpowered", simple, fast, cross-platform, and has all the functions for analize sounds.
hope this help people new to this world of sound programming
Here is what i like to achieve:
I like to play around in creating "new" software / hardware instruments.
Sound processing and creation is always managed by software. But one could play the instrument via ultrasonic distance sensor for example. Another idea is to start playback when someone interrupts the light of a photoelectric barrier and so on....
So the instrument would play common sounds, but has to be used in an unusal way. For example, the ultrasonic instrument would play a sound if it detects something in a certain distance. The sound could be manipiulated in pitch for example if the distance gets smaller.
Basically i like to playback a sound sample and manipualte this in realtime.
I guess i have to use WAV samples for this, right? And which programming language do you think fits best for this task?
Edited after kevins hint: please kick me into the right direction - give me a hint where to start.
Thanks in advance
Since you're using the the Processing tag, you can try Processing.
It comes with a sound library like Minim or you can install beads which is great. There's actually a nice book on it: Sonifying Processing
You might find SuperColider fun as well.
The main thing is what are you comfortable with at the moment ?
If Processing syntax looks intimidating, you can actually try a different programming paradigm like data flow. In which case you can use PureData(free, opensource) or MaxMSP(very similar, but commercial). The idea is rather than typing instructions, you connect boxes with wires which is fun and the examples are great too.
If you're into c++ there are plenty of libraries. On the creative side, there's a nice set of libraries called OpenFrameworks that's easy and fun to use. If this is your cup of tea, have a peek at Maximilian.
Bottomline is: there are multiple options to achieve the same task. Choose the best tool for your (based on your background) or try each and see what you like best.
You asked "And which programming language do you think fits best for this task?" - I would also suggest using Processing. I have been used Processing to work with sounds previously. And in all cases I used Minim. It has many UgenS to generate sounds programmatically.
Also, you wants to integrate with some sensors. I'm not sure what types of sensors you will use, but Processing goes pretty well with different Arduino modules and sensors. Check this link for more direction.
Furthermore, you can export your project as .exe or executable .jar files. And their JS version (P5.js) works almost the same as the Java version.
I am creating top down game in Pascal for which I want positional sounds. To do this I was going to pass a sound file set at different volumes through each speaker individually, and was going to change the values for the volume as the sound creating object moved around.
However, I cannot find a way to do this, so my question is, is this possible? If yes, how would you go about it? If no, could you show me a more sensible way to control the positional sounds for the game?
Thank you.
Pascal the language? What platform? In any case - OpenAL is probably where you want to start although you may not be able to use Pascal with it. http://en.wikipedia.org/wiki/OpenAL
I've tried looking up how I might go about this for a while now, and maybe I am using the wrong terminology in my searches or it's way too advanced for me. I basically want to be able to analyze audio files in real-time. I know hardly anything about audio processing so I should probably start small and work my way up. Eventually I'd like to be able to display a power (or frequency?) spectrum correlating to audio playing in real time. Basically like the WinAmp spectogram (terminology?)
Any online tutorials with perhaps an API suggestion or two would be greatly appreciated. I've found some vague explanations (mostly dealing with calculating FFT's then converting them to something...) Like I said, I know little of audio processing, so knowing where to start would be great.
Language of choice: C++
You could look into VST plugins as a starting point for the theory behind audio processing. There's a blog with some tutorials in c++ here.
You can also check out other SO questions on VST plugins for more info.
I believe audacity can run VST plugins, I'll look at that.
EDIT: Audacity doesn't support them out of the box, but you can enable it. You could download a trial of something like ableton live too.
I'd recommend using a graphical tool to begin with to prototype some ideas. Try Puredata or something similar.
http://puredata.info/
Juce is a fantastic way to get to grips with C++ with an Audio slant.
http://www.rawmaterialsoftware.com/juce.php
I've also stumbled across UGen which might help you get up and running without having to understand too much of the sample-by-sample processing theory. I've not looked at this much yet but it looks interesting at the outset.
http://code.google.com/p/ugen/
The KVR forums are full of knowledgable people who will help and direct newcomers to audio and plugin development.
http://www.kvraudio.com/
If you're feeling brave the dive in to a good book. I've heard a lot of good things about the following:
http://www.amazon.com/DAFX-Digital-Udo-246-lzer/dp/0471490784
Good luck! This is not an easy area to get going in!
(PS, the blog linked in the above answer is mine -> it's out of date and wont help you actually do any signal processing)