#135262 - phlip - Sat Jul 21, 2007 4:05 pm
I'm trying to write an electric tuner for the DS, but I'm having trouble with the timing. Namely, the timers in the DS aren't that accurate - they're well within the range you'd expect from a video game system, but to be accurate to, say, the nearest cent, the timers need to be accurate to ?1/20%... way more than the DS is designed for.
I'd like to think that, with enough calibration, this problem can be gotten around... but it depends on how consistent a DS's timer is, in the same DS... I know from a quick experiment in IRC that WinterMute's DS's timer runs about 2% slower than mine (it reports the sound as about 40 cents higher)... but on the few tests I've run on my own DS, it rarely disagrees with itself more than about a cent. If it's always about the same on a single DS, then running some sort of calibration the first time you run it should be enough.
This is where you need your help:
Download the tuner.
Put the .nds file on your DS and run it.
Put your DS next to your computer speakers, and play the two .wav files in the zip.
Post your results here. Specifically, the reading in the top-right of the lower screen.
Run the tests a few times, and see if you get consistent results... if possible, test it in the middle of the day, and at night... temperature might affect it, depending on how the timers work in the hardware.
If all (or even most) DSs get similar numbers every time, even if they don't agree with each other, then the project can probably go ahead... otherwise, I'll probably have to scrap it, which'll be sad.
So yeah, the more data I have, the better, so if as many people as possible do this for me, it'll be great. I don't think I'm asking much, just run a program, and play a couple of sounds... should take 1 or 2 minutes, at most, at a couple of times during the day.
Oh, and one last thing: The program, as written, isn't particularly good for tuning actual instruments yet, even without the calibration problems... it's good for sine waves, and not much else. That'll get fixed before release... it's just got something in there right now that's simple and works.
_________________
<link rel="signature" type="text/hilarious" href="/funnysig.txt" />
Last edited by phlip on Sun Jul 22, 2007 12:36 am; edited 1 time in total
#135276 - tepples - Sat Jul 21, 2007 6:34 pm
With this testing procedure, how do you plan to correct for an inaccurate sampling rate in PC audio equipment?
A useful real-time clock is accurate to within plus or minus one second per day, or plus or minus 11 parts per million, or plus or minus 0.02 cents of pitch. So might measuring the CPU timer against the RTC produce a good indication of your DS's actual clock rate?
As for generating actual tones to test against, have you considered the Karplus-Strong algorithm, one of the early forms of waveguide synthesis?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#135278 - voteforpedro36 - Sat Jul 21, 2007 6:41 pm
The page cannot be found.
Sounds so stupid after tepple's [technical] reply though...
#135301 - phlip - Sun Jul 22, 2007 12:44 am
tepples wrote: |
With this testing procedure, how do you plan to correct for an inaccurate sampling rate in PC audio equipment? |
I'm pretty sure that a real computer, with a real oscillator, will do a lot better than an embedded system... My professional tuner reports my computer as being dead on.
tepples wrote: |
A useful real-time clock is accurate to within plus or minus one second per day, or plus or minus 11 parts per million, or plus or minus 0.02 cents of pitch. So might measuring the CPU timer against the RTC produce a good indication of your DS's actual clock rate? |
That's... actually a very good idea. I'll look into that.
tepples wrote: |
As for generating actual tones to test against, have you considered the Karplus-Strong algorithm, one of the early forms of waveguide synthesis? |
I don't see how that'd be useful, absent a reliable way to measure the length of the delay... and if there is a reliable way to measure the length of the delay, then it'd be overkill.
If you mean for the next bit, when I have to make it work with real instruments... I own a guitar, and I'll take the real thing over a synthesized waveform any day.
voteforpedro36 wrote: |
The page cannot be found. |
My bad. The link is fixed now.
_________________
<link rel="signature" type="text/hilarious" href="/funnysig.txt" />
#135304 - Agilo - Sun Jul 22, 2007 1:01 am
Tested it real quickly, the application starts but isn't picking up on anything (I don't think it crashed though, because I think I can hear feedback coming from the speakers).
On a side-note: I've often considered attempting to write a tuning device, I made plans to implement all sorts of handy functions into it but I just never got around to getting the project off the ground.
Shame on my part but I'm happy to see someone else giving it a try. :)
#135440 - felix123 - Mon Jul 23, 2007 11:49 am
Tested on silver DS originally firmware v3.
Night test: For both notes, the result fluctuate between zero and plus one. For C, it spends roughly equal time in zero and one. For A, it is mostly zero.
I'll test again tomorrow morning.
Keep up the good work.
_________________
Nintendo DS homebrew on Wikipedia
#135491 - Dood77 - Mon Jul 23, 2007 10:56 pm
I downloaded and tried, but I fear my PC's fans are annoyingly interrupting the DS's mic. (They make the B on my piano sound terrible!)
Maybe I should try a CD player with a burned CD?
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.
Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC
#135508 - Lynx - Tue Jul 24, 2007 1:36 am
I tested my computer against a Korg GT-3 guitar tuner and the A was spot on, but the C was jumping all over the place. And, I received the same results from the NDS application. A seemed to tune right in, but C was jumping all over the place.
_________________
NDS Homebrew Roms & Reviews
#135522 - happyface - Tue Jul 24, 2007 4:56 am
Both my A and C flickered very quickly between +00 and +01
My DS is 33-35?C (as shown in Daignose)
#135530 - DekuTree64 - Tue Jul 24, 2007 6:53 am
Both are spot on for me (original silver DS, 25?C). I also tried tuning my guitar with it, and it sounds good. It seems to have trouble finding the lower notes though, so you might want to try sampling over a longer period.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#135538 - Noda - Tue Jul 24, 2007 9:33 am
Hmm I don't get the point, why are you speaking about internal timer frequency being related to the detection of the pitch of a sound???
Unless you're using some tricky methods to detect it, I don't get it...
I explain:
The clock you're talking about can't be related to the one affecting the sampling frequency as sampling frequency innacuracy should have no effects (other than misrepresenting high frequencies) on the pitch of the sound.
If you're measuring this clock frequency (which may slightly vary from one DS to another) and using it as a parameter when doing your FFT transform on the samples, then you're done.
Maybe I'm missing something here, as I never been bothered using the DS mic...
#135987 - ghaxaq - Sat Jul 28, 2007 7:51 am
I tried the application and it did not work on my SC CF(white screens). Any Help? Thanks
_________________
ghaxaq.wordpress.com
#136028 - JAKETHESNAKE - Sat Jul 28, 2007 5:01 pm
same with my scsd. i havent used that one sconv and that might be it.
#136119 - phlip - Sun Jul 29, 2007 12:35 pm
Noda wrote: |
Hmm I don't get the point, why are you speaking about internal timer frequency being related to the detection of the pitch of a sound??? |
All it can tell directly is the period of the wave, measured in samples. Without knowing the sample rate, it's impossible to convert that period into seconds, and thus calculate the frequency in Hz.
Say the wave was measured to have a period of 50 samples. If it turns out to have been measured at a sample rate of 22kHz, then the recorded note is an A. If it's been measured at about 26.2kHz, then the recorded note is a C. If the sample rate is unreliable, then so is the measured frequency.
However, it seems that everyone that's gotten actual results has gotten the same thing (around 0 to +1c, the same as I get). The other results seem to be instability in the code and sensitivity to noise... both of which I'm working on fixing, and aren't a hardware issue... so it seems the timer is accurate enough for my purposes, and fancy calibration stuff isn't going to be necessary. WinterMute's +40c is still disconcerting... but I'm willing to consider it experimental error for now, unless anyone else is getting odd results.
Thanks for your help, guys!
Oh, and supercard guys: I don't really know anything about how that stuff works, but I've uploaded a .ds.gba version here... maybe you'll have better luck with that.
_________________
<link rel="signature" type="text/hilarious" href="/funnysig.txt" />