• Lucid Dreaming - Dream Views




    Results 1 to 4 of 4
    1. #1
      Member Feeble Wizard's Avatar
      Join Date
      Mar 2005
      Location
      -0.1002 + 0.8383i Double Sceptor Valley
      Posts
      100
      Likes
      0
      I am not very good with computers in general but I like to program. I have currently been trying to make a program that makes sound but I do not know how to do it. I have tried to look this up on the internet but have had surprising difficulty.

      What I need to do seems very simple to me. I just want to be able to make a sine wave pitch of any frequency (like 4500Hz, 202Hz , etc.). I want to be able to play two or more of these at once. It would also be nice to be able to adjust the volume of each tone as well (and maybe even the phase, if that isn’t asking too much&#33. I think that there would also be a way to set the duration, but if not, I think I could figure out sometime involving the computer clock...

      I want to do this in C++. If I really had to, I could use Visual Python or any language featured in Microsoft Visual Studio, but then I would have to learn a whole new language.

      Does anyone have any ideas? Thank you very much!

    2. #2
      Your cat ate my baby Pyrofan1's Avatar
      Join Date
      Nov 2006
      Gender
      Posts
      720
      Likes
      3
      dos.h has a sound function called sound the prototype is
      Code:
      void sound(unsigned frequency);

    3. #3
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      For a nice cross-platform solution, try using midi

      This is a Midi library (as used in old dos games)
      http://www.jdkoftinoff.com/main/Free_Proje...++_MIDI_Library

      include it in your project and feed any midi info to it
      (either from an external midi file, or direct from code)
      (\_ _/)
      (='.'=)
      (")_(")

    4. #4
      Member Feeble Wizard's Avatar
      Join Date
      Mar 2005
      Location
      -0.1002 + 0.8383i Double Sceptor Valley
      Posts
      100
      Likes
      0
      Thanks, I'll try out those ideas tomorrow when I have access to my computer that I can program on!

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •