Closed rodw closed 2 years ago
I meant to add: I also think the xylophone samples may be labelled one octave lower than the actual tone (i.e. C4.mp3 is actually a C5) but I was getting slightly inconsistent results when testing that instrument so I'm not entirely sure.
@rodw I agree with you that it seems like everything for the piano is listed an octave off. Did you end up verifying that was the case using it in some project somewhere?
@TimTinkers
Did you end up verifying that was the case using it in some project somewhere?
Essentially, yes.
Assuming the reason for your question is that you're looking for confirmation that these 12 audio-sample sets are indeed labeled incorrectly, for what it's worth I strongly believe that they are, and I've acted on that belief to make changes to production software.
I use some of these samples to generate audio from GuitarPro scores in this app, which, by the way, happens to include a pitch-detection algorithm.
Some of my users complained that the pitch for some of the generated audio sounded off, which is something I had sometimes suspected also, but to be honest the audio generation is a moderately complex, multi-step process so when I originally looked at the issue there were other (unrelated) factors at play that explained at least some of the issues I was experiencing.
But when the problem persisted I eventually broke down and went through a fairly laborious process of testing each audio sample individually. Ultimately this led to the observations reported in this ticket.
Since octave detection is actually a trickier problem than you might think (because harmonics), I didn't want to put too much faith into any one analyzer. So I used several techniques and independent pitch-detection implementations to verify the results, including:
my app's own pitch detection algorithm, applied both to the raw audio files directly and to "live" audio played through a few different computer/speaker combinations (since my app's normal mode of operation is to detect the pitch of sounds picked up by the computer's microphone or other audio-input device)
pitch detection from the raw audio files using the command-line utility aubio
this pitch detection plug-in for Audacity (and also a little bit of looking at the peak frequencies reported by the "Plot Spectrum" tool in Audacity, which I assume is based on some form of FFT analysis)
a couple of different stand-alone, hardware-based pitch detection devices (guitar tuners) - including one of those fancy mechanical strobe tuners - using audio played through computer speakers
"virtual" tuner apps, including a guitar-tuner mobile app on my phone and some web-based pitch detectors like the one I linked in my first post on this thread
"manually" comparing the audio samples (again, played through a computer speaker) to the sound generated by various tone-generators (a couple of stand-alone tuners, a mobile app, a web app, a hardware synthesizer) by ear
I didn't test each individual audio sample with all of these analyzers, and apparently didn't bother to archive the notes I took at the time, but I was pretty thorough. I did enough validation/cross-checking (and found consistent-enough results) that I'm pretty confident the observations I reported are accurate.
Specifically, not long after I submitted this initial bug report I changed the pitch-to-audio-sample mappings I use for the production version of my app to correct for this. (I.e., I bumped the octave-to-sample mapping up for those 11 instruments that seem to be labelled one octave lower than the actual pitch, and down for the bass-electric
samples which seem to be labelled one octave higher than the actual pitch.)
These now sound right both to me and to the users that reported the issue, and I haven't heard any complaints from app users since I made that change.
A few caveats that may be worth noting:
Since I only use the MP3 files I was almost exclusively testing the mp3-format samples. If you're using wav or ogg files you may want to probe those just a little bit more to make sure it's not a format-specific problem. I did however spot-check the other formats for a few samples and found the same results in all formats for the notes that I tested.
As I mentioned, I think the xylophone samples may also be labelled one octave lower than the actual pitch in the audio sample (e.g. C4.mp3 is actually a C5 note and so on) but I was getting inconsistent results for those samples so I've left them alone for now.
As noted in the first post in this thread, I tested and did not find any problems with the other instruments (the 6 instruments listed under bullet # 3 in the OP). However I just now noticed that one instrument - cello - is not mentioned in my original post at all. Looking at my app config just now I see that I have not remapped the cello samples from the octaves specified by the original filename. I'm not sure if that's because I accidentally left it off the list of instruments that checked-out OK, or if I didn't test the cello samples at all. FWIW I just spot-checked a couple of the cello samples using aubiopitch and it looks like they are correct (i.e., aubio detected the same octave that is specified in the filename), so hopefully it's the former.
@rodw wow, thanks for the fantastic write-up of your very-diligent process there! I was thinking of using these samples in a project of mine and will definitely perform the same remapping as you suggest.
LOL, sure. No problem. Honestly when I posted this issue to begin with I was like you mostly looking for confirmation that I wasn't crazy, some of the samples really are marked with the wrong octave.
The reason I went to such an extreme here that I had been chasing a constellation of related bugs (or different but overlapping bugs with same general symptoms) off and on for a long time.
For example in one case I had a bug in my audio generation logic that was sometimes generating pitches that were an octave too low, and another bug (this bug) in which the audio samples I was generating audio with were mapped to be an octave too high, so they cancelled each other out in that specific combination.
Frankly the idea that the audio samples were mislabeled was the last thing I thought to check - surely it's a problem with my pitch detector, or my score parser, or my audio generation, or maybe I broke something when I reprocessed some of the audio files, or whatever, right? And sometimes it was.
Once I realized that some of the audio samples seemed to be off I decided to take "sledgehammer" approach to finally squash this bug once and for all. I had been burned before by thinking that the one related issue I found and fixed was the only issue I was having, so I wanted to make sure I was very thorough.
The good news is that it seems to have worked. I haven't noticed - and users haven't reported - any related symptoms since I made this final change.
Yes I also noticed this when I implemented this in my project several months ago and spent ages chasing bugs. In the end I wrote a hack to cure it for the piano sound. I haven't had time to read this properly but thanks so much for documenting your fixes. Have you forked the repo with your changes somewhere?
(oops, hit the close button by accident)
@syntheso I have not created a fork with these changes. In fact I haven't even changed the filenames in my local copy of tonejs-instruments.
In my particular case I have a config file that maps scientific pitch notation notes to sample files (the same config that you feed to Tone.Sampler), and I simply remapped this configuration accordingly. I.e,. I've got something like:
{
A1: "A2.mp3",
A2: "A3.mp3"
}
rather than A1->A1, A2->A2, etc.
@rodw Ok, fair enough. I guess that's not a complete solution (which would be to rename everything), but would you perhaps be willing to share it, assuming it's abstracted from the project you're using it in?
It's basically this:
#==============================================================================#
# PIANO
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A1" : "#{instrument_path_prefix}/piano/A0.mp3"
"A2" : "#{instrument_path_prefix}/piano/A1.mp3"
"A3" : "#{instrument_path_prefix}/piano/A2.mp3"
"A4" : "#{instrument_path_prefix}/piano/A3.mp3"
"A5" : "#{instrument_path_prefix}/piano/A4.mp3"
"A6" : "#{instrument_path_prefix}/piano/A5.mp3"
"A7" : "#{instrument_path_prefix}/piano/A6.mp3"
"A#1" : "#{instrument_path_prefix}/piano/As0.mp3"
"A#2" : "#{instrument_path_prefix}/piano/As1.mp3"
"A#3" : "#{instrument_path_prefix}/piano/As2.mp3"
"A#4" : "#{instrument_path_prefix}/piano/As3.mp3"
"A#5" : "#{instrument_path_prefix}/piano/As4.mp3"
"A#6" : "#{instrument_path_prefix}/piano/As5.mp3"
"A#7" : "#{instrument_path_prefix}/piano/As6.mp3"
"B1" : "#{instrument_path_prefix}/piano/B0.mp3"
"B2" : "#{instrument_path_prefix}/piano/B1.mp3"
"B3" : "#{instrument_path_prefix}/piano/B2.mp3"
"B4" : "#{instrument_path_prefix}/piano/B3.mp3"
"B5" : "#{instrument_path_prefix}/piano/B4.mp3"
"B6" : "#{instrument_path_prefix}/piano/B5.mp3"
"B7" : "#{instrument_path_prefix}/piano/B6.mp3"
"C1" : "#{instrument_path_prefix}/piano/C0.mp3"
"C2" : "#{instrument_path_prefix}/piano/C1.mp3"
"C3" : "#{instrument_path_prefix}/piano/C2.mp3"
"C4" : "#{instrument_path_prefix}/piano/C3.mp3"
"C5" : "#{instrument_path_prefix}/piano/C4.mp3"
"C6" : "#{instrument_path_prefix}/piano/C5.mp3"
"C7" : "#{instrument_path_prefix}/piano/C6.mp3"
"C8" : "#{instrument_path_prefix}/piano/C7.mp3"
"C#1" : "#{instrument_path_prefix}/piano/Cs0.mp3"
"C#2" : "#{instrument_path_prefix}/piano/Cs1.mp3"
"C#3" : "#{instrument_path_prefix}/piano/Cs2.mp3"
"C#4" : "#{instrument_path_prefix}/piano/Cs3.mp3"
"C#5" : "#{instrument_path_prefix}/piano/Cs4.mp3"
"C#6" : "#{instrument_path_prefix}/piano/Cs5.mp3"
"C#7" : "#{instrument_path_prefix}/piano/Cs6.mp3"
"D1" : "#{instrument_path_prefix}/piano/D0.mp3"
"D2" : "#{instrument_path_prefix}/piano/D1.mp3"
"D3" : "#{instrument_path_prefix}/piano/D2.mp3"
"D4" : "#{instrument_path_prefix}/piano/D3.mp3"
"D5" : "#{instrument_path_prefix}/piano/D4.mp3"
"D6" : "#{instrument_path_prefix}/piano/D5.mp3"
"D7" : "#{instrument_path_prefix}/piano/D6.mp3"
"D#1" : "#{instrument_path_prefix}/piano/Ds0.mp3"
"D#2" : "#{instrument_path_prefix}/piano/Ds1.mp3"
"D#3" : "#{instrument_path_prefix}/piano/Ds2.mp3"
"D#4" : "#{instrument_path_prefix}/piano/Ds3.mp3"
"D#5" : "#{instrument_path_prefix}/piano/Ds4.mp3"
"D#6" : "#{instrument_path_prefix}/piano/Ds5.mp3"
"D#7" : "#{instrument_path_prefix}/piano/Ds6.mp3"
"E1" : "#{instrument_path_prefix}/piano/E0.mp3"
"E2" : "#{instrument_path_prefix}/piano/E1.mp3"
"E3" : "#{instrument_path_prefix}/piano/E2.mp3"
"E4" : "#{instrument_path_prefix}/piano/E3.mp3"
"E5" : "#{instrument_path_prefix}/piano/E4.mp3"
"E6" : "#{instrument_path_prefix}/piano/E5.mp3"
"E7" : "#{instrument_path_prefix}/piano/E6.mp3"
"F1" : "#{instrument_path_prefix}/piano/F0.mp3"
"F2" : "#{instrument_path_prefix}/piano/F1.mp3"
"F3" : "#{instrument_path_prefix}/piano/F2.mp3"
"F4" : "#{instrument_path_prefix}/piano/F3.mp3"
"F5" : "#{instrument_path_prefix}/piano/F4.mp3"
"F6" : "#{instrument_path_prefix}/piano/F5.mp3"
"F7" : "#{instrument_path_prefix}/piano/F6.mp3"
"F#1" : "#{instrument_path_prefix}/piano/Fs0.mp3"
"F#2" : "#{instrument_path_prefix}/piano/Fs1.mp3"
"F#3" : "#{instrument_path_prefix}/piano/Fs2.mp3"
"F#4" : "#{instrument_path_prefix}/piano/Fs3.mp3"
"F#5" : "#{instrument_path_prefix}/piano/Fs4.mp3"
"F#6" : "#{instrument_path_prefix}/piano/Fs5.mp3"
"F#7" : "#{instrument_path_prefix}/piano/Fs6.mp3"
"G1" : "#{instrument_path_prefix}/piano/G0.mp3"
"G2" : "#{instrument_path_prefix}/piano/G1.mp3"
"G3" : "#{instrument_path_prefix}/piano/G2.mp3"
"G4" : "#{instrument_path_prefix}/piano/G3.mp3"
"G5" : "#{instrument_path_prefix}/piano/G4.mp3"
"G6" : "#{instrument_path_prefix}/piano/G5.mp3"
"G7" : "#{instrument_path_prefix}/piano/G6.mp3"
"G#1" : "#{instrument_path_prefix}/piano/Gs0.mp3"
"G#2" : "#{instrument_path_prefix}/piano/Gs1.mp3"
"G#3" : "#{instrument_path_prefix}/piano/Gs2.mp3"
"G#4" : "#{instrument_path_prefix}/piano/Gs3.mp3"
"G#5" : "#{instrument_path_prefix}/piano/Gs4.mp3"
"G#6" : "#{instrument_path_prefix}/piano/Gs5.mp3"
"G#7" : "#{instrument_path_prefix}/piano/Gs6.mp3"
}
}
#============================================================================#
#==============================================================================#
# XYLOPHONE
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"C5" : "#{instrument_path_prefix}/xylophone/C4.mp3"
"C6" : "#{instrument_path_prefix}/xylophone/C5.mp3"
"C7" : "#{instrument_path_prefix}/xylophone/C6.mp3"
"C8" : "#{instrument_path_prefix}/xylophone/C7.mp3"
"G4" : "#{instrument_path_prefix}/xylophone/G3.mp3"
"G5" : "#{instrument_path_prefix}/xylophone/G4.mp3"
"G6" : "#{instrument_path_prefix}/xylophone/G5.mp3"
"G7" : "#{instrument_path_prefix}/xylophone/G6.mp3"
}
}
#==============================================================================#
#==============================================================================#
# GUITAR-ACOUSTIC (STEEL)
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A2" : "#{instrument_path_prefix}/guitar-acoustic/A1.mp3"
"A3" : "#{instrument_path_prefix}/guitar-acoustic/A2.mp3"
"A4" : "#{instrument_path_prefix}/guitar-acoustic/A3.mp3"
"A#2" : "#{instrument_path_prefix}/guitar-acoustic/As1.mp3"
"A#3" : "#{instrument_path_prefix}/guitar-acoustic/As2.mp3"
"A#4" : "#{instrument_path_prefix}/guitar-acoustic/As3.mp3"
"B2" : "#{instrument_path_prefix}/guitar-acoustic/B1.mp3"
"B3" : "#{instrument_path_prefix}/guitar-acoustic/B2.mp3"
"B4" : "#{instrument_path_prefix}/guitar-acoustic/B3.mp3"
"C3" : "#{instrument_path_prefix}/guitar-acoustic/C2.mp3"
"C4" : "#{instrument_path_prefix}/guitar-acoustic/C3.mp3"
"C5" : "#{instrument_path_prefix}/guitar-acoustic/C4.mp3"
"C#3" : "#{instrument_path_prefix}/guitar-acoustic/Cs2.mp3"
"C#4" : "#{instrument_path_prefix}/guitar-acoustic/Cs3.mp3"
"C#5" : "#{instrument_path_prefix}/guitar-acoustic/Cs4.mp3"
"D2" : "#{instrument_path_prefix}/guitar-acoustic/D1.mp3"
"D3" : "#{instrument_path_prefix}/guitar-acoustic/D2.mp3"
"D4" : "#{instrument_path_prefix}/guitar-acoustic/D3.mp3"
"D5" : "#{instrument_path_prefix}/guitar-acoustic/D4.mp3"
"D#2" : "#{instrument_path_prefix}/guitar-acoustic/Ds1.mp3"
"D#3" : "#{instrument_path_prefix}/guitar-acoustic/Ds2.mp3"
"D#4" : "#{instrument_path_prefix}/guitar-acoustic/Ds3.mp3"
"E2" : "#{instrument_path_prefix}/guitar-acoustic/E1.mp3"
"E3" : "#{instrument_path_prefix}/guitar-acoustic/E2.mp3"
"E4" : "#{instrument_path_prefix}/guitar-acoustic/E3.mp3"
"F2" : "#{instrument_path_prefix}/guitar-acoustic/F1.mp3"
"F3" : "#{instrument_path_prefix}/guitar-acoustic/F2.mp3"
"F4" : "#{instrument_path_prefix}/guitar-acoustic/F3.mp3"
"F#2" : "#{instrument_path_prefix}/guitar-acoustic/Fs1.mp3"
"F#3" : "#{instrument_path_prefix}/guitar-acoustic/Fs2.mp3"
"F#4" : "#{instrument_path_prefix}/guitar-acoustic/Fs3.mp3"
"G2" : "#{instrument_path_prefix}/guitar-acoustic/G1.mp3"
"G3" : "#{instrument_path_prefix}/guitar-acoustic/G2.mp3"
"G4" : "#{instrument_path_prefix}/guitar-acoustic/G3.mp3"
"G#2" : "#{instrument_path_prefix}/guitar-acoustic/Gs1.mp3"
"G#3" : "#{instrument_path_prefix}/guitar-acoustic/Gs2.mp3"
"G#4" : "#{instrument_path_prefix}/guitar-acoustic/Gs3.mp3"
}
}
}
#==============================================================================#
#==============================================================================#
# BASS
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn-1.mp3)
# (note this breaks the usual pattern; these samples are tagged
# one octave too *high*, the other mismatched names are an octave
# too *low*.)
"A#1" : "#{instrument_path_prefix}/bass-electric/As2.mp3"
"A#2" : "#{instrument_path_prefix}/bass-electric/As3.mp3"
"A#3" : "#{instrument_path_prefix}/bass-electric/As4.mp3"
"A#4" : "#{instrument_path_prefix}/bass-electric/As5.mp3"
"C#1" : "#{instrument_path_prefix}/bass-electric/Cs2.mp3"
"C#2" : "#{instrument_path_prefix}/bass-electric/Cs3.mp3"
"C#3" : "#{instrument_path_prefix}/bass-electric/Cs4.mp3"
"C#4" : "#{instrument_path_prefix}/bass-electric/Cs5.mp3"
"C#5" : "#{instrument_path_prefix}/bass-electric/Cs6.mp3"
"E1" : "#{instrument_path_prefix}/bass-electric/E2.mp3"
"E2" : "#{instrument_path_prefix}/bass-electric/E3.mp3"
"E3" : "#{instrument_path_prefix}/bass-electric/E4.mp3"
"E4" : "#{instrument_path_prefix}/bass-electric/E5.mp3"
"G1" : "#{instrument_path_prefix}/bass-electric/G2.mp3"
"G2" : "#{instrument_path_prefix}/bass-electric/G3.mp3"
"G3" : "#{instrument_path_prefix}/bass-electric/G4.mp3"
"G4" : "#{instrument_path_prefix}/bass-electric/G5.mp3"
}
}
#==============================================================================#
#==============================================================================#
# CONTRABASS
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A2" : "#{instrument_path_prefix}/contrabass/A1.mp3"
"A#1" : "#{instrument_path_prefix}/contrabass/As0.mp3"
"B3" : "#{instrument_path_prefix}/contrabass/B2.mp3"
"C2" : "#{instrument_path_prefix}/contrabass/C1.mp3"
"C#3" : "#{instrument_path_prefix}/contrabass/Cs2.mp3"
"D2" : "#{instrument_path_prefix}/contrabass/D1.mp3"
"E2" : "#{instrument_path_prefix}/contrabass/E1.mp3"
"E3" : "#{instrument_path_prefix}/contrabass/E2.mp3"
"F#1" : "#{instrument_path_prefix}/contrabass/Fs0.mp3"
"F#2" : "#{instrument_path_prefix}/contrabass/Fs1.mp3"
"G1" : "#{instrument_path_prefix}/contrabass/G0.mp3"
"G#2" : "#{instrument_path_prefix}/contrabass/Gs1.mp3"
"G#3" : "#{instrument_path_prefix}/contrabass/Gs2.mp3"
}
}
#==============================================================================#
#==============================================================================#
# TRUMPET
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A3" : "#{instrument_path_prefix}/trumpet/A2.mp3"
"A5" : "#{instrument_path_prefix}/trumpet/A4.mp3"
"A#3" : "#{instrument_path_prefix}/trumpet/As3.mp3"
"C3" : "#{instrument_path_prefix}/trumpet/C3.mp3"
"C6" : "#{instrument_path_prefix}/trumpet/C5.mp3"
"D5" : "#{instrument_path_prefix}/trumpet/D4.mp3"
"D#4" : "#{instrument_path_prefix}/trumpet/Ds3.mp3"
"F3" : "#{instrument_path_prefix}/trumpet/F2.mp3"
"F4" : "#{instrument_path_prefix}/trumpet/F3.mp3"
"F5" : "#{instrument_path_prefix}/trumpet/F4.mp3"
"G4" : "#{instrument_path_prefix}/trumpet/G3.mp3"
}
}
#==============================================================================#
#==============================================================================#
# TROMBONE
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A#1" : "#{instrument_path_prefix}/trombone/As0.mp3"
"A#2" : "#{instrument_path_prefix}/trombone/As1.mp3"
"A#3" : "#{instrument_path_prefix}/trombone/As2.mp3"
"C3" : "#{instrument_path_prefix}/trombone/C2.mp3"
"C4" : "#{instrument_path_prefix}/trombone/C3.mp3"
"C#2" : "#{instrument_path_prefix}/trombone/Cs1.mp3"
"C#4" : "#{instrument_path_prefix}/trombone/Cs3.mp3"
"D3" : "#{instrument_path_prefix}/trombone/D2.mp3"
"D4" : "#{instrument_path_prefix}/trombone/D3.mp3"
"D#2" : "#{instrument_path_prefix}/trombone/Ds1.mp3"
"D#3" : "#{instrument_path_prefix}/trombone/Ds2.mp3"
"D#4" : "#{instrument_path_prefix}/trombone/Ds3.mp3"
"F2" : "#{instrument_path_prefix}/trombone/F1.mp3"
"F3" : "#{instrument_path_prefix}/trombone/F2.mp3"
"F4" : "#{instrument_path_prefix}/trombone/F3.mp3"
"G#2" : "#{instrument_path_prefix}/trombone/Gs1.mp3"
"G#3" : "#{instrument_path_prefix}/trombone/Gs2.mp3"
}
}
#==============================================================================#
#==============================================================================#
# TUBA
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A#1" : "#{instrument_path_prefix}/tuba/As0.mp3"
"A#2" : "#{instrument_path_prefix}/tuba/As1.mp3"
"A#3" : "#{instrument_path_prefix}/tuba/As2.mp3"
"D3" : "#{instrument_path_prefix}/tuba/D2.mp3"
"D4" : "#{instrument_path_prefix}/tuba/D3.mp3"
"D#2" : "#{instrument_path_prefix}/tuba/Ds1.mp3"
"F1" : "#{instrument_path_prefix}/tuba/F0.mp3"
"F2" : "#{instrument_path_prefix}/tuba/F1.mp3"
"F3" : "#{instrument_path_prefix}/tuba/F2.mp3"
}
}
#==============================================================================#
#==============================================================================#
# FRENCH HORN
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A1" : "#{instrument_path_prefix}/french-horn/A0.mp3"
"A3" : "#{instrument_path_prefix}/french-horn/A2.mp3"
"C2" : "#{instrument_path_prefix}/french-horn/C1.mp3"
"C4" : "#{instrument_path_prefix}/french-horn/C3.mp3"
"D3" : "#{instrument_path_prefix}/french-horn/D2.mp3"
"D5" : "#{instrument_path_prefix}/french-horn/D4.mp3"
"D#2" : "#{instrument_path_prefix}/french-horn/Ds1.mp3"
"F3" : "#{instrument_path_prefix}/french-horn/F2.mp3"
"F5" : "#{instrument_path_prefix}/french-horn/F4.mp3"
"G2" : "#{instrument_path_prefix}/french-horn/G1.mp3"
}
}
#==============================================================================#
#==============================================================================#
# SAXOPHONE
#==============================================================================#
{
samples : {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A4" : "#{instrument_path_prefix}/saxophone/A3.mp3"
"A5" : "#{instrument_path_prefix}/saxophone/A4.mp3"
"A#3" : "#{instrument_path_prefix}/saxophone/As2.mp3"
"A#4" : "#{instrument_path_prefix}/saxophone/As3.mp3"
"B3" : "#{instrument_path_prefix}/saxophone/B2.mp3"
"B4" : "#{instrument_path_prefix}/saxophone/B3.mp3"
"C4" : "#{instrument_path_prefix}/saxophone/C3.mp3"
"C5" : "#{instrument_path_prefix}/saxophone/C4.mp3"
"C#3" : "#{instrument_path_prefix}/saxophone/Cs2.mp3"
"C#4" : "#{instrument_path_prefix}/saxophone/Cs3.mp3"
"C#5" : "#{instrument_path_prefix}/saxophone/Cs4.mp3"
"D3" : "#{instrument_path_prefix}/saxophone/D2.mp3"
"D4" : "#{instrument_path_prefix}/saxophone/D3.mp3"
"D5" : "#{instrument_path_prefix}/saxophone/D4.mp3"
"D#3" : "#{instrument_path_prefix}/saxophone/Ds2.mp3"
"D#4" : "#{instrument_path_prefix}/saxophone/Ds3.mp3"
"D#5" : "#{instrument_path_prefix}/saxophone/Ds4.mp3"
"E3" : "#{instrument_path_prefix}/saxophone/E2.mp3"
"E4" : "#{instrument_path_prefix}/saxophone/E3.mp3"
"E5" : "#{instrument_path_prefix}/saxophone/E4.mp3"
"F3" : "#{instrument_path_prefix}/saxophone/F2.mp3"
"F4" : "#{instrument_path_prefix}/saxophone/F3.mp3"
"F5" : "#{instrument_path_prefix}/saxophone/F4.mp3"
"F#3" : "#{instrument_path_prefix}/saxophone/Fs2.mp3"
"F#4" : "#{instrument_path_prefix}/saxophone/Fs3.mp3"
"F#5" : "#{instrument_path_prefix}/saxophone/Fs4.mp3"
"G3" : "#{instrument_path_prefix}/saxophone/G2.mp3"
"G4" : "#{instrument_path_prefix}/saxophone/G3.mp3"
"G5" : "#{instrument_path_prefix}/saxophone/G4.mp3"
"G#3" : "#{instrument_path_prefix}/saxophone/Gs2.mp3"
"G#4" : "#{instrument_path_prefix}/saxophone/Gs3.mp3"
"G#5" : "#{instrument_path_prefix}/saxophone/Gs4.mp3"
}
}
#==============================================================================#
#==============================================================================#
# BASSOON
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A2" : "#{instrument_path_prefix}/bassoon/A1.mp3"
"A3" : "#{instrument_path_prefix}/bassoon/A2.mp3"
"A4" : "#{instrument_path_prefix}/bassoon/A3.mp3"
"C3" : "#{instrument_path_prefix}/bassoon/C2.mp3"
"C4" : "#{instrument_path_prefix}/bassoon/C3.mp3"
"C5" : "#{instrument_path_prefix}/bassoon/C4.mp3"
"E4" : "#{instrument_path_prefix}/bassoon/E3.mp3"
"G2" : "#{instrument_path_prefix}/bassoon/G1.mp3"
"G3" : "#{instrument_path_prefix}/bassoon/G2.mp3"
"G4" : "#{instrument_path_prefix}/bassoon/G3.mp3"
}
}
#==============================================================================#
#==============================================================================#
# CLARINET
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A#3" : "#{instrument_path_prefix}/clarinet/As2.mp3"
"A#4" : "#{instrument_path_prefix}/clarinet/As3.mp3"
"A#5" : "#{instrument_path_prefix}/clarinet/As4.mp3"
"D3" : "#{instrument_path_prefix}/clarinet/D2.mp3"
"D4" : "#{instrument_path_prefix}/clarinet/D3.mp3"
"D5" : "#{instrument_path_prefix}/clarinet/D4.mp3"
"D6" : "#{instrument_path_prefix}/clarinet/D5.mp3"
"F3" : "#{instrument_path_prefix}/clarinet/F2.mp3"
"F4" : "#{instrument_path_prefix}/clarinet/F3.mp3"
"F5" : "#{instrument_path_prefix}/clarinet/F4.mp3"
"F#6" : "#{instrument_path_prefix}/clarinet/Fs5.mp3"
}
}
#==============================================================================#
#==============================================================================#
# FLUTE
#==============================================================================#
{
urls: {
# NOTE: these samples have been re-mapped because the original filenames
# indicate the wrong octave (Kn.mp3 is really Kn+1.mp3)
"A4" : "#{instrument_path_prefix}/flute/A3.mp3"
"A5" : "#{instrument_path_prefix}/flute/A4.mp3"
"A6" : "#{instrument_path_prefix}/flute/A5.mp3"
"C4" : "#{instrument_path_prefix}/flute/C3.mp3"
"C5" : "#{instrument_path_prefix}/flute/C4.mp3"
"C6" : "#{instrument_path_prefix}/flute/C5.mp3"
"C7" : "#{instrument_path_prefix}/flute/C6.mp3"
"E4" : "#{instrument_path_prefix}/flute/E3.mp3"
"E5" : "#{instrument_path_prefix}/flute/E4.mp3"
"E6" : "#{instrument_path_prefix}/flute/E5.mp3"
}
}
#==============================================================================#
where instrument_path_prefix
is the relative path to the directory containing the audio files.
All other instruments are mapped "directly" (A3->A3, etc.).
Hi, I also think a lot of instruments have the wrong octava!
Thanks! I renamed all the files you've listed. Let me know if you notice anything else.
I think that the octave indicated in the file name may be consistently off by one for several of the instruments. For example:
the piano samples appear to be labelled one octave lower than they should be - e.g., samples/piano/A3.mp3 measures as an A4 tone (440hz) and that pattern applies to the rest of the notes I tried
the bass-electric samples appear to be labelled one octave higher than they should be - e.g. samples/bass-electric/E2.mp3 measures as an E1 tone (41.2hz) and that pattern applies to the rest of the notes I tried
I could be wrong - or I guess it's possible this is somehow an artifact of the computer/speakers I'm using to play the audio locally (but if that's the case the artifact impacts some but not all of the files I tried) - but I did test a large number of the mp3 files with a few pitch detectors (including stand-alone hardware, phone-based and web-based) and by ear against a tone generator.
Note that I didn't test every single sample, and I was mainly looking at the MP3 files, but I did check the majority of the files and the results seem pretty consistent.
Specifically, it looks like:
1. The file name is one octave lower than it should be (e.g. A3.mp3 is actually an A4) for the following instruments:
2. The file name is one octave higher than it should be (e.g. E3.mp3 is actually an E2) in
bass-electric
3. The octave in the file name seems to be correct for the following instruments:
For a quick spot check of the results I'm seeing you could play some of the audio samples against an online pitch detector like this one: https://www.onlinemictest.com/tuners/pitch-detector/ but as I mentioned I seem to get consistent results from a few different pitch detection devices and - to my admittedly limited ability - when matching by ear.
Can anyone else confirm these results?