Great script!
There are quite a few ways to make this better and easier for the scripter and user.
If you don't extract the files in the folder you specified, then it gets all messed up. Instead of using that const "RootFolder". You can use ScriptPath instead. Which will get the path of the script. That way the user can put the script anywhere.
Also, sometimes the sound isn't played all the way because of the loop. So before you exit the if statement, it should wait until the user isn't holding that button anymore. Example:
procedure PlayMySound(Note, Cha : string);
var
Ch : char;
begin
Ch := Cha[1];
if(IsKeyDown(Ch))then
begin
PlaySound(Note);
while IsKeyDown(Ch) do
Wait(20);
end;
end;
procedure Play;
var
i : integer;
begin
for i := 0 to 5 do
PlayMySound(ScriptPath + Note[i], IntToStr(i + 1));
end;
Note: In the above example, I put ScriptPath right before the Note
because in the procedure SetNotes, I disposed of the const (RootFolder) before all the '\1st.wave'.
Also that repeat/until loop at the bottom should have a wait. A wait of at least… 30 or 40. Otherwise it takes up 99% of CPU Usage and slows down everything.
Hope that helps! :)
~Ron