sf2extract(1)

✨ sf2extract β€” the girl who pulls samples out of SoundFonts ✨

okay so bestie, welcome to sf2extract, one of the libgig tools, and she does exactly one thing but she does it flawlessly: she goes into a SoundFont version 2 (.sf2) file and pulls the samples back out. πŸ’–


🌸 NAME 🌸

sf2extract β€” extract samples from SoundFont version 2 (.sf2) files. that's it, that's the whole job, and she ATE. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

sf2extract [ -v ] SF2FILE DESTDIR [SAMPLENR] [ [SAMPLENR] ... ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. you've got a SoundFont version 2 (.sf2) file. it's full of samples. you want the samples. sf2extract says "say less" and extracts them for you. every single extracted sample gets written out in .wav format, no cap. ✨

the bare minimum you gotta give her:

  • the name of the .sf2 input file (SF2FILE)
  • an output path where all the extracted samples should land (DESTDIR)

that's the vibe check. pass it and you're in.

by default sf2extract extracts all samples contained in the SoundFont file β€” and yes, even the ones that aren't linked by any instrument in the .sf2 file, she's not gonna gatekeep them from you, she's generous like that 🫢 β€” but if you only want particular ones, you can also extract only specific samples by handing her a list of samples indices at the end of the command line. and if you need to see which samples exist and what their sample indices are, you use the sf2dump(1) tool. she's the one with the receipts. πŸ“‹

πŸ’€ Stereo Samples (the part that trips everyone up) πŸ’€

okay so this is the part where everyone gets confused and I need you to lock in, bestie. note that in Sound Font files, stereo samples are always stored as a pair of separate two mono samples. so like, one stereo sample = two mono samples chilling next to each other. keep that in mind when you're selecting individual samples by index, because the index you pass is a mono sample index, not a stereo one.

sf2dump(1) shows you which (mono) sample is linked to which other (mono) sample to form a stereo sample pair β€” it's giving matchmaker, it's giving "these two belong together" πŸ₯Ή

and here's the slay part: sf2extract automatically detects if one of the samples is part of a stereo pair, and automatically extracts the two as combined interleaved stereo sample data to the output .wav file. so you don't have to do anything extra. hence it is sufficient to pass the index of one of the two (mono) samples of each stereo pair you want to extract. one index, whole stereo pair, periodt. πŸ‘‘


✨ OPTIONS ✨

  • SF2FILE β€” filename of the input SoundFont file. the source of all the samples, the main character of the operation πŸ’œ
  • DESTDIR β€” output path where all samples should be extracted to. this is where the .wav files go to live their best lives πŸŽ€
  • SAMPLENR β€” optional index of sample(s) to be exclusively extracted. only give her these ones, nothing else πŸ“
  • -v β€” print version and exit. quick little "hi, this is me, bye" moment 🌸

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group fr fr πŸ’–


😭 BUGS 😭

if something's busted, check and report bugs at http://bugs.linuxsampler.org β€” they wanna hear about it, that's the whole point of the link, don't be shy 🫢


🌈 Author 🌈

Application and manual page written by Christian Schoenebeck <cuse@users.sf.net> β€” thank you for your service, icon πŸŽ€


and that's the whole page bestie, we ate that up. this was libgig 4.5.2, dated 1 Jul 2015, and honestly? timeless. go extract some samples. mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from