General Category > General Anim8or Forum
WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
nemyax:
--- Quote from: cooldude234 on July 19, 2015, 05:12:38 am ---Added some more features to the scripts, and currently trying to figure out how to implement blocks and scope blocks into them.
--- End quote ---
What kind of scripting language is this? And why do you have to parse it continuously instead of once?
cooldude234:
It's the scripting language I am making from the ground up based on c style syntax that utilizes the engine
(currently it doesn't have a name so I just refer it to as scripts).
This is the way I am making it so people can develop things with the engine without having the complexity of a compiler.
The reason why I need to continuously read from these is because the main loop will be handled through these; as well as other loops that a person could add if they so desired (eg A for loop).
Basically the engine has a parser which just reads the scripts top down, and certain control structures can influence and tell the parser how to read from these scripts like for example loops and if statements.
Also you can have multiple scripts and call the engine through one script to read from another.
So if you load another script through the main script....
--- Code: ---New Script testscript = load_script(filelocation);
--- End code ---
Then call it to run....
--- Code: ---runs_script(testscript);
--- End code ---
The parser will read from testscript top down until it reaches the end of said script.
From there it will continue reading from the previous script at the next line.
Please note that the syntax of these functions aren't 100% official yet, even after the initial public release it may change (a lot of things will when I get feedback, but they will change for the better (I hope ;p )).
P.S. Are you familiar with programming at all?
nemyax:
I see, thanks. Have you considered embedding something like Lua and decided against it?
--- Quote from: cooldude234 on July 21, 2015, 06:06:15 am ---Are you familiar with programming at all?
--- End quote ---
I've done some Python for Blender and Erlang for Wings.
cooldude234:
I have considered using lua and even pearl but I wanted more control over the implementation on these as well as the syntax. Also by making my own scripting language and I make the C++ coding structure much similar to the rest of the engine, which in the long run is a much nicer thing.
And wow I haven't heard of anyone using Erlang for a long while :P
cooldude234:
Been focusing heavily on the sound part of the engine the past week and I finally got a high quality sample rate conversion working on the fly.
I'm having it set up by default to re-sample any sounds loaded into the engine to be the same with what the system is playing back audio on.
Because if you run audio that was recorded at 96000 samples per second and you try playing it back at the more standard 44100 it will sound very deep and low tone; and when you do the opposite, playing audio from a low sample rate (like 22050) to a higher sample rate it would sound high pitched and be played back very fast (like the chipmunks).
So this is where re-sampling comes in handy. If you are running your audio device at a higher or lower sample-rate the engine would re-sample the audio to match the correct sample-rate to make sure things sound correct. This pretty much involves going through every single audio sample there is and finding where the new sample would lie (time wise) one the original and interpolating between the original samples to get the new one. Right now I just have a linear interpolation implemented for this job but I will hopefully add support for other forms of interpolation (for even more high quality).
I posted a screenshot with some debug info on it to help illustrate how efficient this is for on the fly conversion.
Heldon's song, Perspective II is about a 3 min song but has 48000 samples per-second with a total of 9387520 samples.
Converting all that to 44100 to about 0.639272 seconds. Considering this really only needs to happen once per audio file and there wouldn't be that many long audio files being loaded up at once I am extremely happy with the result; and if you look at the result for chime3, a much smaller audio file (about 10 seconds long at 96000 samples a second), you can see how feasible this would be for many small files.
Right now I have it setup like this, Sound = LoadSound (filename); PlaySound (Sound); And the engine takes care of the rest.
In the end I'm going to aim for having the user just load a sound and play it and it would work by default and then giving them the option to do all this manually for more advanced uses.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version