The page I referenced on Wikipedia also agrees: http://en.wikipedia.org/wiki/Piano_key_frequencies
C4 = 261.626Hz (slight difference in decimal places, rounding, blah blah blah)
A pretty badly out of tune C, but yes, more or less within the acceptable range. Regarding the 168 sample length, as you’ve just clearly demonstrated: 44100 / 261.63Hz = 168.55865153078776
But it’s not possible to have a sample with a fractional length, so that value must be rounded up or down to the nearest whole integer. It appears Renoise is simply rounding down to 168, but for what it’s worth, rounding up to 169 would be no better (I tried).
Maybe there wasn’t really a big decision process behind it, and taktik just quickly added the feature with a default value that seemed quite sensible, and he simply thought of middle C as a good choice. Personally, I would have made it A440, as I feel it’s just a better system to base things on. I end up changing the sample length every time I use this feature anyway, to match whatever music I’m making at the time, so in its current form its not really affecting me badly.
If you want a pretty damn good match that should work for most situations, you can take my 441Hz 100-sample sine from above, set the base note to A-3, then finetune it to -7. That’s about as good as you’ll get with the basic fine tune controls, without messing around endlessly with a variety of different lengths, seeing if you can just get it (which I did… and failed).
If you want to perfectly match the middle C 261.626Hz… then it requires a bit of work. To test things out, I generated a 60 seconds 261.626Hz 44.1Khz tone in SoundForge and brought it into Renoise. Then I took my 441Hz 44.1Khz 100-sample sine from earlier and tried to match them. I played both tones together, but inverted the phase of one of them, so that they would hopefully cancel each other out and result in silence — a good sign that they’re perfectly in tune.
Well, even the most ridiculously tiny difference caused my sine to quickly drift out of phase and become useless. I did finally get them to sync up, but it was a pain in the ass, and it required a looooot of trial and error, haha.
Here’s the .XRNS I came up with:
http://illformed.org/dump/music/dblue_middle_c_tuning.zip
You’ll notice that my sine has a pretty weird looping pitch envelope on it. I couldn’t quite manage to make it sit perfectly still by using only one value… instead, it seemed like I had to make a loop there, to swing the pitch back and forth by a tiny amount in each direction, and that somehow stablises it.
Resampling is weird stuff.
The first pattern is just some quick goofy stuff to prove that each instrument is doing what it’s meant to.
The second pattern is the phase cancellation test. If all goes well, it should remain totally silent. There IS noise being generated, but it’s pretty much inaudible, so I’ve also placed a Distortion2 on the Master track. If you toggle that on and off, it will make the noise audible (in a quiet and sensible way). I have to assume this noise is interpolation artifacts, rounding errors, weird random leftovers from functions within functions, etc?
The third pattern demonstrates what happens when one of the instruments is off in its tuning by just a few cents.
Overall, I’ll take an educated guess and say that what I’ve made here probably isn’t totally perfect and in sync, as there was definitely a lot of random trial and error in getting it to work. It may just be drifting/phasing at an incredibly slow and unnoticeable rate, but could appear after listening to it for several minutes, I’m not sure. (And too tired to test that theory right now)
So anyway… that’s my weird little night of Renoise experimentation. I hope this demo has showed… something?… to anyone who is looking… I really love exploring these weird, subtle things in the world of audio
Closing thoughts…
- 261.626Hz is a strange, strange frequency.
- Computers do not like fractions! No sir, they don’t!
- Something very weird happens late at night, when you’re sitting in the dark, painstakingly tuning sinewaves down to three decimal places, while the sound of aliasing and interpolation errors fizzles gently in the background… I felt more in tune, like Renoise was trying to communicate with me somehow.
- Computers love integers! Whole numbers make computer happy. Happy computer means happy Renoise!
.
Final sanity check
- Be smart.
- Use A=440Hz as your base note, then let the software figure out the rest.
- It’s a standard for a very good reason!