October 29, 2020, 02:36:33 AM

Author Topic: [bb] Sounding the PC Speaker by _33 [ 1+ years ago ]  (Read 1286 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Sounding the PC Speaker by _33 [ 1+ years ago ]
« on: June 29, 2017, 12:28:42 AM »
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[/url]

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[/url]


Code :
Code: BlitzBasic
  1. api_Beep(Note2Frequency(59),100)
  2. api_Beep(Note2Frequency(67),100)
  3. api_Beep(Note2Frequency(71),100)
  4. api_Beep(Note2Frequency(66),100)
  5. api_Beep(Note2Frequency(61),100)
  6. api_Beep(Note2Frequency(68),100)
  7. api_Beep(Note2Frequency(73),100)
  8. api_Beep(Note2Frequency(68),100)
  9. api_Beep(Note2Frequency(63),100)
  10. api_Beep(Note2Frequency(70),100)
  11. api_Beep(Note2Frequency(75),100)
  12. api_Beep(Note2Frequency(63),500)
  13. End
  14.  
  15. Function Note2Frequency#(note#)
  16.    Return (440.0 * 2.0^((note - 69.0) / 12.0))
  17. End Function


Comments :


Heliotrope(Posted 1+ years ago)

 What does api_Beep() do?


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal