AGI Sound Script Utils Released

sonneveld Hi,

Ok, finally made available the tools necessary to compiler/decompile agi sounds/scripts.  It's also the very small beginning for an AGI Developer site.

Description from the readme:
These two tools are used to decompile agi sound objects into user-editable scripts and then recompiled again.  Handy to have if you want to edit an agi sound file, but don't want to fiddle around with hex editors.  You can also increase, decrease the length of songs, add a silence at the end.. whatever you want really.

The hope, later on, is for converters to just output a script file and it will be later on compiled to the agi format.  Saves the hassle of the converter actually writing an agi file.

Source *IS* available.. for free.  I would like binaries for other operating systems.

- Nick
AGI1122 Well I guess it is time to test it out. Lets see if I can make some songs.
AGI1122 That is pretty good. I liked using that tool. Well I made a cordinated sound that goes to the ego walking. Check it out here. By the way nobody steal the character I used. I am going to make a game with him. What I did was make the sound go to his feet touching the ground. I included the source to the sound file so you can have a look at it.
sonneveld just remember, whenever you called "tone" or "noise", you're actually opening a new channel.

you've called noise 3 times.. but you're only going to open 1 noise channel.  the rest will be ignored.  I'll have to add a warning message to the compile.

noise's also only support a frequency of 0-3 (where 3 borrows the frequency from channel 3)

I hope this helps.

- Nick
sonneveld ok, I'm going to start work on a midi converter since the current one we've got only converts to rol's and is apparently not open-source.

might take a short while though..

- Nick
AGI1122 Ok thanks I will go and fix that. I did have one question about it though. What is the highest frequency count you can use?
sonneveld ok, AGI sounds are defined by the freq_count.. the frequency is

= 111860 / freq_count

so if freq_count = 1.. the frequency is 111860Hz
if the freq_count = 111860.. the frequency is 1Hz

If you want to play a frequency of 440Hz.. you would play a note of freq_count 111860/440 = 254.

I hope that makes sense.

- Nick
AGI1122 Yeah I understand that. I just hope other people can understand it when wanting to make sounds.

So I was playing the initial sound at 111860/500 = 223.72 ;D Well thanks for clearing that up.
sonneveld I think it's the other way round

111860 / freq_count = frequency

so 111860/500 =  223.72 Hz

remember.. instead of a, freq, atten, duration
you can use f, which will accept the actual frequency
I haven't tested it actually.. but it should work.

- Nick
AGI1122 Yeah I think I do have it backward don't I. *slaps head* Hopefully I will get better at making the sounds and actually create a good theme song. :D
Nailhead Excellent tool Nick! Works like a charm.

That's a cool demo too Chris, I like that guy you've drawn.
eidolon Glorious!

And I have another idea. Since your interpreter plays sounds so good, Nick, could you make a standalone player too? :)
That's a cool demo too Chris, I like that guy you've drawn.
Thanks. That isn't even the good one. I drew the Death Scythe which is the one I have in my avatar. He has a reaper scythe and looks really cool.
sonneveld It's in the works.  I'm working on a midi converter that will hopefully work properly at the moment.

- Nick
AGI1122 Is the new midi convertor going to be a little easier to use? Also will it support the noise channel?
sonneveld I'm still figuring out how the midi format works.  But I'll probably tie the noise channel to the percussion if anything.  I'm planning to support most midi files though..  At least if something doesn't work, you'll have somebody to whine to, to get it working :)

- Nick

so if freq_count = 1.. the frequency is 111860Hz
if the freq_count = 111860.. the frequency is 1Hz

Bah.. I made a mistake.  AGI only allows a 10bit number to define the frequency count.. so the range is 0-1023.  This means you can define frequencies to 111860Hz to 109Hz.  This is also the reason why some midi's can't be converted (because they can define notes lower than this).   The converter i'm working on will try and be smart about this (and not just give up)

- Nick
AGI1122 That should be pretty good. Except it was usually the rol2snd editor that gave me problems. It always complained about the notes being too high/low. Maybe there should be some sort of conversion so that if the note is too high or low it will autimatically make it go to a normal note that is not too high or low.
sonneveld That would make the song sound kinda funny, with off notes.
AGI1122 Yeah but if it didn't do it the problem of it not allowing too high or too low a note would probably still be a major problem.
sonneveld Well, the way I see it you could:

- shift the song by a couple of octaves
- quit with an error
- replace those notes with silence along with warnings.

If you're shifting octaves, and the song still doesn't fit, maybe you should be able to define whether to keep the bottom or the top of the note spectrum.  The song might play high notes to begin with, so you could just play that and skip the rest.

if a song has notes in the high and low range, it may just be impossible to convert. dunno what you really want to do.

- Nick
AGI1122 I just hate the fact that the current midi converter will give up if it is a too high or too low of a sound. I would like it to either change it so that it is no longer too high or too low or to just skip that note and go to the next. This way more midi's could be used in AGI instead of just about 1/20 of the midi's the user tries. I would prefer the converter trying to fix it rather than just giving up because of one wrong note. This would help people that try to use midi's of songs they find on the net also because more midi's would be able to be used in AGI for music. I don't know if it is possible but I would shure like for it to do this.