Hello all,
I'm currently converting a bunch of wav-samples to several gig-files and wrote a bash-script to do that by invoking wav2gig.
The samples are named according to the proposed scheme, the gig files show the right (one note) regions per sample. Unfortunately, the 'Unity note' in gigedit is C4 for all and each sample, so I would have to set this for each sample to the corresponding note manually in gigedit.
Example:
'TP - 1SS - 64 - 065 - F3.wav'
shows the correct range as of F3 (midi note 65), but the 'Unity note' is still C4, so when playing that note, the tone has the wrong pitch.
- Is there a way to automate this?
- Is it possible, to implement a switch in wav2gig to set the 'Unity note' to the corresponding note, the range is created with?
- Or am I doing something wrong?
Thanks and best regards,
Kolja
wav2gig and unity note
Re: wav2gig and unity note
ATM (a) loop points, (b) unity note (a.k.a. "root note") and (c) fine tuning are taken directly from the .wav files, because these are standard information stored in .wav files and supported by most audio editors for decades. Here is the relevant section in line 347 in wav2gig.cpp:
http://svn.linuxsampler.org/cgi-bin/vie ... arkup#l347
The wav2gig command line tool was added to libgig just 2 weeks. It is really just a first version. Obviously there are still plenty of things that can be improved. Allowing to specify the unity like you proposed would be a candidate, but also things like making the naming scheme configurable from the command line instead of hard coded.
I recommend you to just hack the wav2.gig.cpp source file to your personal needs for now. Function getWavInfo() already extracts the note number from the wav file name in line 308:
http://svn.linuxsampler.org/cgi-bin/vie ... arkup#l308
So you can just add a line in function createSample() to use that info instead if the .wav file does not contain it already, i.e. something like:
Code: Select all
if (wav->hasSfInst) {
...
} else {
s->MIDIUnityNote = wav->note;
}
https://sourceforge.net/projects/linuxs ... pler-devel
Re: wav2gig and unity note
Hi,
thanks a lot for your taking the time answer that detailed!
Cheers,
Kolja
thanks a lot for your taking the time answer that detailed!
Ok, I didn't know that.cuse wrote: ↑Tue Aug 24, 2021 2:46 pmATM (a) loop points, (b) unity note (a.k.a. "root note") and (c) fine tuning are taken directly from the .wav files, because these are standard information stored in .wav files and supported by most audio editors for decades. Here is the relevant section in line 347 in wav2gig.cpp:
http://svn.linuxsampler.org/cgi-bin/vie ... arkup#l347
Cool, that worked like a charm, thanks!cuse wrote: ↑Tue Aug 24, 2021 2:46 pmI recommend you to just hack the wav2.gig.cpp source file to your personal needs for now. Function getWavInfo() already extracts the note number from the wav file name in line 308:
http://svn.linuxsampler.org/cgi-bin/vie ... arkup#l308
So you can just add a line in function createSample() to use that info instead if the .wav file does not contain it already, i.e. something like:
Code: Select all
if (wav->hasSfInst) { ... } else { s->MIDIUnityNote = wav->note; }
Yes, that would be great. I already have some ideas regarding this and will post them.but also things like making the naming scheme configurable from the command line instead of hard coded.
Good to know! Although I do some programming, I never really 'patched' before. I'll look into the code of wav2gig more deeply and participate in the mailinglist, when I'm ready to contribute.And ... like always, patches appreciated!
Cheers,
Kolja
Re: wav2gig and unity note
Code: Select all
svn co https://svn.linuxsampler.org/svn/libgig/trunk libgig
cd libgig
[ ... edit source code ... ]
svn diff > ../foo.patch
Re: wav2gig and unity note
Just for the records, this discussion has moved to the mailing list:
https://sourceforge.net/p/linuxsampler/ ... sg37341010
https://sourceforge.net/p/linuxsampler/ ... sg37341010