Author |
Message |
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
Posted: Thu Nov 20, 2008 9:58 am Post subject:
calculating 3rds |
|
|
I'm trying to implement a diatonic harmonizer.
Given a scale and a note value, how can I calculate the note value of, say, a 3rd up in the scale?
I have a few ideas but they all seem rather ugly to implement. One way which might make for a nice interface, is to map the current note to a step in the note sequencer, which in turn would give me the correct output note. Seems like the only way to get a sequencer to a particular step is to reset it and give it N clock pulses, which I'm not sure how to do.
thanks! |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Thu Nov 20, 2008 10:26 am Post subject:
Re: calculating 3rds |
|
|
tayholliday wrote: | Given a scale and a note value, how can I calculate the note value of, say, a 3rd up in the scale?
|
In equal temperament, you go up a minor third by multiplying the frequency by the fourth root of 2; you go up a major third by multiplying the frequency by the cube root of 2. |
|
Back to top
|
|
|
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
Posted: Thu Nov 20, 2008 10:37 am Post subject:
Re: calculating 3rds |
|
|
ark wrote: |
In equal temperament, you go up a minor third by multiplying the frequency by the fourth root of 2; you go up a major third by multiplying the frequency by the cube root of 2. |
Right, but I'm implementing a diatonic harmonizer, so I need some logic to decide which interval to use (maj3, min3), depending on the note I'm playing.
Oh, and I'm trying to do this for guitar, so I'm using the pitch track module to determine the note I'm playing. |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Thu Nov 20, 2008 10:42 am Post subject:
|
|
|
Won't a key quantizer do most of what you want? |
|
Back to top
|
|
|
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
Posted: Thu Nov 20, 2008 11:01 am Post subject:
|
|
|
ark wrote: | Won't a key quantizer do most of what you want? |
I was thinking about that... but I'm not sure how to apply it. Adding a fixed number of semitones (3 for min3, 4 for maj3) and then quantizing only gets it right half of the time. I still need a way of choosing which interval to use based on the current note. Really, it would be cool to have an arbitrary 1 octave note -> note mapping. |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Thu Nov 20, 2008 11:32 am Post subject:
|
|
|
tayholliday wrote: | I was thinking about that... but I'm not sure how to apply it. Adding a fixed number of semitones (3 for min3, 4 for maj3) and then quantizing only gets it right half of the time. |
What happens if you add 3.5 semitones? |
|
Back to top
|
|
|
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
Posted: Thu Nov 20, 2008 11:48 am Post subject:
|
|
|
ark wrote: | What happens if you add 3.5 semitones? |
Ok for Cmaj:
C -> half way between D# and E -> quantized to E
D -> between F and F# -> quantized to F
E -> between G and G# -> quantized to G
F -> between G # and A -> quantized to A
G -> B
A -> C
B -> D
voila... you're a genius ark!
Now, can I actually add 3.5 to a control signal? I thought they were integers. |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
|
Back to top
|
|
|
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
Posted: Thu Nov 20, 2008 12:28 pm Post subject:
|
|
|
ark wrote: | See attached patch. |
Awesome. Now to do the shift on audio input, I guess I just use the difference between the two pitches as the shift amount? |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Thu Nov 20, 2008 12:35 pm Post subject:
|
|
|
tayholliday wrote: | Now to do the shift on audio input, I guess I just use the difference between the two pitches as the shift amount? |
I would think. |
|
Back to top
|
|
|
tayholliday
Joined: Apr 23, 2008 Posts: 39 Location: San Francisco, CA
G2 patch files: 1
|
|
Back to top
|
|
|
|