Jump to content
  • Advertisement

Archived

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

The_[PI]_ehT

Frequency calculation - howto?

This topic is 6539 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

I''m really stuck within this subject, so I need help! Does anyone know how to calculate sample data to a certain frequency (=note, i.e. A-4), speed, volume, or such? The thing is I want to use a sample as an instrument, so I have to find out how to play a sample in G-5 in A#-3 and such things, and of course how to mix several samples together. I did not find anything helpful on the whole net! A small link would be enough for the first! please help! pi~

Share this post


Link to post
Share on other sites
Advertisement

Look for information about mod/s3m/etc. trackers and players. hornet.org had a lot of good stuff before it was shut down, dunno if its still up(I mirrored and have it all CD .


The basic idea is this: You say that playing the sample at 11kHz produces C-3. Well, since the frequency and sampling rate are very coupled, you just adjust the playback rate(speed it up or slow it down). Well there are twelve notes in an octave, and a octave difference is twice the frequency. Treat sampling rate as the "frequency", note this makes C-4 22kHz. The way to figure any note involves a geometric series that doubles every 12 steps. You end up with the twelfth root of 2 as a constant, I think its like basefreq * (const ^ (note number)). Thats not exactly right, but thats the idea.

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!