Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411595 Posts in 69386 Topics- by 58445 Members - Latest Member: YomiKu_0

May 07, 2024, 07:50:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)What's a good programming language for sound manipulation?
Pages: [1] 2
Print
Author Topic: What's a good programming language for sound manipulation?  (Read 3926 times)
Kegluneq
Level 2
**



View Profile
« on: March 12, 2009, 04:15:53 PM »

So I have this idea for a game: I won't talk about it too much since this isn't the place for it, but the core mechanic I want to use is sound and sound manipulation.

I want to be able to take a predetermined or input sound file (midi, mp3, etc.), display an oscilloscope of the file (like most media players and even MS recorder), AND be able to manipulate the sound of the file: basic stuff like volume and pitch, and more advanced stuff like audio filters (distortion, chorus, reverb, special audio effects).

I am already decently good at java, and am starting to get into flash and even GML, but none of those languages are very powerful when it comes to audio. So what is a good language to learn if I want to do some sophisticated music game? And could you lead me to a decent starting point for the said language? I realize that I won't be able to do what I want immediately with a new language, but I'm willing to try. A friend of mine told me to try C++ but I want to get more opinions.
Logged
David Pittman
Level 2
**


MAEK GAEM


View Profile WWW
« Reply #1 on: March 12, 2009, 04:42:57 PM »

It really depends on what libraries are available for any given language. With C++, there's OpenAL, FMOD, and probably bunches of others that I'm not familiar with. There might be equivalently low-level audio libraries for something like Python, but audio DSP seems like it might be kind of expensive for interpreted languages, so I don't know.
Logged

mcc
Level 10
*****


glitch


View Profile WWW
« Reply #2 on: March 12, 2009, 10:05:29 PM »

The only language I know of specifically for music is Chuck? I don't know how easy [or even possible] it would be to integrate that into a game though.

If it were me I would do it in C++, but I suspect that Python and C++ would be roughly equivalent for these purposes. Maybe Python would be a bit slow if you are doing pure raw by-hand DSP (although maybe not, and you might get that speed back if you used something like IronPython?) but things like filtering, pitchshifting, displaying a spectrum... these are things that you're unlikely to be doing at a low level right off the bat. Probably you are going to be doing all these things through some kind of sound library, and many of the C sound/music libraries likely have python wrappers.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
hexageek
Level 0
***



View Profile
« Reply #3 on: March 13, 2009, 03:08:26 AM »

http://faust.grame.fr/

Quote
FAUST is a compiled language for real-time audio signal processing.

it generates C++ code.
Logged
raigan
Level 5
*****


View Profile
« Reply #4 on: March 13, 2009, 05:20:55 AM »

I'd recommend checking out Pure Data: http://puredata.info/

Logged
Kegluneq
Level 2
**



View Profile
« Reply #5 on: March 13, 2009, 03:55:02 PM »

I should also mention that although sound and music will be the core gameplay mechanic, it will still be a fully fledged game, not just an art game. So languages made primarily for audio but are weak in everything else won't get me very far unless it's compatible with a more powerful language.
But I honestly don't know how that stuff works, I've heard multiple languages being used simultaneously for multiple purposes, but that seems a little too high level for me at the moment.

Also thanks for the help! All of these look good.
Logged
FARTRON
Level 4
****


the last man in space


View Profile WWW
« Reply #6 on: March 14, 2009, 10:02:45 PM »

Pure Data is awesome. Not sure if it fits what you need, but it's worth checking out anyway.
Logged

Everything that was once directly lived has receded into a representation. - debord
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #7 on: March 16, 2009, 08:47:35 PM »

I should also mention that although sound and music will be the core gameplay mechanic, it will still be a fully fledged game, not just an art game. So languages made primarily for audio but are weak in everything else won't get me very far unless it's compatible with a more powerful language.
But I honestly don't know how that stuff works, I've heard multiple languages being used simultaneously for multiple purposes, but that seems a little too high level for me at the moment.
Well if Faust does compile to C++ as hexageek says, that will make it quite easy to integrate into a C++ program...

