![]() |
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 =) |
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. |
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. |
Re: New Script Commands For Music
Quote:
You mean like: Quote:
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) |
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). |
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) |
Quote:
|
Quote:
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. |
Quote:
You could also have this for fading form one song to another |
Quote:
NPC Code: 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. |
Quote:
:confused: |
If you look up some of the posts from my accounts from around a year ago, i posted a fading sound script :)
|
I ment fade from one song to anouther... You would have to have both songs in there for that...
|
Quote:
|
Quote:
*tries it* WTF?? *falls on floor, dead* |
All times are GMT +2. The time now is 12:04 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.