Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411625 Posts in 69391 Topics- by 58447 Members - Latest Member: sinsofsven

May 11, 2024, 07:27:13 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)I made a little music/sfx routine for you to use (SDL/C)
Pages: [1]
Print
Author Topic: I made a little music/sfx routine for you to use (SDL/C)  (Read 3605 times)
kometbomb
Level 0
***


View Profile WWW
« on: December 20, 2009, 05:49:51 AM »

Hi all,

Sorry for the spammy first message. However, I still think more people should know about a little game library I'm working on, or more like the audio part of it (which is more or less ready). I'm talking about a little music editor and basically a sound chip emulator for an nonexistent chip.

The library is not too well documented or packaged yet but if there's interest I can work on that. What is guaranteed is that it works. I'm also using the library myself (including the gfx part) on a forthcoming game so it's not like the project will be dead until it's ready.

The library is here: http://code.google.com/p/klystron/
The music editor is here: http://code.google.com/p/klystrack/
And here's how the library can be used to play music: http://code.google.com/p/klystron/wiki/MakingNoise

What do you think? Questions, suggestions?
Logged

pgil
Guest
« Reply #1 on: December 20, 2009, 08:49:20 AM »

I checked out your music editor, and though I haven't had time to really mess around with it, it sounds great. I've been looking for an AHX-ish tracker that worked in  windows.
Logged
kometbomb
Level 0
***


View Profile WWW
« Reply #2 on: December 20, 2009, 11:50:04 AM »

I think AHX still is better. I don't know why but it somehow sounds softer but with more oomph.
Logged

pgil
Guest
« Reply #3 on: December 20, 2009, 08:35:46 PM »

You should share this with chiptune communities like 8-bit collective. I think some people there would be interested in this. You might even get a few example tunes out of it.
Logged
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #4 on: December 20, 2009, 09:25:45 PM »

Looks neat.

I think AHX still is better. I don't know why but it somehow sounds softer but with more oomph.
Maybe you just need some EQ?

Is the GUI just done using SDL? I would like to try to get this working on mac. Do you forsee any reason why that would be more complicated than just tossing it in an XCode SDL project and compiling it?
« Last Edit: December 20, 2009, 09:33:02 PM by mcc » Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
kometbomb
Level 0
***


View Profile WWW
« Reply #5 on: December 21, 2009, 12:59:07 AM »

8-bit Collective knows about this already.

Maybe you just need some EQ?

Yeah, it's probably because the (cheap) filter or something. I'll do something about it when someone else complains. Wink

Quote
Is the GUI just done using SDL? I would like to try to get this working on mac. Do you forsee any reason why that would be more complicated than just tossing it in an XCode SDL project and compiling it?

The GUI uses only SDL. Generally, it should simply compile if you have GCC and SDL (and SDL_mixer). I think the only possible problems could arise from the compiler settings and maybe from endianness (because I could not test that on any platforms I have access to).

I don't know about other compilers, though. The code is GNU99, which I think is simply C99 plus some additional C lib code that they left out from the standard but is widely used. I'll help as much as I can if you want to try compiling it (and I will be very thankful! Smiley ).
Logged

mcc
Level 10
*****


glitch


View Profile WWW
« Reply #6 on: December 21, 2009, 01:14:18 AM »

I'll give it a shot and get back to you. OS X just uses gcc so that shouldn't be a problem.

Not a big deal but do you remember which version of SDL you used, incidentally?
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
kometbomb
Level 0
***


View Profile WWW
« Reply #7 on: December 21, 2009, 01:26:27 AM »

I'll give it a shot and get back to you. OS X just uses gcc so that shouldn't be a problem.

Not a big deal but do you remember which version of SDL you used, incidentally?

It's the latest 1.2 (1.2.14). I don't think it matters as long as it's 1.2. I use the SDL_mixer before the latest, though, since at least the Windows binary of the latest SDL_mixer needs mikmod (it used to load it only if needed).
Logged

kometbomb
Level 0
***


View Profile WWW
« Reply #8 on: December 21, 2009, 04:27:43 PM »

This is EXACTLY what I've been looking for a few weeks ago. I'm doing a C64-styled point'n'click adventure and up until now I've been tracking 4-channel mods on my Amiga in order to have chipstyled music, but it's not as authentic as SID. I will definitely be using your library for the music in my game. Great work!!

Ok, that's great news. Let me know if you need anything/think something sucks.
Logged

mcc
Level 10
*****


glitch


View Profile WWW
« Reply #9 on: December 23, 2009, 02:16:41 AM »

Hey, I was trying to compile this this week and I'm a bit confused.

I checked out http://klystrack.googlecode.com/svn/trunk as per the instructions on the google page, and made a build project with the files in src/ (I am not using the makefile because I don't know how to fit that with the slightly weird way SDL builds work on the mac). What I find is that there are a lot of include files being looked for in subdirectories I don't seem to have, for example:

#include "snd/music.h"
#include "gfx/font.h"
#include "gui/slider.h"

My src/ has no subdirectories, and snd/ gfx/ and gui/ don't appear to be anywhere in the svn tree.

Are these libraries of some sort I just don't know about or is it possible that something did not get checked into svn?

Thanks.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
kometbomb
Level 0
***


View Profile WWW
« Reply #10 on: December 23, 2009, 05:33:26 AM »

Are these libraries of some sort I just don't know about or is it possible that something did not get checked into svn?

http://code.google.com/p/klystrack/wiki/HowToCompile

You also need to checkout klystron. It's where the real meat of the sound routines are.

The "-I ../klystron/src" and "-L /code/whatever/klystron/bin.stuff" switches tell where the compiler looks for the files so you can edit those if you don't checkout both projects to e.g. /my_stuff/code/klystron and /my_stuff/code/klystrack. The klystron project is needed also because it includes some tools that are used to pack the resources into one file.

I think it's possible to make the klystrack repo directly refer to the other repo (so it will checkout both automatically) but I'm not sure how that should be done.

Hopefully that didn't make you to give up.  Tongue
Logged

mcc
Level 10
*****


glitch


View Profile WWW
« Reply #11 on: December 24, 2009, 01:57:30 AM »

Thanks, I got it now!

So I hope it's okay to keep bothering you here but... I can get it to compile now but then it dies when I try to run it because of course it can't find the resources so it crashes the first time it tries to use a font. I'm not sure if it's possible for me to get the "make zip" to run on the mac here. When I copy the "res" folder from one of your windows nightly builds into the app's pwd and run the executable I've built this doesn't seem to help any (it only seems to contain one file named "default" anyway?) Can you describe to me how to make the resource tree "by hand", or do you otherwise have any advice?
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
kometbomb
Level 0
***


View Profile WWW
« Reply #12 on: December 24, 2009, 03:36:33 AM »

Take a look at the Makefile. RES_PATH sets the directory where the resources are, I think on OSX the Makefile detects the OS as Unix and tries to find the file in /usr/lib/klystrack. You probably know better where binaries and data files should be located in OSX.

However, it's weird that the file itself is not created. The makebundle tool in ../klystron/tool/bin should run. Does it output an error or...?
Logged

Bad Sector
Level 3
***


View Profile WWW
« Reply #13 on: January 02, 2010, 09:31:33 PM »

That's awesome. I was thinking about creating a software sound/music synthesizer recently (although not modeled after or like an existing chip) and tracker and this makes me want to start working on it.

On the other hand, Torchlight running at the background makes me think "maybe later" :-P.

But good work on that :-).
Logged

~bs~
kometbomb
Level 0
***


View Profile WWW
« Reply #14 on: January 03, 2010, 12:28:19 PM »

Hey,

I was gonna try the music editor today, but as soon as I run the .exe it immediatelly closes again with a Windows error "X has encountered a problem and needs to close... blabla". I get to see a small SDL window for a second or so before the error, but that's it. Have I missed something perhaps?

Hmm, can you be a bit more specific? Does it create stdout.txt and stderr.txt in the same directory with the .exe and if so, do those files contain any information?
Logged

deathtotheweird
Guest
« Reply #15 on: January 09, 2010, 02:18:02 PM »

works fine for me. im on windows 7 if it matters.
Logged
kometbomb
Level 0
***


View Profile WWW
« Reply #16 on: January 11, 2010, 03:07:28 AM »

All I can think of is that there's some code in there that needs a recent processor. I'm not sure if the .EXE headers indicate the used instruction set so that Windows could warn you about it, if that is the case. I'll try to hurry up with the next release which I'll compile to have only Pentium II code or so.

Edit: Try this: http://klystrack.googlecode.com/files/klystrack-nightly-r473-win32.zip
« Last Edit: January 11, 2010, 03:27:52 AM by kometbomb » Logged

kometbomb
Level 0
***


View Profile WWW
« Reply #17 on: January 17, 2010, 06:32:54 AM »

NP, do file a bug report if you find the code is too slow on your a bit older computer. Smiley
Logged

Bood_war
Level 10
*****


View Profile WWW
« Reply #18 on: January 23, 2010, 08:27:06 AM »

I just want to point out that this is the true 10001th topic.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic