Making a preamp with sdl?

Hey everyone,

Long time game programmer, newbie electric bass player, I had the idea of
trying to make a custom pre amp/sound modifier out of a little shuttle pc
case that would be programmable w/ C++ or maybe a scripted language like
python maybe.

Does anyone know if it’s feasible, or a good idea to do the sound
input/output via sdl’s sound interface? Is it possible to take sound input
in SDL?

I was thinking of using linux or bsd for the OS if that makes any
difference.

Not even sure what questions to ask so I guess I’ll leave it at that for now
(:

Thank you for any input on the subject!

Does anyone know if it’s feasible, or a good idea to do the sound
input/output via sdl’s sound interface? Is it possible to take sound input
in SDL?

Sounds like a great idea! However, I hope you’re good in maths cuz
any sound analysis use lots of calculations.

Just as an example. The input you will receive from the sound card
will be a wave, if you want to equalize it (boost the bass, etc…)
you will need to use a Fast Fourier Transform (to change the data into
it’s spectrum analysis form), then you can modify it and retransform
it. This is highly CPU intensive and will require a good sound card
to process the input and output at great quality.

In other words, the project you are undertaking will require good
hardware and good maths.

Good luck,
Simon

Oh boy, I read a book a while back that had a section I skimmed over about
FFT but never even remotely implemented.

Gnarly stuff, thanks for the help, I have a toehold on the problem now at
least (:> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Simon
Sent: Thursday, March 09, 2006 9:49 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] Making a preamp with sdl?

Does anyone know if it’s feasible, or a good idea to do the sound
input/output via sdl’s sound interface? Is it possible to take sound
input
in SDL?

Sounds like a great idea! However, I hope you’re good in maths cuz
any sound analysis use lots of calculations.

Just as an example. The input you will receive from the sound card
will be a wave, if you want to equalize it (boost the bass, etc…)
you will need to use a Fast Fourier Transform (to change the data into
it’s spectrum analysis form), then you can modify it and retransform
it. This is highly CPU intensive and will require a good sound card
to process the input and output at great quality.

In other words, the project you are undertaking will require good
hardware and good maths.

Good luck,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Ok, I have to admit that I’m a bit mystified.

Why would you want to use a thousand dollars or more of computer hardware to
build something to do what you can do with two and a half bucks worth of
integrated circuit chips?

Jeff

if you want to equalize it (boost the bass, etc…)
you will need to use a Fast Fourier Transform (to change the data into
it’s spectrum analysis form), then you can modify it and retransform
it.

(off-topic)

Not necesary at all - a simple low-pass filter would do the job, and
it could be done by any overclocked 80386 :slight_smile:
Generally there’s no need to do FFTs except for analysis.

http://en.wikipedia.org/wiki/Digital_signal_processing--
mvh Rasmus Neckelmann

Well, I don’t know hardware to that level so can’t take that route and I was
thinking it would be neat to have something that was completely programmable
and mess around with it makin my own custom stuff in C++.

I figured it would be more like just a couple hundred bucks to get the
hardware to do it. Just need a minimal system is what I’m guessing.

A good sound card might be a plus but I doubt it would need much CPU, ram,
hd, definitely integrated video card would be fine.

Might even start an open sourced project if people get interested where
people can submit their own sound tweaking code, it could be pretty cool for
people lookin to make a unique kind of sound.> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Jeff
Sent: Thursday, March 09, 2006 10:00 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] Making a preamp with sdl?

Ok, I have to admit that I’m a bit mystified.

Why would you want to use a thousand dollars or more of computer hardware to

build something to do what you can do with two and a half bucks worth of
integrated circuit chips?

Jeff


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Why would you want to use a thousand dollars or more of computer hardware to
build something to do what you can do with two and a half bucks worth of
integrated circuit chips?

Because we’re programmers and not electricians?

=)

So true!

Plus it’s pretty cool thinking about it, imagine your playin your guitar and
it’s going through code that YOU WROTE comin out the amp soundin like you
want it to or soundin like something you stumbled onto on accident.

Not that it’s a good idea, you could XOR the entire stream by a constant if
you wanted to :stuck_out_tongue:

The power is limitless, you could do ANYTHING! (:

And that’s what I think is pretty rad> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Simon
Sent: Thursday, March 09, 2006 10:55 PM
To: j_post at pacbell.net; A list for developers using the SDL library.
(includes SDL-announce)
Subject: Re: [SDL] Making a preamp with sdl?

Why would you want to use a thousand dollars or more of computer hardware
to
build something to do what you can do with two and a half bucks worth of
integrated circuit chips?

Because we’re programmers and not electricians?

=)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Might even start an open sourced project if people get interested where
people can submit their own sound tweaking code, it could be pretty cool for
people lookin to make a unique kind of sound.

