FLAG (free) Stems (Multi Channel Wav/Flac Stem Player with High-Quality-Resampling)

Its Windowed-Sinc (linear-phase) with 512 points… there are actually different things happening based on the ratio…

A. Simplest cases are up or down exactly 2x and 4x (like 48k → 96k, 48k → 192k)

B. Next is up-sample, where i:

  1. Up-sample 4x
  2. Use an “6-point 5th order optimal polynomial”-interpolation (Polynomial interpolation – iki.fi/o) to reach the exact sample-rate…

C. Worst case is down-sampling where I:

  1. First up-sample 4x,
  2. Then the polynomial (link above) to match 4x of the target-rate and then
  3. 4x decimation

I keep the original so that switching sample-rate wouldn’t trigger a reload… i realize (now) that seems like rare case… it was very common while testing :slight_smile:

1 Like

wow, that’s impressive! 512 point brute force, or some clever trick? 512 brute force would take a lot of cpu! And, yeah, optimizing for changing same rates - not so common…

1 Like

oh, finally got it to load something (I was trying to load a folder of flac files!). CPU usage is super low! nice.

1 Like

Some clever things are:

  1. When doubling sample-rate, every other sample is exactly the input, so only the new samples (every other) need calculating
  2. The sinc-function is symmetrical around its center, so you can add the left and right sample and only multiply with one coefficient (since left and right are the same).

If I was really clever I’m sure I would have put some FFT in the mix too…

Block convolution with fft isn’t so bad. Once you have your windowed impulse. I didn’t realize before that of course you only need to convert once, ahead of time. So of course the cpu usage is not affected. Brilliant module! Btw, at least for hacking it would be nice to be able to directly load a file, rather than a folder of them.

2 Likes

Thanks to @jue for reporting the Time display was busted past 60 seconds. The latest version “2.1.1” fixes that.

1 Like

Thanks again.

  • Any chance of FLAC support?

  • The browse for folder dialog that appears on Windows doesn’t start at the previously selected folder but at the root. So you need to drill down all the way again if you want to pick a different sub-folder

  • My personal preference is to select the individual files specifically rather than have the module pick the first six in a folder. As it is, I need to construct a dedicated folder for a patch to get the right files. E.g. the way you can pick files in NYSTHI QuadSimpler

  • I have multichannel FLAC files I have created for surround, e.g. 5.1 (6 channels), 7.1 (8 channels). With my Dolby Atmos experiments I might even have a few more channels. I’d like a variation of the player module that could take a multichannel audio file and output all the channels. It could have a single poly out jack rather than needing separate jacks for each channel, which would avoid hard-coding a limited number of output jacks. I don’t think the module would need to handle more than one file, since I could use more than one instance of the module if needed. If it could handle FLAC and WAV that would be great. [N.B. For anyone interested, NYSTHI’s PolyRec/PolyRec64 save multichannel WAV files]

2 Likes

All great ideas… I really like the “one-file, poly-cable out” idea.

1 Like

My SFZ Player has a flac decoder. There may be license issues if you static link it… you are closed source, right?

I use dr_wav for wav loading and would use dr_flac for flac… Both are Public Domain

I use dr wav, but did not know about the other. Cool.

1 Like

oh, yeah, here’s the one I used. Seems it doesn’t have much restrictions either. perhaps I was thinking about libnsd.

### xiff flac codec ###

Copyright (C) 2000-2009  Josh Coalson
Copyright (C) 2011-2016  Xiph.Org Foundation

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:```
1 Like

Hi @PaulPiko your ideas have finally come to life. The latest version (2.1.2) adds the following:

  1. Folder selector remembers last folder.
  2. Load individual files
  3. Flac support
  4. Support multi-channel files (only first 16 channels)
  5. Single Poly-out port per track

I also made some subtle changes:

  1. Wider threading for resampling, one thread per channel
  2. Menu option to unload all files
  3. Takes up a bit less space (because single out-port)
  4. The oscilloscope-looking visualization had changed to a simpler vu-style

Hope you like it!

2 Likes

Oh nice! Sounds great. I look forward to giving it a run. Thanks for your work!

1 Like

Here is a video of why I made it, and an example of what it looks like in action at the end.

9 Likes

This is amazing!

I would find it useful if there was a phase input to locate the playhead. It’d also be nice to have the playback control inputs be polyphonic (corresponding to tracks 1-6)

Thanks for making it!

1 Like

Proper

1 Like

What are other good ways to make multitrack wav files? Could it load multiple mono files instead? I’d like to get several track applying back at once, and don’t really want to use one module for each (although that might be acceptable).

Stems can load multiple mono files. (6 of them) polyrecorder produces multi channel files.

1 Like

Yeah, I want to record some stuff in Reaper, then mangle it in VCV. Sounds like there are plenty of options, and mono wav might be the most versatile for me. tx.

1 Like