A Collection of Useful C++ Classes for Signal Processing

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

Post

cisdsp wrote:I haven't found out 'til now if there's a resume() in there :roll:
There has to be. Every plug-in needs a way to reset buffers when the playhead stops. If it's not called resume, it could be something like "reset".
cisdsp wrote: Can you give me maybe a hint how to delete the "new" stuff? I thought must not delete the object " filteredInput[0] = new double[nFrames];" - for example...
You should declare filteredInput[2] in the effect class itself as a member variable and then instantiate/allocate the array using new in the effect's constructor. Then you delete it in the effect's destructor like so:

Code: Select all

delete[] filteredInput[0];
delete[] filteredInput[1];
This ensures that it's allocated once and freed once, preventing memory leaks, and it persists for the life of the plug-in. In resume, you can check to see if the host has changed the maximum block size it will send you and then you can reallocate your arrays if you need to (i.e. you don't need to resize the arrays as long as they can contain the maximum block size). To reallocate you would just use a combination of delete, then new again.
Edit: you could actually just put all of the initialization/reallocation in resume as long as you check the right conditions.
cidsp wrote: I asked about implementations because of following situation:

I did a four Band Filter with HP and LP with the RBJ Filterclass. This was very easy and fast done. In the Process Block for example

Code: Select all

for(i = 0; ......) {
outLeft = HiPass->process(LowShelf->process(Peak1->process(Peak2->process(HiShelf->process(LowPass->process(inLeft))))));
}
Really easy to implement.

With Vinn's Classes it's a little different :shock:

I have to figure out how this works.
When you're using the processing function from thevinn's class, it takes a parameter for the block size to process (inFrames in your previous post) which is equal to the block size of processDoubleReplacing. In the example above, it appears as though your nested filters process one sample at a time. To do the same with the block processing in DSPFilters you would just call each filter's process with the block of audio in series.

Code: Select all

LowPass->process(inFrames, inLeft);
HiShelf->process(inFrames, inLeft);
Peak2->process(inFrames, inLeft);
...

Post

Thanks for your help! It's beyond price :)
Some people can feel the rain,while others are just wet.

Post

First of all, this is a great lib, and saved me a lot of time!!!

Now to my bug report, the demo throws an exception "!Dsp::is_nan....." with the values (easy to reconstruct)

RBJ Biquad - High Shelf
Fc = 5184 Hz
Gain = 13.6 dB
Slope = 4.000

Maybe there should lower boundaries for the values...

BTW i'm not a fan throwing exceptions, especially in dsp-code, but this is another discussion.

Something i would like to see, is that the number of channels is a normal constructor parameter, instead a template parameter, which makes it a little bit inflexible at run time.

But anyway, this is a great lib, thanks for making this open source and MIT licensed.





[/img]

Post

I have to correct me, it was just an debug assertion, not an exception..

Post

Is there somewhere a documentation about setting up Params in correct order for ChebyshevII like this:

Code: Select all

  //-- ChebyshevII Params --//
  
  Dsp::Params paramsCS_HS;  //HighShelf
  paramsCS_HS[0] = SR;
  paramsCS_HS[1] = mOrder;
  paramsCS_HS[2] = mFreqHS;
  paramsCS_HS[3] = mGainHS;
  paramsCS_HS[4] = 0.1; 
  
  Dsp::Params paramsCS_LS; //LowShelf
  paramsCS_LS[0] = SR;
  paramsCS_LS[1] = mOrder;
  paramsCS_LS[2] = mFreqLS;
  paramsCS_LS[3] = mGainLS;
  paramsCS_LS[4] = 0.1;      
  
  Dsp::Params paramsCS_BS; //BandShelf
  paramsCS_BS[0] = SR;
  paramsCS_BS[1] = mOrder;
  paramsCS_BS[2] = mFreqBS;
  paramsCS_BS[3] = mQBS;
  paramsCS_BS[4] = mGainBS; 
  paramsCS_BS[5] = 2;
  
  Dsp::Params paramsCS_LP; // LowPass
  paramsCS_LP[0] = SR;
  paramsCS_LP[1] = mOrder;
  paramsCS_LP[2] = mFreqLP;
  paramsCS_LP[3] = 2;

  
  
  Dsp::Params paramsCS_HP; //Highpass
  paramsCS_HP[0] = SR; 
  paramsCS_HP[1] = mOrder;
  paramsCS_HP[2] = mFreqHP;
  paramsCS_HP[3] = 2; 

Is that correct for the Chebyshev II ? My host crashes when I try to use tis filters.
Haven't found a documentation about setting up params for Chebyshev....
Some people can feel the rain,while others are just wet.

Post

Next Try:

Tried to use the filter in this way:

