Jump to content
  • Advertisement

Archived

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

Pipo DeClown

Playing a Note

This topic is 5486 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!