LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Musical Note Harmonizer question

I'm currently working on a project that takes a signal(singing voice) from a microphone into a soundcard which is simultaneously (well, nearly simultaneously) output to my speakers.  I have gotten this to work.  So far so good.
 
The next step is to harmonize the signal (for example a major 3rd, octave, two octaves, etc, above or below the orignal frequency).  This is done by multiplying the orignal frequency by 2^(n/12), where n is the number of half steps above(+n's) or below (-n's) the original note giving the desired harmony.  For example a 220Hz "A" an octave higher is 440Hz (220Hz*2^(12/12)=440Hz), or a major 3rd (4 half steps above "A" would be 220Hz*2^(4/12)=277.20Hz a "C#").
 
OK... so the problem I'm having is taking the original aquired signal from the SoundInputRead.vi which has a data type of a 1D array with Waveform(DBL) elements.  I've simply tried multiplying the SoundInputRead.vi signal output with the 2^(n/12) equation using a multiplication block (from the numeric pallete), but I only seem to get audible static(noise) around the input note that is sung.  Is there some way to convert the waveform(DBL) data type so that I can make the multiplication to the input frequency then convert it back to the waveform data type with the updated (harmonized) values for sound output?  Am I going about this the correct way?
 
Any help would be most appreciated. 
0 Kudos
Message 1 of 3
(2,548 Views)

I've just started playing with some sound apps myself.  I'm no expert on it but I think you're missing something here.  The output arrays of the sound VIs are the Y (amplitude) components.  Changing them will affect volume rather than pitch.  If you want to change the frequency of the sound you'll have to change the sample rate at which it plays back.  Two problems here.  First, you are limited to only a few standard rates (11025, 22050, 44100, 8000) with the sound output VIs.  Second, if you shift more than a few tones you'll experience "munchkinization".  The timbre of the sound will change along with the pitch making the harmonized voices sound more like the Chipmunks (or Darth Vader).  You can apply formant corrections to make the timbre stable but that would be a rather advanced project. 

I'll be sure to post anything else on this thread that might assist your endeavours.  If anyone else on the boards has more info on this subject please don't hesitate to 'Sing Out'.Smiley Very Happy

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 3
(2,540 Views)
I just notice the program 'Resampling Wave File Player.vi' in the LabVIEW example Finder.  It looks like it does non-formant corrected pitch changing.  Take a look, it should provide some insight for you.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 3 of 3
(2,533 Views)