Gamma DSP C++ library

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Making a thread for discussing about this library.
http://mat.ucsb.edu/gamma/ (note: I'm not the creator).

Post

---Problem---

Need a way to sort the the produced DFT frame (consisting of gam::Complex<float>) based on the FREQ-part in MAG_FREQ mode.

The doc speaks only about operator < having been defined for the gam::Complex<float>. Doing std::sort(frame.begin(), frame.end(), predicate()) with the predicate

Code: Select all

struct predicate
{
    bool operator()(const gam::Complex<float> &left, const gam::Complex<float> &right) {
        return left[1] < right[1];
    }
}
Does not do anything.
Last edited by soundmodel on Tue Aug 11, 2015 10:09 am, edited 1 time in total.

Post

What do you mean by doesn't do anything? (if there is an issue, it has nothing to do with the library BTW.)

Post

It does not change the relationships that I'm seeing by plotting the MAGs over FREQs, which I thought would fix by sorting. I haven't tested the sort code, but I guess it should work.

This however would mean that the boxy plot problem described here:
http://www.kvraudio.com/forum/viewtopic ... 3&t=444106

is caused by something else than the ordering of the FREQs.

Post

You should first check if the data is sorted int he first place... Just make a dump with std::cout to see if the data is sorted or not.

Post

Miles1981 wrote:You should first check if the data is sorted int he first place... Just make a dump with std::cout to see if the data is sorted or not.
How can I make a dump from a VST plug-in that's ran in a VST Host?

Post

Open a file and write to it (which is also one of the reasons I first develop my codes in standalone applications in Python...).

Post

So I found out that the FREQs are ordered. So the boxy plot problem is not about the order.

Likely then about the rapidly changing frequencies between windows.

What I'm not sure about is why I'm seeing any freq value repeating four times in the output before changing to another freq. That is, every adjacent 4 bins have the same frequency value, except for the first and last bins. That's what the bins have, so it's Gamma's algorithm that does it that way.

The different frequencies seem to be spaced evenly apart as well. What's the algorithm actually doing? It reminds me of a graphical EQ style of "computation" (combining bins).

Maybe the boxy plot was actually caused by these repeating frequencies?

Post

I'm trying to see the MAGs the DFT produces in MAG_FREQ mode, but can't seem to be able to. I'm writing them to a file and I can see the FREQs, which are at the index [1] of the bins, but printing index [0] (the MAG of the bin) prints the null value of float for every index.

I can plot the MAGs correctly, but just can't print them (using the same exact values that are used for plotting as well).

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
MAG_FREQ mode computes frequency estimates based on per-bin phase differences between frames (see http://blogs.zynaptiq.com/bernsee/pitch ... ng-the-ft/ (http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/)). Thus, any repeating patterns of frequencies will be due to the STFT settings, like hop size and window type, and the arrangement of partials in the input signal.

You may want to try only plotting at the peaks. Peaks can be found with gam::arr::maxima:

template <class Index, class T>
unsigned maxima(Index * dst, const T * src, unsigned len, unsigned str=1);

So to get the peaks, you would do something like:

unsigned peakIndices[N];
unsigned numPeaks = gam::arr::maxima(peakIndices, &stft.bin(0)[0], stft.numBins(), 2);

Post

Anyone happen to use Gamma with Xcode?

I'm having a trouble of seemingly getting only 0s out of the STFT, regardless of what I input in it.

The same exact code works on Windows and Visual Studio, but not on Xcode.

Post

Fluky wrote:Anyone happen to use Gamma with Xcode?

I'm having a trouble of seemingly getting only 0s out of the STFT, regardless of what I input in it.

The same exact code works on Windows and Visual Studio, but not on Xcode.
Yep! We use it as part of our plug-ins. Lance (ljputnam above) is the lead developer and was part of our graduate department.

We haven't had cross-platform issues with any of our FFT-based plug-ins. We're not on the latest commit at the moment though. Try using this commit on the devel branch, which is what we're using on our latest release:
https://github.com/LancePutnam/Gamma/co ... 8c833c0fe4

Post

I am trying to use the library, but I can only get output sound form the Audio Interface using the "AudioIOData" as in the examples.
How am I supposed to simply get the samples and rout them to my application instead of the standard audio interface?
Is there any totorial about embadding gamma in another app?

Post

How am I supposed to simply get the samples and rout them to my application instead of the standard audio interface?
Is there any totorial about embadding gamma in another app?
From http://w2.mat.ucsb.edu/gamma/dl/gammaTutorial.0.9.5.pdf

Code: Select all

Gen g;          // define a new generator
g.freq(100);    // set its frequency parameter
g.phase(0.25);  // set its phase parameter
float
v;
v = g();        // generate first sample
v = g();        // generate second sample
looks more than adequate to me
~stratum~

Post

"How can I make a dump from a VST plug-in that's ran in a VST Host?"
Use OutputDebugString and read the output with DebugView

Post Reply

Return to “DSP and Plugin Development”