DSPRelated.com
Forums

Harmonization

Started by jungledmnc August 12, 2008
Hi,
I'm thinking about an audio effect, which is probably called
harmonization. I think it should teoretically apply several pitch changes
and sum all of them together. At least this is what I think is
harmonization. Probably all of the pitch changes might be a multiply of 2
(octaves). Any ideas?

It might be done by brute force - STFT for each of the pitch change - but
it does not seem very fast. Moreover I think effects of this type have been
implemented in small HW boxes for guitarists, so there should be some
simple solution.

Thankx, dmnc.
On Aug 12, 9:38 am, "jungledmnc" <jungled...@gmail.com> wrote:
> > I'm thinking about an audio effect, which is probably called > harmonization. I think it should teoretically apply several pitch changes > and sum all of them together. At least this is what I think is > harmonization. Probably all of the pitch changes might be a multiply of 2 > (octaves). Any ideas? > > It might be done by brute force - STFT for each of the pitch change - but > it does not seem very fast. Moreover I think effects of this type have been > implemented in small HW boxes for guitarists, so there should be some > simple solution.
although there is no "simple solution" that sounds decent (by "simple", i mean as simple as, say, a filter), but there are time- domain methods that sound very good for pitch shifting single notes (what i like to call "quasi-periodic functions"). these methods essentially resample the input audio (that lives in a buffer) using whatever interpolation technique you're willing to pay for, and these methods splice in extra periods (if you're up-shifting) or splice out periods (if you're down-shifting). they way they know how long a period is, is with something we call a "pitch detector". the analysis for pitch detection (determining the period length) can be both simple and brute force (look up what "AMDF" means) and subtle and difficult when the audio is not reasonably periodic. probably the latter is what the manufacturers of these guitar effects boxes guard as trade secret. r b-j
Hey thanks a lot! The idea with putting an extra period is awesome. 

dmnc

jungledmnc wrote:

> Hi, > I'm thinking about an audio effect, which is probably called > harmonization. I think it should teoretically apply several pitch changes > and sum all of them together. At least this is what I think is > harmonization. Probably all of the pitch changes might be a multiply of 2 > (octaves). Any ideas? > > It might be done by brute force - STFT for each of the pitch change - but > it does not seem very fast. Moreover I think effects of this type have been > implemented in small HW boxes for guitarists, so there should be some > simple solution. > > Thankx, dmnc.
There is a well worled out theory of harmony which has been in existance for hundreds of years. Classical harmony works around "Triads" and triad inversions of the scales of major or minor keys. For any melody you can harmonise by fitting triads or triad inversions to each of the notes. A triad for the scale of C major would be C,E and F. Ist inversion will be F,C E and second inversion F,E,C but I may have the last two the wrong way around! There is a whole list of rules to follow to get the melody sounding good. K.
kronecker@yahoo.co.uk wrote:
> > jungledmnc wrote: > >> Hi, >> I'm thinking about an audio effect, which is probably called >> harmonization. I think it should teoretically apply several pitch changes >> and sum all of them together. At least this is what I think is >> harmonization. Probably all of the pitch changes might be a multiply of 2 >> (octaves). Any ideas? >> >> It might be done by brute force - STFT for each of the pitch change - but >> it does not seem very fast. Moreover I think effects of this type have been >> implemented in small HW boxes for guitarists, so there should be some >> simple solution. >> >> Thankx, dmnc. > > There is a well worled out theory of harmony which has been in > existance for hundreds of years. > Classical harmony works around "Triads" and triad inversions of the > scales of major or minor keys. > For any melody you can harmonise by fitting triads or triad inversions > to each of the notes. A triad for the scale of C major would be C,E > and F. Ist inversion will be F,C E and second inversion F,E,C but I > may have the last two the wrong way around! There is a whole list of > rules to follow to get the melody sounding good. > > K.
There are two meanings of "harmonizer", which may get confused. The one I understand the OP means is the one that generates one or more parallel transpositions of the input, which might for eaxmple be set to make a chord shape of 1+3+6 (where 1 is the input). This is what the harmonizer effect does. It is a well-known and common effect. The other meaning is "harmony generator" or "auto-accompaniment", which tries to find chord sequences to fit the input (e.g. "Band in the Box"). Much less widely used; probably because it is not all that musically satisfactory most of the time. The more sophisticated harmonizer effects take a scale or key as parameters and generate parallel notes that fit, i.e. generating major/minor thirds as required. Richard Dobson
>Hi, >I'm thinking about an audio effect, which is probably called >harmonization. I think it should teoretically apply several pitch
changes
>and sum all of them together. At least this is what I think is >harmonization. Probably all of the pitch changes might be a multiply of
2
>(octaves). Any ideas? > >It might be done by brute force - STFT for each of the pitch change -
but
>it does not seem very fast. Moreover I think effects of this type have
been
>implemented in small HW boxes for guitarists, so there should be some >simple solution. > >Thankx, dmnc. >
This sounds like a cool project, but I'm curious about why you would want to compute the STFT for each pitch change? If I understood your project correctly, you would like to add harmonization to the incoming pitch single. So if I, say, place a note X Hz, you want to in addition add note 2*X Hz as well. This would essentially require estimating the frequency X which computing a power spectrum over a few hundred samples (fraction of a second) should accomplish, no?
On Tue, 12 Aug 2008 11:36:44 -0700 (PDT), kronecker@yahoo.co.uk wrote:
>jungledmnc wrote: > >> Hi, >> I'm thinking about an audio effect, which is probably called >> harmonization. I think it should teoretically apply several pitch changes >> and sum all of them together. At least this is what I think is >> harmonization. Probably all of the pitch changes might be a multiply of 2 >> (octaves). Any ideas? >> >> It might be done by brute force - STFT for each of the pitch change - but >> it does not seem very fast. Moreover I think effects of this type have been >> implemented in small HW boxes for guitarists, so there should be some >> simple solution. >> >> Thankx, dmnc. > >There is a well worled out theory of harmony which has been in >existance for hundreds of years. >Classical harmony works around "Triads" and triad inversions of the >scales of major or minor keys. >For any melody you can harmonise by fitting triads or triad inversions >to each of the notes. A triad for the scale of C major would be C,E >and F. Ist inversion will be F,C E and second inversion F,E,C but I >may have the last two the wrong way around! There is a whole list of >rules to follow to get the melody sounding good.
Am I missing something here, or should all the "F"s be "G"s?
On Aug 13, 7:48 pm, Tony <t...@nowhere.com> wrote:
> On Tue, 12 Aug 2008 11:36:44 -0700 (PDT), kronec...@yahoo.co.uk wrote: > >jungledmnc wrote: > > >> Hi, > >> I'm thinking about an audio effect, which is probably called > >> harmonization. I think it should teoretically apply several pitch changes > >> and sum all of them together. At least this is what I think is > >> harmonization. Probably all of the pitch changes might be a multiply of 2 > >> (octaves). Any ideas? > > >> It might be done by brute force - STFT for each of the pitch change - but > >> it does not seem very fast. Moreover I think effects of this type have been > >> implemented in small HW boxes for guitarists, so there should be some > >> simple solution. > > >> Thankx, dmnc. > > >There is a well worled out theory of harmony which has been in > >existance for hundreds of years. > >Classical harmony works around "Triads" and triad inversions of the > >scales of major or minor keys. > >For any melody you can harmonise by fitting triads or triad inversions > >to each of the notes. A triad for the scale of C major would be C,E > >and F. Ist inversion will be F,C E and second inversion F,E,C but I > >may have the last two the wrong way around! There is a whole list of > >rules to follow to get the melody sounding good. > > Am I missing something here, or should all the "F"s be "G"s?
oops...yes!
On Aug 13, 3:25 pm, "TVcommercials" <myazd...@ucsd.edu> wrote:
> >Hi, > >I'm thinking about an audio effect, which is probably called > >harmonization. I think it should teoretically apply several pitch > changes > >and sum all of them together. At least this is what I think is > >harmonization. Probably all of the pitch changes might be a multiply of > 2 > >(octaves). Any ideas? > > >It might be done by brute force - STFT for each of the pitch change - > but > >it does not seem very fast. Moreover I think effects of this type have > been > >implemented in small HW boxes for guitarists, so there should be some > >simple solution. > > >Thankx, dmnc. > > This sounds like a cool project, but I'm curious about why you would want > to compute the STFT for each pitch change? If I understood your project > correctly, you would like to add harmonization to the incoming pitch > single. So if I, say, place a note X Hz, you want to in addition add note > 2*X Hz as well. This would essentially require estimating the frequency X > which computing a power spectrum over a few hundred samples (fraction of a > second) should accomplish, no?
Not 2*X as this is not harmony but mearly doubling a note an octave higher. Harmony "rings" in thirds normally C to E. Mathematically a semitone is the twelfth root of 2 so a third must be... 2^(1/3) or 2^ (4/12) since there are 4 semi-tones from C to E. Of course teh French used sixes and Jazz uses 9s etc so there are no laws written in stone. K.
Hey guys thanks a lot. Anyway I know something about harmony, so that's not
the issue here. The problem is how to "harmonize" an arbitrary sound - add
some more frequency content, so the sound "sounds" different (more "full"
if possible). I thought that simplification into octaves should ease the
problem.


>This sounds like a cool project, but I'm curious about why you would
want
>to compute the STFT for each pitch change? If I understood your project >correctly, you would like to add harmonization to the incoming pitch >single. So if I, say, place a note X Hz, you want to in addition add
note
>2*X Hz as well. This would essentially require estimating the frequency
X
>which computing a power spectrum over a few hundred samples (fraction of
a
>second) should accomplish, no?
Ok, let's say a simplify the problem even more into a single note. Then it will be X Hz and I want to add 2X Hz just as you said. But how to do that without DFT? The first idea presented here was to interpolate the block into a half-long block and double it. But how to make it connected? The fact that the note is X Hz does not mean, that there is not an additional frequency content above it, which I also want to move by an octave. And what if I want to use it on any signal - I mean more notes or some arbitrary noise-based sounds like drums or even a complete mix?