SDL_Mixer or SDL_Sound: Selecting Position in the Music

I load an IT File and want to start at a special pattern. Is there a way with SDL_Mixer
or SDL_Sound ???

CU

I load an IT File and want to start at a special pattern. Is there a
way with SDL_Mixer or SDL_Sound ???

SDL_sound doesn’t have a means to do this, short of throwing away X
decoded bytes at the start of the file, which is probably not ideal.

–ryan.

“Torsten Giebl” wrote in message
news:a5ovlc$1334$1 at hoth.stenstad.net

I load an IT File and want to start at a special pattern. Is there a
way with SDL_Mixer
or SDL_Sound ???

No.

I would also find something like this useful. In my current game, I
want to construct my music as lots of small segments that are pieced
together at runtime depending on various factors. Storing the
segments as individual IT files would result in a huge waste of disk
space as each file would have its own copy of the samples.–
Rainer Deyke | root at rainerdeyke.com | http://rainerdeyke.com

Hello Rainer Deyke !!

This is exactly what i want. The Musician packs together 4 Musics. The
4 Musics begin at different patterns. To make sure not to play into a wrong
music at some time, at the end of every music is a jump to the start of the music itself.

This really saves a lot space, when we are not doing this every of our Musics would
be 4MB big * 3 or 6 Levels a World * perh. 3 Worlds. Not everybody has DSL
and wants to download such a big Game.

We want to use this for http://turrican.noisebay.org !

CU

“Rainer Deyke” schrieb im Newsbeitrag news:a5p29b$147q$1 at hoth.stenstad.net…> “Torsten Giebl” wrote in message

news:a5ovlc$1334$1 at hoth.stenstad.net

I load an IT File and want to start at a special pattern. Is there a
way with SDL_Mixer
or SDL_Sound ???

No.

I would also find something like this useful. In my current game, I
want to construct my music as lots of small segments that are pieced
together at runtime depending on various factors. Storing the
segments as individual IT files would result in a huge waste of disk
space as each file would have its own copy of the samples.


Rainer Deyke | root at rainerdeyke.com | http://rainerdeyke.com

Maybe an SDL_music lib would be nice for this kind of thing ? It would only
support module-like formats, of course, things like mp3 and ogg are really
just long samples…

SDL_music could fx. collect samples in a sample-pool, collect patterns in a
pattern-pool, etc, and pick and choose pieces from these, possibly at user
request, for fx. passing on to SDL_sound - dunno if that would be possible in
all cases, just thought of this now =)On Saturday 2. March 2002 00:02, you wrote:

I load an IT File and want to start at a special pattern. Is there a
way with SDL_Mixer or SDL_Sound ???

SDL_sound doesn’t have a means to do this, short of throwing away X
decoded bytes at the start of the file, which is probably not ideal.


Trick


“There is no magic” - Nakor, magic user

I found that in the SDL_mixer file music.c in the lowlevel_play function:

#ifdef MOD_MUSIC
case MUS_MOD:
Player_SetVolume((SWORD)music_volume);
Player_Start(music->data.module);
Player_SetPosition(0);
break;
#endif

Is perhaps SetPosition what i want ???

CU

“Torsten Giebl” schrieb im Newsbeitrag news:a5ovlc$1334$1 at hoth.stenstad.net…> I load an IT File and want to start at a special pattern. Is there a way with SDL_Mixer

or SDL_Sound ???

CU

I know a way of saving more space… :wink:

How about some 3 kB for a song with “almost studio synth quality”? There
will be a demo or two in the next Kobo Deluxe release.

BTW, I’m storing sounds and songs as separate files, and songs currently
address sounds by their “waveform IDs”, and so songs can share sounds
both on disk and in memory. (Not that the former actually matters when a
sound takes 500 bytes on disk on average…)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Saturday 02 March 2002 11:47, Torsten Giebl wrote:

Hello Rainer Deyke !!

This is exactly what i want. The Musician packs together 4 Musics. The
4 Musics begin at different patterns. To make sure not to play into a
wrong music at some time, at the end of every music is a jump to the
start of the music itself.

This really saves a lot space, when we are not doing this every of our
Musics would be 4MB big * 3 or 6 Levels a World * perh. 3 Worlds. Not
everybody has DSL and wants to download such a big Game.

[…]

SDL_music could fx. collect samples in a sample-pool, collect patterns
in a pattern-pool, etc, and pick and choose pieces from these, possibly
at user request, for fx. passing on to SDL_sound - dunno if that would
be possible in all cases, just thought of this now =)

This sounds a bit like what the Kobo Deluxe audio engine will do, and to
some extent, already is doing… “Waveforms” - which can actually be MIDI
files - are stored in a global bank, and the structured “waveforms” (MIDI
sequences) can use other “waveforms” as instruments. “Modules” are
actually scripts that load a MIDI file along with the sounds and any
other MIDI files it uses.

(“Waveforms” should actually be renamed to something more sensible - or
perhaps it’s just that a separation between waveforms and instruments is
needed on this level…)

Right now, I’m actually playing MIDI files right from the binary data
loaded from the files, but this will change. Eventually, I’ll eliminate
all MIDIisms from the internals of the engine, split up the player to
manage tracks and channels separately and various other things. There
will be dynamic channel allocation (which is not the same thing as
dynamic voice allocation - which I already have!) and per track “program”
-> waveform mapping, in order to keep songs completely separate when
playing at the same time. (This is required to do crossfades, and play
songs from whithin songs correcly.)

Anyway, regardless of what internal data format the sequencer is using,
it would be possible to convent patterns from modules into it, and then
load the sounds or instruments as “waveforms”. Finally, one would convert
the song into another, top level sequence, that plays the "pattern"
sequences in order.

At this point, it might be obvious that it would be quite easy for an
application to look up the patterns to play them one by one - or to write
use multiple songs sharing patterns and instruments.

Of course, you could also write an EEL script “instrument” that plays
waveforms, instruments, patterns or sequences of patterns depending on
the pitch and/or velocity arguments you give it when you “play” it. (It
would load as another “waveform”, and would be played like one, and thus,
it could use all of the modulation parameters that any instrument uses.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Saturday 02 March 2002 13:13, Trick wrote: