#151238 - 28/03/2003 12:17
Emtune?
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
My neighbour is moving, and gave me a guitar. Unfortunately, it's not in tune, and I don't know how to tune it off the top of my head. (I know how to tune it, I just don't have any sort of reference to get it right.) Then I got to thinking...
The empeg has a mic input. Theoretically, then, we could write an app that uses the mic, and acts as a tuner. Since this is totally outside the scope of my understanding, I'm curious to know what a project like this might entail?
|
Top
|
|
|
|
#151239 - 28/03/2003 12:27
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Music is relativistic anyway. Get your E string about right by ear and just tune the rest of it so that it's internally consistent.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151240 - 28/03/2003 12:30
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Or, just pick up a $20.00 electronic tuner at any music store...
I happen to have just gotten a matrix tuner that I'm really happy with.
By the way, for relative tuning, the opening note of "Tom Sawyer" on Moving Pictures is a low E.
|
Top
|
|
|
|
#151241 - 28/03/2003 14:57
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 14/01/2002
Posts: 2858
Loc: Atlanta, GA
|
[Friday afternoon smart aleck mode]
Oooh, perhaps we could talk to the guys at Line6 and get some of their amp emulation code and make our Empegs into PODs! Then maybe some MIDI controls for hooking in keyboards . . .
[/Friday afternoon smart aleck mode]
_________________________
-Jeff Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.
|
Top
|
|
|
|
#151242 - 28/03/2003 15:04
Re: Emtune?
[Re: JeffS]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Oh, that reminds me. The empeg's inputs are probably not ``tuned'' to accept a line directly from a guitar's output. The guitar would be way quiet, as the only electricity actually being generated is very minimal. I think that alone would probably make the empeg unable to properly determine the note being played. And I'd imagine that getting something that would provide enough power to make it work would cost as much as just getting a tuner. (Hell, for $20, getting an adapter for a 1/4" phone jack to an RCA jack would get you close.)
But I could be wrong.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151243 - 28/03/2003 16:40
Re: Emtune?
[Re: wfaulk]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Not to mention the basic issue of... needing to plug in and hook up the empeg for something as simple as tuning a guitar is going rather overboard. It'd be like heating up the big oven just to make a cup of instant coffee. I mean, it'd work, but isn't a microwave oven faster and easier?
And by the way, I forgot to ask if the guitar was acoustic or electric. That tuner I recommended is pretty much only useful for an acoustic guitar. There are even cheaper ones that will work for electric guitars.
|
Top
|
|
|
|
#151244 - 28/03/2003 16:41
Re: Emtune?
[Re: tfabris]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Or buy a tuning fork. They don't need batteries.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151245 - 28/03/2003 16:53
Re: Emtune?
[Re: wfaulk]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
True, but tuning forks are harder to tune against than an electronic tuner. You get better, faster results with an electronic tuner, especially for a newbie.
Having hung around a lot of music stores in my time, I've watched many parents come in to buy their kid his first guitar. They figure it's like a pocket calculator: If you use a calculator all the time, your math skills will slack off. They think it's better for the kid to start out using a tuning fork or pitch pipe and then learn how to tune the instrument relative to itself. They think that an electronic tuner is somehow "cheating" and preventing the kid from having a proper ear for tuning.
Nothing could be farther from the truth, actually.
One thing that a newbie should learn as early as possible is how to hear what a properly-tuned instrument sounds like in his hands. The closer to pitch-perfect the guitar is, the better ear he'll develop and the more easily he'll be able to learn musical theory and harmony. And the more likely he'll be to recognize an out-of-tune instrument when he hears one. The skill to relative-tune his instrument can come later-- buy the kid the electronic tuner *now*.
Especially considering that the intonation on many "cheap" beginner guitars is so bad that relative-tuning becomes an exercise in frustration and compromise...
|
Top
|
|
|
|
#151246 - 28/03/2003 17:55
Re: Emtune?
[Re: tfabris]
|
journeyman
Registered: 19/06/2002
Posts: 72
Loc: West Berkshire
|
"It'd be like heating up the big oven just to make a cup of instant coffee. I mean, it'd work, but isn't a microwave oven faster and easier?"
You guys really use a microwave to make instant coffee ?? I remember never seeing kettles over there, but I'd never thought through the implications. Wow. What did you do before microwave ovens ?
Steve.
_________________________
Mk2a 10+40Gb Darkstorm Neon Red
Nakamichi CD45z, Genesis Five Channel, Genesis A16s, JL 8W6 x3
|
Top
|
|
|
|
#151247 - 28/03/2003 18:04
Re: Emtune?
[Re: sundayjumper]
|
carpal tunnel
Registered: 05/01/2001
Posts: 4903
Loc: Detroit, MI USA
|
Before microwave ovens? What is he talking about?
_________________________
Brad B.
|
Top
|
|
|
|
#151248 - 28/03/2003 18:13
Re: Emtune?
[Re: SE_Sport_Driver]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Before microwave ovens? What is he talking about? And I suppose he's going to tell us Paul McCartney used to be in some band, too.
|
Top
|
|
|
|
#151249 - 28/03/2003 18:31
Re: Emtune?
[Re: tfabris]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
He did. It was called ``Wings''.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151250 - 28/03/2003 18:38
Re: Emtune?
[Re: tfabris]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
You get better, faster results with an electronic tuner, especially for a newbie. You know, I never found that to be the case. When I had a tuner, I'd try to get all of the strings in tune according to it, and it took me a long time. I ended up using it to make sure that E was in tune, and then just do the rest by ear, fine tuning playing chords and making minor adjustments. (D, D flat, Dsus2, and Dsus4 always worked well for me in this case for some reason.) But, then, I think I may have the rudiments of perfect pitch, so maybe tuners are easier and better for some.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151251 - 28/03/2003 21:32
Re: Emtune?
[Re: JeffS]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
Uhh.... I don't actually have any clue what you're going on about, so I'll just assume this is just some sort of self-aggrandizement snobbery done in an effort to cover up the fact that you really don't know jack-shit about what I asked. Post racer.
|
Top
|
|
|
|
#151252 - 28/03/2003 21:39
Re: Emtune?
[Re: tfabris]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
Not to mention the basic issue of... needing to plug in and hook up the empeg for something as simple as tuning a guitar is going rather overboard. Yes, it is. But then, my empeg is always plugged in and hooked up anyway -- it hasn't even been installed in my car yet, and I've had it for over a year, now. It'd be like heating up the big oven just to make a cup of instant coffee. I have no issues with doing that. I don't own a microwave. The microweave may be faster and easier, but sometimes doing things the slow difficult way brings more satisfaction.
|
Top
|
|
|
|
#151254 - 28/03/2003 21:49
Re: Emtune?
[Re: wfaulk]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
Well, with the exception of this reply (thanks, Bitt), none of the others bothered to even attempt to answer my question, which is what such a project would entail. I didn't ask if it's a good idea or a bad idea -- I'm quite aware it's rather frivolous -- or ask anyone to write it for me (I guess the "we" should have been an "I"), I'm just curious what sort of things I would need to know if I were to actually try doing something like this. Heaven forbid someone want to do something purely out of intellectual curiosity. The empeg's inputs are probably not ``tuned'' to accept a line directly from a guitar's output. I never thought of that. Is a guitar output in the same category as the empeg line-level rca out? Wouldn't matter in my case, though, since I have an acoustic, so it'd have to be a regular mike. Now... does anyone else have a useful answer?
|
Top
|
|
|
|
#151255 - 28/03/2003 22:10
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Is a guitar output in the same category as the empeg line-level rca out? I'm not really sure what the specifics are. All I can tell you is what I know from experience in a similar situation. (This is electric guitar specific, so I guess it's more general interest than actually answering your question.)
One time, my amp died, but I wanted to practice with some volume. So I tried plugging it into my stereo via an appropriate cable. I found that if I plugged it into the CD inputs on the stereo, I barely got any volume. If I plugged it into the turntable inputs, I got reasonable volume, but it clipped a good amount. I don't know what this means in actual electrical terms, but neither one was ``proper'', whatever that means. I have an acoustic, so it'd have to be a regular mike This would probably be a little easier. You can probably find some code online that will determine pitch based on audio input. My first thought is that the sampling limitation of the mike input might be an issue, but the high E is only going to be about 300Hz, so that's probably not a big deal.
Also note that you can get a pickup for an acoustic guitar, if you're so inclined. (Note that not all of the pickups in that link are for acoustics, but many are.)
_________________________
Bitt Faulk
|
Top
|
|
|
|
#151256 - 28/03/2003 23:09
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Now... does anyone else have a useful answer?
No, but I have a riddle:
Q: How many empeg enthusiasts does it take to develop a new userland application?
A: Twenty-two. One to come up with the idea, twenty to criticize, nay-say, and generally crap all over the idea, and one to accept the challenge and go do it.
|
Top
|
|
|
|
#151258 - 29/03/2003 00:49
Re: Emtune?
[Re: wfaulk]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
Is a guitar output in the same category as the empeg line-level rca out? I'm not really sure what the specifics are. All I can tell you is what I know from experience in a similar situation.
Hmm... from another thread, it looks as though it's situation dependent -- car audio line level is 4V, in-home line level is somewhere around 1V. Musical instruments may be another category.
You can probably find some code online that will determine pitch based on audio input.
Aha! That's the word I was stuck on... pitch. All I could think was frequency, but I knew there was a music word for it.
I managed to find a java app while searching around for reference wav files.
My first thought is that the sampling limitation of the mike input might be an issue, but the high E is only going to be about 300Hz, so that's probably not a big deal.
So if the mike input can't sample fast enough, then my sampled input wouldn't be a true representation of the note I was playing... yuck. I'd have to do some sort of anti-aliasing signal reconstruction, then. Bleh... I didn't do so hot in that class in uni.
Also note that you can get a pickup for an acoustic guitar, if you're so inclined.
I think I'll wait and find out if I like my new neighbours before I accost them with my neophyte guitar practice at an amplified level.
Thanks,
A
Edit: PS... the guitar is now in tune.
|
Top
|
|
|
|
#151259 - 29/03/2003 07:35
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 14/01/2002
Posts: 2858
Loc: Atlanta, GA
|
Sorry, I didn't mean to come off like that. The thought of using the Empeg as a "catch all" music device seemed funny to me (especially since I always have my empeg whenever I play), though clearly the humer didn't come out right. Please accept my apologies.
_________________________
-Jeff Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.
|
Top
|
|
|
|
#151260 - 29/03/2003 09:55
Re: Emtune?
[Re: canuckInOR]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
I don't actually have any clue what you're going on about, so I'll just assume this is just some sort of self-aggrandizement snobbery done in an effort to cover up the fact that you really don't know jack-[censored] about what I asked. Actually, he knew exactly what you were talking about, and made a pretty funny joke that many guitarists would get. It wasn't snobbery, it was rolling with the theme.
Humor is like a frog: You can dissect it, but the thing dies in the process. But I'll try to explain anyway...
"Line 6" is a company that makes digital guitar effects processors, and one model line of theirs is called the "Pod".
|
Top
|
|
|
|
#151261 - 29/03/2003 17:39
Re: Emtune?
[Re: JeffS]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
|
Top
|
|
|
|
#151262 - 30/03/2003 11:36
Re: Emtune?
[Re: canuckInOR]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Ok, here's the useful answer
Firstly, let us assume that we can somehow get the guitars output into the empeg using the line input. It might take a small preamp gadget, but it's doable.
Ok, that leaves the challenge to be:
1) Tell the kernel that we want to sample the input. In practice, that means to make the same ioctl calls to the kernel that the player makes when switching to aux in. We know that 'Aux In' visuals have to be sampled somewhere...
2) Read the samples into the application. The sample rate is not an issue - ISTR that the sampling rate is 22.05KHz. Obviously the root frequencies of a guitars strings are a couple of magnitudes lower than this, so Nyquist can piss off and mind his own business.
3) Do a fourier transform on the samples. This is the tricky part, but obviously doable since many of the players visuals rely on such transforms. Aside from the fact that coding fourier transforms isn't particulary trivial to begin with, we also need to remember that musical notes in the lower octaves aren't integer Hz, and the fourier transform needs to be able to measure this. (I doubt the player FFT code cares about that point).
4) Find the highest peak. Sanity check that it's also the lowest frequency peak and that we're not getting a harmonic at a higher level than the root.
5) Compare the frequency of that peak to an array of frequency ranges to find out which note it is closest to.
6) Display the note, and an indication of which way we need to tune to get absolute.
There is another approach that might have some merit investigating;
Instead of measuring the current tuning of the string, we could use the DSPs tone generators to play a note that we could tune against. This would avoid the hassle of coding FFTs, or dealing with guitar signal levels. In fact, the userland coding would be trivial.
I'm in the process of developing arbitrary sine wave functionality along with appropriate userland ioctls anyway, so once I've gotten that stable and accepted into hijack, it would just be the case of using a look up table to find the appropriate frequency for the note in question, and then call the ioctl with it.
The limitation of this approach is that the DSP can only play integer frequencies, so low octave notes are going to have errors in them. But we could tune using harmonics, a technique that many guitarists use when relative-tuning anyway. And we should be able to hear beat frequencies.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#151264 - 31/03/2003 21:51
Re: Emtune?
[Re: genixia]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
Uh... wow. That's far more of a challenge than I thought it would be. My thought was much simpler... compare input to a known frequency, and report on the difference. I didn't consider that harmonics would complicate the whole matter. And the FFTs, well, I've heard *of* them. Instead of measuring the current tuning of the string, we could use the DSPs tone generators to play a note that we could tune against. This would avoid the hassle of coding FFTs, or dealing with guitar signal levels. In fact, the userland coding would be trivial. This is more or less what I did -- I just dumped a .wav file on the Empeg.
|
Top
|
|
|
|
#151265 - 31/03/2003 21:52
Re: Emtune?
[Re: tfabris]
|
carpal tunnel
Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
|
I wondered how long it would be before someone mentioned that. Reading that thread is actually what prompted my musings to begin with.
|
Top
|
|
|
|
|
|