It may become more and more out of topic, but not quite… If you’re
interested in programming and sound, check out Csound at
http://www.csounds.com/ it’s a programmable synthetizer that can grab
all kinds of input and resample the sound through all kinds of
filters, etc…

It is specialised in dealing with sounds, that’s the reason why I
mention it. Also, it could be interesting to have an interface using
Csound instead of building your own filter syntax and codes.

Just a thought,
Simon

Why would you want to use a thousand dollars or more of computer hardware
to build something to do what you can do with two and a half bucks worth
of integrated circuit chips?

Because we’re programmers and not electricians?

ROTFLMAO. Good answer! Economically ridiculous, but I love it!

(An engineer is someone who will spend two hours debating the probable
outcome of a five minute experiment.)

JeffOn Thursday 09 March 2006 22:55 pm, Simon wrote:

Not sure it has been said previously but sound input/acquisition is
not available in 1.2 branche of SDL.

I believe the correct nomenclature is “electrical engineer”. He he :slight_smile: Has
anyone ever picked up an EE book before? Programming is easy compared to
that stuff, sheesh! No wonder why entry EE engineers make more than comp.
sci grads. Programmers are spoiled. Well, unless your doing windows
programming. Or multithreaded. Or both :(-----
Matt Johnson
Graphics Developer
VCom3D, Inc.

Why would you want to use a thousand dollars or more of computer hardware
to

build something to do what you can do with two and a half bucks worth of
integrated circuit chips?

Because we’re programmers and not electricians?

=)

Well that answers that then…

Do you know if it’s going to be part of the 1.3 series or any plans to
include it in the future?> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Olivier Delannoy
Sent: Friday, March 10, 2006 5:02 AM
To: j_post at pacbell.net; A list for developers using the SDL library.
(includes SDL-announce)
Subject: Re: [SDL] Making a preamp with sdl?

Not sure it has been said previously but sound input/acquisition is
not available in 1.2 branche of SDL.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello Alan,

Friday, March 10, 2006, 4:25:18 PM, you wrote:

AW> Well that answers that then…

AW> Do you know if it’s going to be part of the 1.3 series or any plans to
AW> include it in the future?

For this task you would be better using something like PortAudio,
which caters explicitly for cross platform audio input and output.–
Best regards,
Peter mailto:@Peter_Mulholland

Why not use something like PD, or MAX/MSP?

PD and Max are similar, but the former is free and runs in Linux. Both of
them can be scripted and customized, and have many, many audio processing
modules. And they work in realtime.

Yeah, it would be fun to have something in SDL, but why reinvent the wheel?
Especially since PD and Max are so good at doing audio.

c.On 3/8/06 2:26 PM, “Alan Wolfe” wrote:

Hey everyone,

Long time game programmer, newbie electric bass player, I had the idea of
trying to make a custom pre amp/sound modifier out of a little shuttle pc case
that would be programmable w/ C++ or maybe a scripted language like python
maybe.

Does anyone know if it?s feasible, or a good idea to do the sound input/output
via sdl?s sound interface? Is it possible to take sound input in SDL?

I was thinking of using linux or bsd for the OS if that makes any difference.

Not even sure what questions to ask so I guess I?ll leave it at that for now
(:

Thank you for any input on the subject!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

What the heck ever happened to that sound input patch done by the folks
at Jim Henson’s Creature Shop? I guess it never got put into SDL…?

http://twomix.devolution.com/pipermail/sdl/2002-April/044183.html

-bill!On Fri, Mar 10, 2006 at 02:01:40PM +0100, Olivier Delannoy wrote:

Not sure it has been said previously but sound input/acquisition is
not available in 1.2 branche of SDL.

Not sure it has been said previously but sound input/acquisition is
not available in 1.2 branche of SDL.

Ok, then… we should add it to the 1.3 wishlist!

Using software for this kind of stuff is tricky if you dont have the rigth
sound hw.
The delays induced by fetching sound buffers in and out of the soundcard
will produce delays at least around 20 ms on standard sound hw. This is what
is known as the the input output delay of “software play through”. Basicly
you will hear the sound of your bass delayed wich make it impossible to play
(the human ear is sensible to delays starting at 5 ms).
So if this amp should work in realtime, you need low delay sound hw.
This is the main reason that expensive soundcards is still sold, even though
much of the work it does could be done in sw. Its all about delays.
Even Cubase is subject to this…

A simple way to test this:
make a simple app that records your bass and playback it in realtime with no
effects. Try if you can get the delay down to accepteble levels. if not,
youre in trouble…

If you still want to try this, I can recommend using PortAudio. It is much
better than the soundsystem in SDL, which I suspect is meant to playback
sound in games and the like.
You can of course still use SDL for windows and GUI…On 3/11/06, Simon <simon.xhz at gmail.com> wrote:

Not sure it has been said previously but sound input/acquisition is
not available in 1.2 branche of SDL.

Ok, then… we should add it to the 1.3 wishlist!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl