Skip to content
Snippets Groups Projects
Commit efb67064 authored by rswindell's avatar rswindell
Browse files

Truncate fractional part of duration when creating .ton file.

parent 810cbaf9
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ while(!file.eof && !js.terminated) {
if(delta) {
sleep(delta*ticks_per_msec());
if(tonefile)
tonefile.writeln("r " + delta*ticks_per_msec());
tonefile.writeln("r " + Math.floor(delta*ticks_per_msec()));
}
note_on=note;
break;
......@@ -239,7 +239,7 @@ while(!file.eof && !js.terminated) {
writeln("\t\tPlaying " + Math.floor(freq) + " for " + delta);
beep(freq,delta*ticks_per_msec());
if(tonefile)
tonefile.writeln(Math.floor(freq) +" "+ delta*ticks_per_msec());
tonefile.writeln(Math.floor(freq) +" "+ Math.floor(delta*ticks_per_msec()));
}
note_on=0;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment