Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-30-2004, 03:43 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
New Script Commands For Music

I thought up some fairly good ideas for some new commands:

Command 1:
play2 index,filename,x,y;
syntax: play2 var,string,var,var;

Description:
This could allow for more then one music file to be played (I don't no if you can or not with play at once. The filename would only be able to be mp3 or wav files. You could also do the following commands because of the index.



Command 2:
changemusicequil index,bass,tenor,midtone,alto,treble;
syntax: changemusicequil var,var,var,var,var,var;

Description:
(I think tenor is lower then alto right?)
This will make it so you can set the equilize for a sound or music file to allow for more bass or what not. You could maybe make a speaker system using this . This would also allow you to make sounds more radio style using radio npcs? (By making it most or all midtone). The defualt numbers for the bass,tenor,midtone,alto and tredle would be 0.5 and 1 would be the max and 0 would be the min.



Command 3:
changemusiceffect index,decay,echodecay,echolength;
syntax: changemusiceffect var,var,var,var;

Description:
This will allow you to set the envoroment and such for sounds like if you want it to carry far and echo in a stone corridor. The decay would be 1 by default (0 min, no max) and would set how much the sound decays over a distance. For example: If you made it 0.2 or so it would sound really loud (if the volume was high) up close but really quiet 10 tiles away. Same goes the other way around: If you had the decay at a high number like 10, it would sound almost the same volume for a very far distance. Echo decay is at 1 by default and would set how much lower the volume goes down for each echo. Example: A high number would make a very noticable echo that would last a long time because it would take forever to fade away. Vice-versa, a small number would make it sound very dull and flat like i the middle of some plains. Echo length determins the time it takes between each echo. 1 is the default. Ex: Low length would be like a small inclosed, indoor place that would make the echo very short but still have quality. A high number would be like a valley or a canyon, where the echo travels a far distance before coming back to you.



Command 4:
changemusicvolume index,left,right;
syntax: changemusicvolume var,var,var;

Description:
This would just ajust the volume of the music for either/or speaker.



Variable 1:
musicpos(index);
syntax: musicpos(var);

Description:
Would find the position in the song in seconds. You can also change the position of the song (You select the song from the index) by doing: musicpos(i)=var;
This would work for sounds too.


Tell me what you think of these ideas please!
I plan to update this top post more so keep checking back =)
__________________
Do it with a DON!

Last edited by zokemon; 03-30-2004 at 06:17 AM..
Reply With Quote
  #2  
Old 03-30-2004, 12:42 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Being a hobbyist music producer, and having dabled with programming a bit of DSP (Digital Signal Processing) myself, I can state now that it is pretty difficult to write a convincing and powerful eq, ie. one with 6 bands as you suggested. The most efficient method is FFT (Fast Fourier Transform), although it your doing this on say 8 or 9 sounds at the same time, the your either going to need a substandard implementation, or a lot of processing time. When you consider that Graal has NPC scripts and stuff running at the same time, this becomes a severe issue for those with lowere spec'd machines. Reverbs and things are easier to write, but require a lot of memory, and again, similar issues arise for lower spec'd users. Your pan idea is fairly simple to implement, and requires very little resources.

Having said all this though, There already exists dll's and such which perform the above tasks, most likely at a quality that doesn't require too much processing, and at a quality satisfactory for the use in a game.

My main feeling is that the features just wouldn't be viable for older machines, although it would be intriguing to see what other peoples views on this are.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #3  
Old 03-30-2004, 01:24 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
the musicpos(index) one... yea... i think that one should be added. I actually have wanted something like that in Graal for a while, I think. Giving sounds indexes would also be good... for the people who like to put all of their sounds in one file like sprites :P. (haha).

Actually... the thing this would be best for would be looping a song without going back to the intro or necessarily going to the outro until you go into a level where there are scripts to remove the intro/outro barriers and start another song.
Reply With Quote
  #4  
Old 03-30-2004, 03:00 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
Re: New Script Commands For Music

Quote:
Originally posted by zokemon
Variable 1:
musicpos(index);
syntax: musicpos(var);

You mean like:
Quote:
Originally posted by newfeatures2002.txt

script variables musicpos and musiclen to get the posiiton/length
of the currently played music track; this doesn't work for
midis
(i suggested this one <3)
for use with the play command.


And there already is a play2 command.


play2 filename,x,y,volume;
plays a sound/music at x,y with the specified volume (1=default volume)
Reply With Quote
  #5  
Old 03-31-2004, 03:20 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I wasn't paying attention when I put play2, I ment playmp3 or something...

I new there was a play2 just wasn't thinking, my bad

And I knew there was a musicpos also but I ment this one so that you could find the position of ANY playing track (of the requested index).
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 04-01-2004, 04:06 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Personally, I'd like to see more functionality added to mod-like songs (.mod, .s3m, etc.) that would allow you to jump to another pattern in the actual file.

Would also be nice if you could change song position (in seconds) in MP3s and OGGs. So far, all one can do is have the position displayed using musicpos and musiclen.

Some of those suggested features can be done in the wav file itself before being used in Graal. It will make the file larger, but what you want will already be done and it will save Graal time to try and process echos and so forth.

I also suggest browsing through commands.rtf first before you suggest things like changemusicvolume as there already is a similar command available: setmusicvolume left,right; changes the volume for music (0..1)
__________________
Reply With Quote
  #7  
Old 04-01-2004, 05:54 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally posted by G_yoshi
I also suggest browsing through commands.rtf first before you suggest things like changemusicvolume as there already is a similar command available: setmusicvolume left,right; changes the volume for music (0..1)
I have read commands.rtf many times and know it well. The reason I suggest the vomume command is so that you could change the volume of the requested music track with the index you specify.
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 04-01-2004, 11:30 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by zokemon


I have read commands.rtf many times and know it well. The reason I suggest the vomume command is so that you could change the volume of the requested music track with the index you specify.
when you play an MP3, setmusicvolume will know what to change That's why its called setmusicvolume. You only need one song playing at a time.

If you wanted to get creative with changes and things that particular console games use, then it would be a good idea to learn how to track mods and s3ms. From there, push for added script controls to change where it plays. I don't know why you'd want more than one song playing at the same time anyway :/ It will just garble the sound and might hurt someones ears.
__________________
Reply With Quote
  #9  
Old 04-02-2004, 07:30 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally posted by G_yoshi


when you play an MP3, setmusicvolume will know what to change That's why its called setmusicvolume. You only need one song playing at a time.

If you wanted to get creative with changes and things that particular console games use, then it would be a good idea to learn how to track mods and s3ms. From there, push for added script controls to change where it plays. I don't know why you'd want more than one song playing at the same time anyway :/ It will just garble the sound and might hurt someones ears.
Like if you have music playing from a super far distance so it would sound very quiet and you could put a CD player on or something and that would block that out (or if it was quiet enough you could hear the other in the backround)
You could also have this for fading form one song to another
__________________
Do it with a DON!
Reply With Quote
  #10  
Old 04-02-2004, 11:26 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by zokemon


Like if you have music playing from a super far distance so it would sound very quiet and you could put a CD player on or something and that would block that out (or if it was quiet enough you could hear the other in the backround)
You could also have this for fading form one song to another
That is why play2 exists. You specify the file to play and the x/y coordinates where it should be played. Something similar can be done with playlooped:

NPC Code:

//#CLIENTSIDE
if (playerenters || timeout) {
playlooped audiofile;
timeout = 0.05;
}



Though I doubt it would work for music unless its saved as a wav file. This little script here is useful for adding ambience like waves hitting the shore. Just specify the sound to loop and pick the spot where the NPC will be and play the level. It will automattically get softer as you move away from the NPC and louder as you get closer.
__________________
Reply With Quote
  #11  
Old 04-03-2004, 01:03 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by G_yoshi


That is why play2 exists. You specify the file to play and the x/y coordinates where it should be played. Something similar can be done with playlooped:

NPC Code:

//#CLIENTSIDE
if (playerenters || timeout) {
playlooped audiofile;
timeout = 0.05;
}


playlooped, doesn't, fade...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #12  
Old 04-03-2004, 01:51 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
If you look up some of the posts from my accounts from around a year ago, i posted a fading sound script
Reply With Quote
  #13  
Old 04-03-2004, 12:01 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I ment fade from one song to anouther... You would have to have both songs in there for that...
__________________
Do it with a DON!
Reply With Quote
  #14  
Old 04-04-2004, 12:34 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Dach


playlooped, doesn't, fade...
You didn't read what I said did you?
__________________
Reply With Quote
  #15  
Old 04-04-2004, 07:03 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by G_yoshi


You didn't read what I said did you?
I am soo incredibly confused.
*tries it*
WTF??
*falls on floor, dead*
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.