[bb] Sounding the PC Speaker by _33 [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:42

Previous topic - Next topic

BlitzBot

Title : Sounding the PC Speaker
Author : _33
Posted : 1+ years ago

Description : Try this program for making some sounds with accurate notes to the PC speaker.

Got some help from this site for the Note2Frequency# function: <a href="http://www.sengpielaudio.com/calculator-notenames.htm" target="_blank">http://www.sengpielaudio.com/calculator-notenames.htm</a>

You will also need to have this DECLS installed in your Blitz directory (kernel32.decls): <a href="codearcs2550-2.html?code=1180" target="_blank">http://www.blitzbasic.com/codearcs/codearcs.php?code=1180</a>


Code :
Code (blitzbasic) Select
api_Beep(Note2Frequency(59),100)
api_Beep(Note2Frequency(67),100)
api_Beep(Note2Frequency(71),100)
api_Beep(Note2Frequency(66),100)
api_Beep(Note2Frequency(61),100)
api_Beep(Note2Frequency(68),100)
api_Beep(Note2Frequency(73),100)
api_Beep(Note2Frequency(68),100)
api_Beep(Note2Frequency(63),100)
api_Beep(Note2Frequency(70),100)
api_Beep(Note2Frequency(75),100)
api_Beep(Note2Frequency(63),500)
End

Function Note2Frequency#(note#)
   Return (440.0 * 2.0^((note - 69.0) / 12.0))
End Function


Comments :


Heliotrope(Posted 1+ years ago)

 What does api_Beep() do?