Question on music engine
Dale M.A. Johnson

Is there anyway to create a special "music system" for Allegro games? Let's see if I can explain this...
Well, you know how MOD files store the sound files for the instruments they use? Well, in the interest of space, is there any music file that draws from a common pool of external sound files, so that you use the same instruments for every song? Sort of like the SNES or GBA.
Now I've probebly lost you all...

Goodbytes

You haven't lost me. That would be a pretty good system... I was thinking about suggesting it before... I think. :P

Maybe the creators of DUMB will add that to the DUH music file specification? ;D

Paul Pridham

You could probably make this fairly easily using some basic waveforms (square, sine, triangle, sawtooth, and noise), a simple engine to play multiple looping samples at various frequencies, and using a few simple effects (like ADSR envelopes). Use some simple form of scripting for the music sequencer... say, a list tracks to be played, each with a sequence of notes with duration, and the odd effect inserted here and there.

Poof! Oldschool chiptunes in a can (or something)!

X-G

MIDI does that, sort of.

Thomas Fjellstrom

ohh. this reminds me of an entry from the first SpeedHack. It used a fairly complex 'language' to describe the various 'parts' (instruments) and the actual tune. Its very impressive. I'll try and find a link :)

[edit]Can't seem to find it... But it was very nice :)[/edit]

Dale M.A. Johnson
Quote:

MIDI does that, sort of.

The problem with MIDI is that it doesn't use the same sound bank. Each sound card has it's own, so what sounds good on one care may sound horrible on another. And nothing sounds good on junky sound cards.
I'm looking for something where I create a pool of, say, twenty samples, which would include instruments, percussion, etc. All the songs would load that into the bank. So you get the quality of a MOD but in a smaller size.
That, and I like my songs to use simular instruments in a game, since it gives it an "SNES feel," and it keeps a sort unity to the soundtrack. That, and I said so. :P

Bruce Perry
Quote:

ohh. this reminds me of an entry from the first SpeedHack. It used a fairly complex 'language' to describe the various 'parts' (instruments) and the actual tune. Its very impressive. I'll try and find a link

That wouldn't be SPEED, would it? If there's another entry from the first SpeedHack that does anything like that, I'd like to know! :)

Failing that, there's Cupid which uses some OO stuff to synthesise the sound effects on start-up, or TeleHack which uses DUMB's undocumented architecture to synthesise music (and unwisely sound effects too) in real time, but these aren't from the first SpeedHack...

If you're wondering about DUMB's undocumented stuff - it'll be finalised and documented for DUMB v1.0, but I make no guarantees as to when that'll be ;)

Thomas Fjellstrom

no.. Shawn hard coded all his stuff. The one Im talking about was only a synth (no game), and loaded a text file with a phunky syntax that detailed the tune, tempo, etc...

Julien Cugniere
Quote:

The one Im talking about was only a synth (no game), and loaded a text file with a phunky syntax that detailed the tune, tempo, etc...

I don't know if it was in the first speedhack, but this sounds a lot like Christian Schueler's Virtual Synthesizer...

This is quite an impressive piece of code, and the songs actually sound very good. They are however quite indecipherable :)

X-G

Quote:

The problem with MIDI is that it doesn't use the same sound bank. Each sound card has it's own, so what sounds good on one care may sound horrible on another. And nothing sounds good on junky sound cards.

That's why I said "sort of". ;)

Thomas Fjellstrom

YES!!! That is it :)

I think It was originally released arround the first SpeedHack (I could have swore that was what he ended up dooing for the first speedhack, but never sent it in...)

Paul Pridham

Hmm, now I want to do this. It would be pretty simple and fun and bleepy! :D

Thomas Fjellstrom

Ohhh yeah... You still working on 'Bleepy'?? What ever happened to that project Paul?

Bruce Perry
Quote:

I could have swore that was what he ended up dooing for the first speedhack, but never sent it in...

Well, judging by the comments on the page, it was a SizeHack entry that didn't qualify :)

WoW ;D That is one cool project...

Thomas Fjellstrom

Ah. It was 'A' allegro 'HACK' entry ;)

Paul Pridham
Quote:

Ohhh yeah... You still working on 'Bleepy'?? What ever happened to that project Paul?

It's on my enormous to do list.

Thomas Fjellstrom

Oh, In case anyone had troubles compiling "Christian's virtual synthesizer" with Mingw32, you need to do a few things...

add #define M_LN2 0.69314718055994530942 to synth.h

and change a few of the C++ includes into real C++ includes...

chage:

#include <istream.h>
#include <strstream.h>
#include <string.h>

to:

#include <iostream>
#include <strstream>
#include <string>

Then It sould compile... Now before anyone asks WHY Id want to recompile it... It sounded like crap using XP's emulated SBPro in emulated DOS.. It sounds a bit better using the actual sound hardware :)

kazzmir

im trying to compile christians virtual synthesize for linux. i had to change a few things in the source, but now im getting the error that allegro redefines what fixed is. in iomanip, fixed is an std function in the form of
std::fixed(std::ios_base&)
how do i get around this? i tried #undef'ing fixed right after allegro.h is included, but i guess you cant #undef #typedef's

Thomas Fjellstrom

Im not sure... Hopefully someone else can comealong and help :)

In case you want to hear a sample of what it does... I ogg'ed the space01.txt file...

HERE

[edit]If allegro doesn't provide a #define to change the name... try #defining fixed to allegro_fixed BEFORE you include allegro?[/edit]

[edit2]w0w.. While trying to post the last edit.. The whole allegro.cc site was giving 500 errors[/edit2]

Julien Cugniere

As a nasty hack you could try this (untested):

Quote:

#define ALLEGRO_FIXED_H
#define fixed long
#include <allegro.h>
#undef fixed

You might also need to put this piece of code before the c++ includes...

Dale M.A. Johnson

Apparently the answer to my question is "no." :)

Bruce Perry

Michael: put all your tunes into a single MOD file, so they can share samples. DUMB v0.9.1 will contain the necessary API for you to choose which order to start on :)

In the distant future, the DUH file format will provide exactly what you want - but for now that's vapourware. ;D

Dale M.A. Johnson

So, basically I just pack everything into one MOD file, then use DUMB to select where in the file to start playing? Hmm... Sounds simple enough... Only problem will be getting the repeats to work right, but that shouldn't be too hard.

miran

You could use the "Jump to order" command (Bxx in Scream and Impulse Tracker) to setup several songs inside one file but as I just discovered today, DUMB doesn't support this (very basic and commonly used) command :(

Bruce Perry

Actually, DUMB does support it. The S3M loader is buggy in that it doesn't convert the BCD value to binary (i.e. B12 is interpreted as 'jump to order 18' instead of 'jump to order 12' as it should be for S3M files); but this is fixed in CVS. (Go here to set up CVS, and here for instructions on getting DUMB's CVS version.) In the meantime, you could save your music as IT files.

Please, if you have any mods that DUMB plays incorrectly, send them to me so I can fix any bugs!

miran

Oops, my mistake! I made my own C++ wrapper with support for playlists but it seems I didn't consider song loops...

Thread #219840. Printed from Allegro.cc