Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

Playing a Note

This topic is 5576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Depends on how you want to play it.

If you''re going to play a single note, it might be easiest to generate it procedurally (procedural sound! yay!)

A simple sound is just a sine wave. All you have to do is adjust the frequence and amplitude of it, and you''ve got your sound. Most sound APIs have a feature by which you provide a callback function that it calls each frame, and that function works out the numerical value of the sample.

Something along the lines of

thisSample = amplitude * sin( timeSinceSoundStart * frequency)

would generate a fairly simple sine wave, I think.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!