Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: Projects/Libraries On Tuning? [modified] Pin
Ravadre28-Dec-08 17:32
Ravadre28-Dec-08 17:32 
QuestionRe: Projects/Libraries On Tuning? Pin
Brandon X.29-Dec-08 6:47
Brandon X.29-Dec-08 6:47 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre29-Dec-08 7:33
Ravadre29-Dec-08 7:33 
GeneralRe: Projects/Libraries On Tuning? Pin
Brandon X.29-Dec-08 8:10
Brandon X.29-Dec-08 8:10 
GeneralRe: Projects/Libraries On Tuning? Pin
Ravadre29-Dec-08 8:16
Ravadre29-Dec-08 8:16 
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.29-Dec-08 19:29
Brandon X.29-Dec-08 19:29 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre30-Dec-08 4:42
Ravadre30-Dec-08 4:42 
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.31-Dec-08 10:24
Brandon X.31-Dec-08 10:24 
Goodness. The more I dig into this project, the more I realize I don't know what I'm doing. Sorry for the delay in responding, been busy at work. I have today off from work for New Year's.

For the record, I am recording my samples using the regular Windows XP sound recorder (sndrec32.exe -- you can bring it up if you click Start -> Run, and type 'sndrec32') and have set the select under File -> Properties -> "Convert Now" -> to Format as "PCM" and the attributes to "44100khz at 16 bit Mono".

Since I'm recording in Mono, I didn't bother splitting the channels out as the original author did like so in his Process():

// Split out channels from sample
              int h = 0;
              for (int i = 0; i < wave.Length; i += 4)
              {
                  _waveLeft[h] = (double)BitConverter.ToInt16(wave, i);
                  _waveRight[h] = (double)BitConverter.ToInt16(wave, i + 2);
                  h++;
              }


Thanks for clarifying that I didn't need to split the arrays back together (d'oh!). I'm a bit confused on how that is supposed to work though?

If I am passing to my Process() function an array of bytes[16384] from the WAV File - isn't this data from the first few seconds of the WAV file? (Remember, I am jumping 44 bytes into the WAV file, reading from that position to the end of the file, and then splitting that array into byte[16384] each into a List<byte[]> )

The reason I ask is because as soon as I hit "Record" I don't immediately play my guitar string. Thus, wouldn't the first second or so of the WAV file be silence - so thus the first 16384 bytes be unusable to me? D'Oh! | :doh:

If this is incorrect, forgive me - but only reason I ask is because although I've adjusted my code now to only bother with a 16kb sample, I am still getting different maximum magnitudes when I iterate over my array for each WAV file (although they are the same note & string) played on my guitar.)

Also, I am still a bit lost on your frequency formula's you had earlier. You said in your original post:

Now, if fe. your fi = 50, sample_rate = 44100 (which is standard value), 
and you will catch 4096 samples (which means, your T tables has length od 4096, and that means, your F table has length of 4096), 
the most significant frequency in your sound probe is:
Freq = 50 * (44100 / 4096)

which I simply translated to be in code:

double freq = _MaxFoundValue * (SampleRate / _outputSample.Length);

but I don't understand how that relates to the FreqStep you mentioned (is not FreqStep just SampleRate / _outputSample.Length)?

Is my formula
double freq = _MaxFoundValue * (SampleRate / _outputSample.Length);
correct? From here, do I simply compare this result against a table for pitch for respective guitar notes (such as this http://www.vaughns-1-pagers.com/music/musical-note-frequencies.htm[^] ?)

Finally, thank you for all the information you have already provided. It has gotten me further along than I would have expected. If it makes life easier for you - is there simply just a condensed writeup that would explain all this comprehensively?

Thank you very much for all the guidance thus far,

Brandon.

modified on Wednesday, December 31, 2008 4:36 PM

AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre31-Dec-08 12:35
Ravadre31-Dec-08 12:35 
QuestionC# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom27-Dec-08 13:44
spamoom27-Dec-08 13:44 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6427-Dec-08 14:45
professionalRichard Andrew x6427-Dec-08 14:45 
QuestionRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 0:13
spamoom28-Dec-08 0:13 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6428-Dec-08 1:36
professionalRichard Andrew x6428-Dec-08 1:36 
GeneralRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 2:04
spamoom28-Dec-08 2:04 
Question[Message Deleted] Pin
TwoSocks27-Dec-08 13:40
TwoSocks27-Dec-08 13:40 
Questionlock the windows xp Pin
abu rakan27-Dec-08 12:06
abu rakan27-Dec-08 12:06 
AnswerRe: lock the windows xp Pin
User 665827-Dec-08 13:00
User 665827-Dec-08 13:00 
Questionavi file Pin
manishkumarcse27-Dec-08 11:57
manishkumarcse27-Dec-08 11:57 
GeneralRe: avi file Pin
Luc Pattyn27-Dec-08 12:38
sitebuilderLuc Pattyn27-Dec-08 12:38 
AnswerRe: avi file Pin
Code Soldier28-Dec-08 5:25
Code Soldier28-Dec-08 5:25 
QuestionDatabase update error help Pin
hatan8627-Dec-08 9:39
hatan8627-Dec-08 9:39 
AnswerRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 9:57
Colin Angus Mackay27-Dec-08 9:57 
GeneralRe: Database update error help Pin
hatan8627-Dec-08 10:18
hatan8627-Dec-08 10:18 
GeneralRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 10:38
Colin Angus Mackay27-Dec-08 10:38 
QuestionPaint drawing multiple layers Pin
Chris Copeland27-Dec-08 5:48
mveChris Copeland27-Dec-08 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.