I guess what it's really going to come down to is how comfortable you are in C++ or the idea of making a game in C++. If making a game in C++ seems like a new or challenging thing to you, then also trying to integrate into another system may be biting off too much. (On the other hand if you are comfortable working in C++ then once you've expended some effort to integrate with another system you may have just saved yourself a lot of work.)

A couple people mentioned PureData. A game utilizing PureData internally is actually a pretty damn cool idea, and would be fairly natural since people already use PureData for visualizations. You'd be able to use PD in this case not just to drive the audio, but also partially to do things like trigger game events. PureData also would be relatively easy to integrate with, there are readily available ways to write plugins for it and if all else fails it's open source under a fairly unrestrictive license so you could just compile PureData itself inside your program.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Kegluneq
Level 2
**



View Profile
« Reply #8 on: March 17, 2009, 12:25:30 PM »

Cool thanks, C++ is definitely new, but I'm fairly comfortable with it since it's syntax is almost identical to java, my first language. I really just wanted to get into a more powerful language while turning one of my ideas into reality at the same time. PureData does seem to be the best choice so far, thanks for the help guys!
Logged
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #9 on: March 17, 2009, 06:38:03 PM »

You should probably be aware then it is also technically possible to write puredata plugins in Java... Smiley
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Kegluneq
Level 2
**



View Profile
« Reply #10 on: March 17, 2009, 07:11:52 PM »

Got it, thanks again.
Logged
TeaAndBiscuits
Level 0
***


View Profile
« Reply #11 on: March 18, 2009, 09:09:15 AM »

Check out FMOD. It has loads of examples ready to work in
C++, C# and VB
It is used by many professional developers and has some very cool support software for manipulating sounds (DSP type stuff)

If your language is JAVA then moving to C# is going to be the easiest step, it works in pretty much the same way with garbage collection and all that jazz but adds a small change in the way data is passed to methods.

Hope this doesn't confuse matters!

-T&B
Logged
Kegluneq
Level 2
**



View Profile
« Reply #12 on: March 18, 2009, 04:22:32 PM »

FMOD certainly does look like a very powerful piece of equipment. It has all of the sound manipulation I need and then some, but I didn't see anything about oscilloscopes or visualizations, do you know if it has that?
Logged
TeaAndBiscuits
Level 0
***


View Profile
« Reply #13 on: March 19, 2009, 05:42:37 AM »

Sorry. I'm only just starting to use it myself. So can't answer those questions Sad

-T&B

Logged
increpare
Guest
« Reply #14 on: March 19, 2009, 06:07:13 AM »

FMOD certainly does look like a very powerful piece of equipment. It has all of the sound manipulation I need and then some, but I didn't see anything about oscilloscopes or visualizations, do you know if it has that?
no, you'd have to program graphical interfaces yourself.
Logged
Kegluneq
Level 2
**



View Profile
« Reply #15 on: March 19, 2009, 03:02:03 PM »

Hmm ok, I wonder if I could use a combination of PureData and FMOD then...
Logged
increpare
Guest
« Reply #16 on: March 19, 2009, 04:33:43 PM »

Pick something and try it dude
Logged
Kegluneq
Level 2
**



View Profile
« Reply #17 on: March 19, 2009, 08:23:38 PM »

Well yea, that's always the best way to figure out what's best. I'm just trying to get an idea of where to start before I actually get to the point in which i CAN start.
Logged
hexageek
Level 0
***



View Profile
« Reply #18 on: March 19, 2009, 10:55:12 PM »

what's wrong with writing your own graphics? it shouldn't be too hard. you know everything about the signal. frequency, resolution PCM data etc... I never tried it but it looks like pretty easy to write an oscilloscope to me.
Logged
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #19 on: March 19, 2009, 11:23:49 PM »

There's not really anything to writing an oscilloscope. There's not really any way FMOD could do it for you. All oscilloscopes do is take your audio output and plot it on an x=time y=amplitude. There's no processing, you just have to draw it to the screen.

If you want a visualizer like iTunes or WMP gives you, you want to look for "fourier transform"s or "short-time fourier transform"s or best of all if it's offered "spectrograms". FMOD will absolutely provide a fourier transform for you and the means to turn that into a frequency spectrum visualization, and you can just plot that the same way you did the oscilloscope data.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic