Reply by Richard Dobson August 14, 20082008-08-14
jungledmnc wrote:
> 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.
..
> 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? >
This is different again, and not what musicians call "harmonizing". It sounds closer to what is called "exciting", after the Aphex "Aural Exciter" effect that dates back to 1975 or so. It added small amounts of (somehow) synthesized higher harmonics in order to brighten up the sound. The method is patented, and was claimed at the time to have been discovered by accident when an engineer incorrectly wired up a circuit. See http://en.wikipedia.org/wiki/Aphex_Systems So it is closer to a general waveshaping method than to anything involving explicit pitch shifting. To add harmonics (= distortion, albeit very controlled) you need some sort of non-linear transfer function. The Aphex effect adds some phase shift and compression as well, and is level dependent. To clone it would almost certainly require some sophisticated dsp (e.g. analog modelling). It is not something I have ever done, so cannot advise on how to create the effect. It would be well worth asking on the musicdsp list, as there will very likely be folk there who have done it more than once. A frequency-domain (e.g. pvoc-based) approach could well prove a good route to an at least plausibly similar effect. I have indeed added an octave pitch shift to a flute recording to get a sort of enhancement effect, but note that this shifts everything, including fundamentals, so it is much more like adding a 4ft organ stop (or simply doubling flute with piccolo!) than an "exciter" effect. NB: to make a sound more "full" (in the vague way musicians define it), the standard method is to use conventional EQ to boost the signal in the (vaguely) 1KHz to 2KHz region. Might be lower range for drums, etc. Richard Dobson
Reply by jungledmnc August 13, 20082008-08-13
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?
Reply by August 13, 20082008-08-13
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.
Reply by August 13, 20082008-08-13
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!
Reply by Tony August 13, 20082008-08-13
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?
Reply by TVcommercials August 13, 20082008-08-13
>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?
Reply by Richard Dobson August 12, 20082008-08-12
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
Reply by August 12, 20082008-08-12

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.
Reply by jungledmnc August 12, 20082008-08-12
Hey thanks a lot! The idea with putting an extra period is awesome. 

dmnc
Reply by robert bristow-johnson August 12, 20082008-08-12
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