SDL_mixer pops

Greetings:

Is there any way to avoid popping/clicking when halting a channel (using Mix_HaltChannel) in the middle of a sound? Perhaps if the mixer waited until the next “zero” point to stop the channel. I am making a music program where played notes need to be stopped often. Thank you.

Nathan Pierluissi__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

2007/1/5, Nathan Pierluissi :

Is there any way to avoid popping/clicking when halting a channel (using
Mix_HaltChannel) in the middle of a sound? Perhaps if the mixer waited
until the next “zero” point to stop the channel. I am making a music
program where played notes need to be stopped often. Thank you.

Maybe this can be worked around by lowering channel’s volume to zero
just before halting?–
Roman Kyrylych (??? ???)

Well… I’m don’t know exactly what you’re doing of course, but I get
the feeling that SDL_mixer might not really be the right tool for the
job.

Have you looked into using a dedicated musical software synthesizer,
such as FluidSynth?
http://www.nongnu.org/fluid/

I suppose my Audiality engine could do the job too, though I should
say that the 0.1.x branch is dead, as a pretty much complete rewrite
is on the way. (I don’t expect it to be compatible in any way at all,
basically.) The interesting part is that it uses the same type
of “objects” for everything, so sound effects (triggered from the
application) and instruments (triggered from the MIDI player) are the
very same thing - which means both have pitch control, envelopes,
polyphony with smart voice stealing etc.
http://audiality.org/

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Thursday 04 January 2007 23:59, Nathan Pierluissi wrote:

Greetings:

Is there any way to avoid popping/clicking when halting a channel
(using Mix_HaltChannel) in the middle of a sound? Perhaps if the
mixer waited until the next “zero” point to stop the channel. I am
making a music program where played notes need to be stopped often.
Thank you.

My program is basically like the program “TabIt” except I am using a recording of an instument playing each note. This probably takes up too much memory, so I would rather use soundfonts. I just didn’t know how. So I will look into Fluidsynth and Audiality.

Are there any tutorials on how to use them with SDL? Thank you for your help.

David Olofson wrote:On Thursday 04 January 2007 23:59, Nathan Pierluissi wrote:

Greetings:

Is there any way to avoid popping/clicking when halting a channel
(using Mix_HaltChannel) in the middle of a sound? Perhaps if the
mixer waited until the next “zero” point to stop the channel. I am
making a music program where played notes need to be stopped often.
Thank you.

Well… I’m don’t know exactly what you’re doing of course, but I get
the feeling that SDL_mixer might not really be the right tool for the
job.

Have you looked into using a dedicated musical software synthesizer,
such as FluidSynth?
http://www.nongnu.org/fluid/

I suppose my Audiality engine could do the job too, though I should
say that the 0.1.x branch is dead, as a pretty much complete rewrite
is on the way. (I don’t expect it to be compatible in any way at all,
basically.) The interesting part is that it uses the same type
of “objects” for everything, so sound effects (triggered from the
application) and instruments (triggered from the MIDI player) are the
very same thing - which means both have pitch control, envelopes,
polyphony with smart voice stealing etc.
http://audiality.org/

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --’


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

My program is basically like the program “TabIt” except I am using a
recording of an instument playing each note. This probably takes up
too much memory, so I would rather use soundfonts.

No resampling that is; the sounds always play at the rate they were
recorded? Well, that would consume quite some memory… (Sound
libraries for direct-from-disk streaming samplers are often made this
way, but that’s not an issue when you can have gigabytes of samples.)

That said, you still need a few different samples to cover the full
pitch range of most instruments, but the looping, modulation and
filtering capabilities of SoundFonts still makes it possible to get
pretty good sound out of relatively small amounts of data.

I just didn’t know how. So I will look into Fluidsynth and
Audiality.

Well, Audiality will handle the resampling, looping, volume envelopes
and some simple effects, but that’s about it for the real time
sampleplayer part. The focus is on the script (*.agw) driven modular
synthesizer, rendering waveforms at load time. Saves an incredible
lot of disk/download space, but it takes a great deal of synth
programming experience to get anything sensible out of it.

Are there any tutorials on how to use them with SDL? Thank you for
your help.

Audiality supports SDL audio directly, so it’s just a matter of
telling it which driver to use. Well, not even that - SDL audio is
the default output driver. :slight_smile: Anyway, there are some command line
tools and examples in the “test” directory in the source archive.

Anyway, Audiality and FluidSynth can take care of audio I/O on their
own, so what you do normally is just use one of them for audio, and
SDL for graphics, leaving the SDL audio API alone.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Wednesday 10 January 2007 03:33, Nathan Pierluissi wrote: