This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
extending_the_effects_engine_report_w11 [2014/08/03 18:21] badescunicu |
extending_the_effects_engine_report_w11 [2014/08/03 18:25] (current) badescunicu |
||
---|---|---|---|
Line 5: | Line 5: | ||
As a side task I implemented a 10 band Master Graphic Equalizer. The work can be broken down on two parts: | As a side task I implemented a 10 band Master Graphic Equalizer. The work can be broken down on two parts: | ||
- | * Create a new effect which features 10 bandpass static filters. Their frequency is set up when they are created. Biquad Bandpass filters generated with ''fidlib'' are used inside this effect. This new type of filters is based on Daniel's IIR filters refactoring[1]. | + | * Create a new effect which features 10 bandpass static filters. Their frequency is set up when they are created. Biquad Bandpass filters generated with ''fidlib'' are used for this effect. This new type of filters is based on Daniel's IIR filters refactoring[1]. |
* Create sliders in preferences which control the newly created effect's parameters. | * Create sliders in preferences which control the newly created effect's parameters. | ||
Line 24: | Line 24: | ||
I have some good news about the kn0ck0out LV2 plugin. As you know from my ninth report, it was not working as it should have, it was only playing silence. So I contacted its maintainer, Jeremy Salwen. He was kind enough to take a look on the code and found out that the output of an integer division was used instead of a floating point one. Here[2] you can check out the commit. I'm flattered he mentioned my name in the commit message. | I have some good news about the kn0ck0out LV2 plugin. As you know from my ninth report, it was not working as it should have, it was only playing silence. So I contacted its maintainer, Jeremy Salwen. He was kind enough to take a look on the code and found out that the output of an integer division was used instead of a floating point one. Here[2] you can check out the commit. I'm flattered he mentioned my name in the commit message. | ||
- | I continued my work on LV2 support by adding support for enumeration and button parameters. They are based on a multi state button (2 in case of a //toggle// parameter, more than 2 in case of an //enumeration// parameter). The main thing this type of parameters needed was for their underlying value to go back to the minimum if the maximum was excedeed. This[3] commit implements that behaviour. Working on this I got a "strange" C++ error which cause was using a getter method on a const object. All I had to do was make the getter const, because only const methods can be called on const objects. This makes sense because otherwise a non const method might attempt to modify the const object. | + | I continued my work on LV2 support by adding enumeration and button parameters. They are based on a multi state button (two in case of a //toggle// parameter, more than two in case of an //enumeration// parameter). The main thing this type of parameters needed was for their underlying value to go back to the minimum if the maximum was exceeded. This[3] commit implements that behaviour. Working on this I got a "strange" C++ error which cause was using a getter method on a const object. All I had to do was make the getter const, because only const methods can be called on const objects. This makes sense because otherwise a non const method might attempt to modify the const object. |
After testing some LV2 plugins and their enumeration parameters, I was not pleased to realize Mixxx crashes chaotically when changing effects. What made this bug hard was that I got different errors each time I ran Mixxx and using debug mode did not help me very much. I found out that the bug disappears if I remove the code responsible for updating lv2 parameters: ''params[i] = m_parameters[i]->value().toFloat()''. ''params'' is a dynamically allocated float array which is connected to lv2 plugin instance's ports. The problem was that I allocated memory only for //manifest.parameters.size()// and forgot to take into account //manifest.buttonParametrs.size()//. C++ does not perform boundary checking. Thus, sometimes the code even worked, maybe because the memory area right next to //params// was not accessed by someone else. This bug taught me to be more careful when allocating resources in C++. | After testing some LV2 plugins and their enumeration parameters, I was not pleased to realize Mixxx crashes chaotically when changing effects. What made this bug hard was that I got different errors each time I ran Mixxx and using debug mode did not help me very much. I found out that the bug disappears if I remove the code responsible for updating lv2 parameters: ''params[i] = m_parameters[i]->value().toFloat()''. ''params'' is a dynamically allocated float array which is connected to lv2 plugin instance's ports. The problem was that I allocated memory only for //manifest.parameters.size()// and forgot to take into account //manifest.buttonParametrs.size()//. C++ does not perform boundary checking. Thus, sometimes the code even worked, maybe because the memory area right next to //params// was not accessed by someone else. This bug taught me to be more careful when allocating resources in C++. |