¡Sufre, Beethoven!
Cachivache
31

Un pedacito de codigo de ejemplo!

<code>procedure play(speed,octave,note,duration: integer);
var
 frequency : real;
 I : integer;
begin
 if note = 0 then delay(speed*duration)
 else begin
 frequency := 32.625;
 for I := 1 to octave do frequency := frequency * 2;
 for I := 1 to note — 1 do frequency := frequency * 1.059463094;
 if duration <> 0 then begin
 if soundon then Sound(Round(frequency)); 
 sleep(speed*duration); // was “delay” in Turboo Pascal
 NoSound; 
 end
 else if soundon then Sound(Round(frequency)); 
 end;
end;</code>

Show your support

Clapping shows how much you appreciated Alejandro Perez Malagon’s story.