Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Make a program

  1. Jun 28, 2009 #1
    I have a class in computer basics, for accountants (my major)
    I am also learning C and thinking if I can make a program that outputs a single sound of 'do'
    (do in 'do re mi fa sol la si etc')

    I also would like you to tell me how to change the 'vocality' in that increasing order so I can output all of them not justa single sound of do

    Thank you :smile:
     
  2. jcsd
  3. Jun 28, 2009 #2
    yes you can,
    there is a function called 'Beep(frequency)' if i have not forgotten,
    the frequency is the one you need to figure out which is your standard 'do' and starts off you can find other harmony keys that come after.
     
  4. Jun 29, 2009 #3

    MATLABdude

    User Avatar
    Science Advisor

    'Do' is usually C (and probably C4, or middle C). There's a frequency correspondence for the middle notes at the Wikipedia article on musical notes (along with the southern and eastern european names for the notes, i.e. Do-Re-Mi-Fa-So-La-Ti-Do):
    http://en.wikipedia.org/wiki/Music_notes

    I think the beep(frequency_in_Hz, duration_in_ms) may only work with C++ on a windows platform, using the windows.h library. However, I used it once to do the theme from 2001: A Space Odyssey (after working out the harmony on our piano). Here's more:
    http://www.daniweb.com/forums/thread15252.html#
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook