Author Topic: Music?  (Read 1085 times)

Offline balanus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Music?
« on: August 08, 2006, 04:05:00 PM »
Is there a way to insert a line in the code to play midis in certain cases?

I have been thinking about that for a time.

We could make group decisions about what midis could be in what part..

or even, make a list of
1.mid - play in combat  
2.mid - play in Namok


So that the player could change it to his tastes.. just choosing his mids and changing their names to match the wanted in game music..

ok, you got the idea.

Offline peter

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Music?
« Reply #1 on: August 08, 2006, 04:42:20 PM »
It would be easy to support that via an external program under Unix/Linux.  Otherwise, it would mean writing some sound code...

Offline balanus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Music?
« Reply #2 on: August 08, 2006, 05:19:22 PM »
I'm know shit about programing codes and stuff...

My GREATEST moment was in mark fortress... I REDID THE MUSHROOMS GRAFS!!!

Don't know if I changed the code correctly.. I know my mushroom patch appears in my own savegame, wich is enough.

Hey, we should have a depository for small art like this..
Mushroons.. and all that stuff.
But this topic is about music..

Can't we have GH  call a mid play of somekind? As I said, I know shit about all this..

Offline peter

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Music?
« Reply #3 on: August 08, 2006, 05:47:16 PM »
Quoting: balanus
Can't we have GH call a mid play of somekind? As I said, I know shit about all this..


 Well, maybe if SDL provides a library function for that.

 Otherwise, you have to open the sound device, open the midi file, read the midi file, write the midi data to the midi device, and all the while checking for errors and maybe printing useful error messages...  At least you can leave volume control to an external mixer.

 Not that I've ever written code that did that, so maybe there's a handy library...

Offline balanus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Music?
« Reply #4 on: August 08, 2006, 06:38:06 PM »
Hm, i'll go have lunch and when I'm back I will do some serious reading and studding... ant links on docs that may shed some light? Or search topics about Gearhead and SDL programing?

Or anyone has another idea about music?

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
Music?
« Reply #5 on: August 08, 2006, 08:02:20 PM »
I know I'd be likely to swap in Guardian Legend music (old NES game) for a few tracks from time to time. Maybe some FF6.
Unless it's really good. :) Does anybody here write music?

Offline peter

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Music?
« Reply #6 on: August 08, 2006, 08:47:44 PM »
How about if gearhead just updated a file that said where you were?  You could have a totally separate program keeping an eye on it and switching the music if you had per-location tunes defined.  That external program could be written in whatever language you wanted, preferably one that made it easy to do midi.  To start it up, you run a script (or batch file) that would start the music server and gearhead, so gearhead wouldn't have to know how to start a program, just write a file.

 I personally just listen to the radio (http://ckdu.ca/) while I play gearhead, or I play some tunes in xmms.  Even if a game has good music, I usually want to listen to something else after I've heard it all a couple times.

 I'm resisting putting much work into music support for gearhead because I think I wouldn't use it (much), and there are a ton of other things I'd rather work on in GearHead.  If someone else wants to code it up, go right ahead.

Offline balanus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Music?
« Reply #7 on: August 08, 2006, 08:53:28 PM »
Ok, I gave up... tried reading those docs and couldn't understand a thing...
damn...
Ok, I'm a marine biologist and teacher.. computer coding is really hard for me. At least  a lot harder than the impacts of sewage on the invertebrate animals of Guanabara bay.
Damned code... weird SDL mixer stuff..

what makes me feel dumber is that there was plenty of Docs and guides.
Ok.

The idea of GH saying to a separate program what to play would be interesting.

Offline peter

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Music?
« Reply #8 on: August 08, 2006, 09:29:11 PM »
Quoting: balanus
Damned code... weird SDL mixer stuff..


 Yeah, I like algorithms a lot better than using funky libraries.  I don't have any recommendations (for anyone else) of where to start looking for docs, because I have no idea myself.  GearHead uses the Jedi-SDL pascal interface to SDL, in case that helps.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
Music?
« Reply #9 on: August 09, 2006, 12:39:12 AM »
GearHead supposedly can already play music, but I haven't tested this very thoroughly... Here's what you do.

Create a text file named "music.cfg". In it, list the path to several music files you want to play (if you copy the files to the GearHead directory just list their filenames). Start GearHead, and it should play them.

Offline Phil Munoz

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • http://aquietfrog.deviantart.com
Music?
« Reply #10 on: August 09, 2006, 01:30:31 AM »
OK, so music is feasible already.  what about sound effects?

Offline draconuszero

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Music?
« Reply #11 on: August 09, 2006, 01:46:41 AM »
I know this is off-topic, but i recall a roguelike called 3059 that just had random midi music playing in the background (one of which is terra/tina's theme from final fantasy vi...).

Offline Phil Munoz

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • http://aquietfrog.deviantart.com
Music?
« Reply #12 on: August 09, 2006, 02:57:08 AM »
DoomRL had both music and sound effects.

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
Music?
« Reply #13 on: August 09, 2006, 03:41:10 AM »
Hewitt-San: I assume it won't play the music according to circumstances or location?

Offline balanus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Music?
« Reply #14 on: August 09, 2006, 03:45:13 AM »
Joseph, the files should be in the main directory?
And the music.cfg should be just like this?
1.mid
2.mid
3.mid
4.mid
5.mid.. . . and so on?

I tried but nothing happened.. maybe we have to change something on arena.cfg?
Anyone tried it?