Dark Bit Factory & Gravity
ARCHIVE => Archive => GFX & sound => Topic started by: taj on January 12, 2007
-
OK I'd like to hear opinions about what music libs, tools and methods to use at what sizes. For example: 4k, 64k, intro, no restriction
eg I see fmod.dll is used a lot at 64k, so how do you compose a 64k tune? What tools? What are the restrictions?
eg 4k can directmusic be used or is it too byte hungry?
Also Im interested what tools and libs people use to do chip tunes FOR PCs. How is the music done in these cracktros I see?
Thanks for any comments and opinions in advance.
-
4k intros - you will need a tiny softsynth or use MIDI music instead.
64K/intros - a good softsynth (eg V2) (http://www.pouet.net/prod.php?which=15073), or you can try uFmod (http://ufmod.sourceforge.net/) or minifmod 1.7 (http://www.fmod.de/fmoddownload.html) , both libs are capable to play .xm files
Demos - For a best sound quality you can use fmod.dll (http://www.fmod.de/fmoddownload.html) or bass.dll (http://www.un4seen.com/), they are capable to play lots of music formats.
Also Im interested what tools and libs people use to do chip tunes FOR PCs. How is the music done in these cracktros I see?
People use music trackers, here some good trackers that I know:
http://www.pouet.net/prod.php?which=20929
http://www.pouet.net/prod.php?which=20494
If you have some trouble using those library (ufmod or minifmod) I can provide an example code for you (C/C++).
-
To play wavs and mp3s with a tiny amount of code you can do
mciSendString("open c:\\tune.wav type waveaudio alias tune", NULL, 0,0);
mciSendString("play tune from 0", NULL, 0,0);
Mikmod is another very portable multiformat mod player. The AHX player is also very small.
Jim
-
Well first thanks for all the advice. I also talked to a musician (Strobe, just registered here - wave - hi mate) about what system to use in the intro category and they preferred xm and bass. So I downloaded bassmod.dll.
And here is the bugger, from learning what the musician wanted to having a working compiled example was 1 hour. When I was doing my 4ks, it took me 3 months of hard work to do my own softsynth, tools (really saida did these) and optimisation. Its *that* much easier to do intros than to do 4ks!!
Holy cow, I was amazed and of course the sound quality is *way* higher.
-
So you've finally got the intro bug Taj? :) And I was looking forward to drawing you some 4 colour bitmap logos for your 4kbs... Never mind. :D
-
To play wavs and mp3s with a tiny amount of code you can do
mciSendString("open c:\\tune.wav type waveaudio alias tune", NULL, 0,0);
mciSendString("play tune from 0", NULL, 0,0);
You can do it smaller and more easy! You dont need any MCI commands... why not just this way? :) You can generate any wave data in memory and just play it with the API command sndPlaySound() ? :)
szFile.c = "GreetzFromVa!n.wav"
sndPlaySound (@szFile.c,#SND_SYNC)
Sleep(1000)
-
Can that API play MP3? But you're right, I'd totally forgotten about the snd*() API. Thanks!
There's also a non-string version of MCI that uses data structures and constant ints for the commands mciSendCommand() which saves storing all the string data.
Jim
-
Can that API play MP3? But you're right, I'd totally forgotten about the snd*() API. Thanks!
There's also a non-string version of MCI that uses data structures and constant ints for the commands mciSendCommand() which saves storing all the string data.
No, the API call sndPlaySound() plays only waves... so this API call would be a nice small solution esp. for playing generated wavessounds. The API dont support any MP3 format. (I will see a 4k with mp3 *rofl* just joking...)
Btw, threre are some other API calls you could use for playing sound in 4k... and i dont mean this MCI related stuff... ^^
-
:D mp3 in 4k is up for grabs!
Other APIs are waveOut and DirectSound I suppose?
Jim
-
:D mp3 in 4k is up for grabs!
Other APIs are waveOut and DirectSound I suppose?
Jim
Yup. DirectSound is definately a chioce as far as I know. Maybe you have a
read on this article ( this is part III ) :
http://www.kebby.org/articles/fr08snd3.html (http://www.kebby.org/articles/fr08snd3.html)
-
Karma++ benny for the link!
-
I'll add my on thoughts at this point.
I wrote a 4k synth from scratch with nothing but listening to Abba as background experience. I learnt a few things:
1. No music format will ever beat your own.
- With lots of design work I was able to get 3 minutes, 8 tracks of *fast* music, down to 300 bytes with my own format. The music file is 14.1kb and compresses to 300 bytes. Thats a compression of about 46x. So the format is very good for compression. kb quotes 30 as being good.
2. A good 4k musician is one who is willing to work in a limited environment
- After 4 months of coding tools and synth (version 6 was eventually used) only one musician could be bothered to use the tool out of maybe 6. I wrote tutorial, help file, had a place to log bugs and still no response. Such size limited music means compromise at an enormous level and not all musicians want to even try.(*)
3. Sound effects are ten times more important than oscillators
- I spent loads of time writing basic oscillators (sin, saw, noise, triangle, square, ramp, sqr, ramp down and so on) and envelopes but the synth only came to life when I wrote effects (echo, distort etc).
4. lo-hi pass use lots of bytes
- In the end I ditched them in favour of some smaller effects. Maybe my code was rubbish though.
5. I wouldnt do the synth it that way again but the music code was good.
- At a basic level, I used my own code to decode the music and generate a wav file that plays using playSnd. No synch. Next time I'll cut down to maybe three oscillators (sin, ramp, noise) or Ill use samples in gm.dls, then I'll concentrate entirely on effects, for example I could pump it through direct sound.
(*) any artist or musician who thinks coders dont make serious compromise at 4k too should think again :-)
-
@taj:
Thanks mate.
It's very interesting to read your thoughts about this topic. I myself didnt spend
a lot of time about this. So it is very cool to here some opinions from another good
and experient programmer like you about this.
:goodpost:
-
If anyone is looking for DirectSound sample code (in C or C++) that uses the above multithread/event technique, give me a shout and I'll post it here.
Thanks for your thoughts Taj. I've never even considered writing my own synth, but I've written AY chip emulations for my Spectrum emulators and never even considered that actually it's very similar - all square waves, noise, and ADSR enveloping.
Jim
-
and what about old Synth/exotic formats (http://www.exotica.org.uk/tunes/formats/index.html) : soundmon, sid, hippel, delta... ?
I already found AHX source replayer, and the BP SoundMon replayer (but a little bit buggy) (see C/C++ section)
how to use these formats in 4k/64k? is the source of Oldskool plugin open ?
or, like Estrayk, it'll be cool to have remakes of some old exotic mods in ahx or mod
(ps: it's for a project I have : do some remakes of old amiga cracktros using c or freebasic with gdi/dx/ogl... for now I only tried with Gdi but I want to use tinyptc/ddraw - here a test (http://cyberpingui.free.fr/skidrow_rb.zip))
-
They're all probably too big for 4kb, simply because they're generic players that can play a wide range of tunes. To make a 4Kb you'll need to slash everything you can, and versatility will be one of the first things to go.
Jim
-
err...yes...
but it wasn't my questions (not only for 4k)
sorry for my post in wrong thread