Code: Select all

   
//... 
//CS_LS.setup(int order, double sampleRate, double cutoffFrequency, double gainDb, double stopBandDb)

  CS_LS.setup(mOrder, SR, mFreqLS, mGainLS, mQLS);
//...

Problems: When Gain is set to 0, plugin crashes. My Value Ranges are:
* Order: 2
* SR: 44100
* Gain: -10 to +10
* Freq: 20 to 20000 Hz
* StopBand: 0.1 to 1

Can it be that there is an issue in Chebyshev Class(es)? It happens to Type I and else in Type II....
Some people can feel the rain,while others are just wet.

Post

CRASH REPORT:

Code: Select all

Application Specific Information:
Assertion failed: (!Dsp::is_nan (pole)), function add, file /Users/.../include/DspFilters/Layout.h, line 92.
In the Layout file is the assert function:

Code: Select all

    assert (!Dsp::is_nan (pole));
What can I do against the crashes?
Some people can feel the rain,while others are just wet.

Post

cisdsp wrote:CRASH REPORT etc.
What can I do against the crashes?
Can you program? Did you trace the code?

Post

The dsp classes are much too complex for me right now. So, yes, I'm able to program :) but I'm not a software engineer like you are maybe, if you meant this. So it's really hard to figure out all errors in DSP programming.

All I wanted to know is if there's someone out there with the same problems on chebyshev filters from this collection and had already fixed it.



Debug outputs:

Thread 9 com.apple.audio.IOThread.client

- Dsp::LayoutBase
- Dsp::LowPassTransform
- DSP::ChebyshevI::LowshelfBase:...

and so on.

I don't think that it's my fault from my small programming skills. 'Cause the errors are only with the Chebyshev Filters - especially in gainDB. If ganDB is set to 0db->crash!

All other filters work fine!
Some people can feel the rain,while others are just wet.

Post

Ok. It might of course be that these filters don't work with gain set to 0. You could easily bypass that, since it's the same as not filtering.

But, if you want to trace the root of your problem, you've got to give more details. Your "CS_LS" constructor is not in the DSPFilters archive that I have. So I assume you wrote it or got it from somewhere else. Try to trace what happens, and where "pole" is set to nan (which means: Not a Number, and is possibly the result of dividing by 0 or taking the logarithm of 0).

Post

I'm not wiser now. I traced the error back to the poles. Very strange, 'cause I think the poles are global used by the different filter classes. I have a look at this when got more time .

But another thing: what can be done against the "crackling" when changing the order on the fly? Happens mostly on lower frequencies...
Some people can feel the rain,while others are just wet.

Post

When the GUI changes, do the previous samples reset to zero or not?

{

If the previous samples do not reset to zero
Try resetting them

Else if the previous samples do reset to zero
Don't reset the values

}

Post

cisdsp wrote:I'm not wiser now. I traced the error back to the poles. Very strange, 'cause I think the poles are global used by the different filter classes. I have a look at this when got more time .

But another thing: what can be done against the "crackling" when changing the order on the fly? Happens mostly on lower frequencies...
It's hard to tell without looking at your code, but do you (re)use the same, possibly static, object that contains the poles?

The crackling is not so easy to fix. One option is interpolating between old and new settings in a short time (say 100ms). That requires running two filters in parallel for a short time, of course.

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.
Hey guys!

I'm having trouble working with the filters on Visual Studio 2012, I've been working with JUCE for about a month now - this is my first post here.

I'm trying to build the project in "users/Workspace/", but get a flood of errors like so:

Code: Select all (#)

\juceamalgam\juce_audio_basics_amalgam.cpp(730): error C3646: 'noexcept' : unknown override specifier
I'm probably doing something very wrong; can someone please help me get the demo working from scratch?

Thanks!

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.
insomniac wrote:Hey guys!

I'm having trouble working with the filters on Visual Studio 2012, I've been working with JUCE for about a month now - this is my first post here.

I'm trying to build the project in "users/Workspace/", but get a flood of errors like so:

Code: Select all (#)

\juceamalgam\juce_audio_basics_amalgam.cpp(730): error C3646: 'noexcept' : unknown override specifier
Got the demo working...

For anyone reading this after struggling with Visual Studio 2012, this is what helped me fix it.

1. Errors about macro's overriding: Use this bit of code

Code: Select all (#)

#if defined (_MSC_VER) && _MSC_VER > 1600
  #define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining)
#endif
2. LNK1104 link error for 'JuceAmalgam.lib'

Navigate to :
\DSPFilters\user\Workspaces\VisualStudio2010\dspfilterscpp-Output\Products\Win32Debug

Copy the object file you see there, and paste it here

\DSPFilters\shared\DSPFiltersDemo\Builds\VisualStudio2010\DSPFiltersDemo-Output\Products\Win32Debug

Post Reply

Return to “DSP and Plugin Development”