0
0

This is a final update

Once again, I am trying to come up with a way to ‘esitmate’ or compute the length of time (in seconds or milliseconds) an intrument plays a given note assuming the sampled instrument doesn’t loop. If it does loop, we know the length of time is determined on wether or not another note is played, or if its volume goes to 0.

After some research and the informative responses on this forum, I have found that the following useful formulas hold true:

SAMPLES_PER_SECOND = SAMPLES_PER_TICK * (BPM2 / 5)
SAMPLES_PER_ROW = SAMPLES_PER_TICK * TICKS_PER_ROW
MS_PER_ROW = [ 1 / ( BPM
2 / 5) ] * TICKS_PER_ROW * 100

So finding the length of time that an instrument plays middleC is pretty trivial, since it tells you in the instrument struct in SAMPLES, you can compute this time by:

SAMPLES_FOR_MIDDLEC * SAMPLES_PER_SECOND = Seconds for middleC

However, I am unclear as to how the note value changes the instrument’s frequency or its number of SAMPLES.

If a sampled instrument’s length is 4000 SAMPLES (4kHz), and its middleC is 8000(8kHz) SAMPLES, and it is playing note ’48’ (Using the FMOD scale),

I am not sure the relationship to compute the resulting frequency, unless FMOD computes this already and this is the value that pSample->Length gives.

I think it would look something like this:
Time = SampleLength / ( MiddleC SampleLength * (NoteOfSample-1 / 60 ))

but this seems wrong to me……

• You must to post comments
0
0

Back in the old days of Soundtracker and Protracker, it merely played the same sample at a different frequency. So C-2, C#2, E-3 and D#3 would all have the same number of samples in the sound, but the sound was played at specific frequencies for each note.

• You must to post comments
Showing 1 result
Your Answer

Please first to submit.