[ANN] Infamous Plugins

Discuss anything new and newsworthy! See http://planet.linuxaudio.org and https://libreav.org/news for more Linux Audio News!

Announcements of proprietary software may fit better in the Marketplace.


Moderators: raboof, MattKingUSA, khz

ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

[ANN] Infamous Plugins

Post by ssj71 »

I've decided to stop spamming this board with every individual plugin, so I hope to just use this thread and bring it back up every time I've got a new plugin.

Now is such an time.
Announcing the infamous cheap distortion. Another distortion plugin, but this one I wanted to get as light as possible. I haven't benchmarked it, but using some hackery on the bits I accomplished a pretty nice saturation function waveshaper using only a bitshift and an integer add. Thats right not a single floating point operation! However this cheapness and hackery comes at a cost that its using undefined behavior and breaks some rules or at least is highly not reccommended due to portability (its pretty widely supported in reality). It works when compiled with GCC on x86 systems. Go ahead and try it, the worst that happens is that it sounds awful. On machines with different endianness it will fail for sure. If you experience this I can easily make one for the other endian machines. Just let me know. Becuase the goal was super cheap computation, there is no input or output gains, so make use of your simple amplifier plugins. All in all though it worked out better than I dreamed. And its so cheap. It even has 3 different waveshapes of increasing "aggression". On 2 & 3 settings, you'll probably want a gate, because it has really high gain for values near zero. I even got it to run without xruns on my puny intel atom machine.

Oh and I plotted the 3 waveshaping functions it employs just for fun:
Image

Get it from the master branch of the repo (download the snapshot the run the install.sh script):
http://sourceforge.net/p/infamousplugin ... ster/tree/
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: [ANN] Infamous Plugins

Post by j_e_f_f_g »

ssj71 wrote:infamous cheap distortion. not a single floating point operation!
Oh, this one could be useful to ARM users. And I like seeing more software with an emphasis on speed and low resource usage.

Keep them coming.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: [ANN] Infamous Plugins

Post by ssj71 »

oh rats. I forgot! This was done using lv2Create. It made it my easiest plugin yet!
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: [ANN] Infamous Plugins

Post by j_e_f_f_g »

Go back into the project, to the Save page, and check the "LADSPA" box. Click the Save button.

Go the Compile page and click both the X86_64 and i386 buttons. (you need the gcc-multiarch and g++-multiarch packages).

It will create both 32-bit and 64-bit plugins, in both LV2 and LADSPA formats (4 so files named so.x86_64, so.i386, ladspa.x86_64, and ladspa.i386). There will be a second "install_ladspa.sh" script to install the LADSPA version. The script takes care of installing the proper so (32 or 64) on the user's system. Just supply those 4 so files and the two .sh scripts, and users don;t need to compile. They just doubleclick the lv2 or ladspa script.
Last edited by j_e_f_f_g on Sat Sep 14, 2013 3:35 am, edited 1 time in total.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

User avatar
linuxdsp
Established Member
Posts: 147
Joined: Sun Mar 01, 2009 12:40 pm
Location: Oxford, England
Contact:

Re: [ANN] Infamous Plugins

Post by linuxdsp »

Thats right not a single floating point operation!
It does use floating point - it explicitly requires that the sample values are floats (and are processed as floats in the host) for your hack on the exponent and mantissa bit fields to actually work properly. Unless you know exactly what you are doing, and when it is appropriate to do so, this kind of "optimization" usually just subverts any optimization the compiler (and the hardware) could provide for you. The only situation in which this optimization would make any sense would be (ironically) on an architecture on which it wouldn't work anyway..
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: [ANN] Infamous Plugins

Post by j_e_f_f_g »

linuxdsp wrote:your hack on the exponent and mantissa bit fields
oh he's manipulating the float? I thought he was converting to int, and doing the distortion effect with int math.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

User avatar
linuxdsp
Established Member
Posts: 147
Joined: Sun Mar 01, 2009 12:40 pm
Location: Oxford, England
Contact:

Re: [ANN] Infamous Plugins

Post by linuxdsp »

oh he's manipulating the float?
Looked that way to me (only a quick look at the code) - in some cases this can provide optimizations above using conventional floating point math, but normally only in very specific cases (which should require detailed knowledge of the architecture and / or compiler). The main danger with these things in "generic" code is always that (even if they are commented with dire warnings etc) they can get picked up and used in other code ad hoc (often without proper appreciation of the technical issues). A lot of waveshaper algorithms can be better optimized with relatively simple (rearrangement of the) maths and in most cases something which is specifically designed as a waveshaper will need oversampling / upsampling too (which will be by far the greatest drain on CPU resources making this kind of optimization almost irrelevant in that case).
User avatar
dednikko
Established Member
Posts: 152
Joined: Mon Dec 03, 2012 7:47 am
Location: Dallas, TX
Contact:

Re: [ANN] Infamous Plugins

Post by dednikko »

I hope this isn't viewed as too lazy or newbish, but I've never had a good time understanding how to compile software. I'm not a developer, and have never been one.

For someone who is not immersed in developer language, I think the plugins page could be laid out, or commented in a way that will make it esier to understand what it is I am supposed to do.

It was roughly one year ago I began lamenting that I can only use the envelope follower in LMMS to create the reactive filtering that I use in my music. Unfortunately this is STILL the case, as I am apparently too obtuse to suss out the instructions for getting a functional x64 lv2 for Infamous Envelope Follower out of this.

I very much appreciate your efforts, and look forward to using these tools when I manage to figure out the steps necessary.

Just to make sure, I am not missing a compiled lv2 somewhere on those pages, am I? Or perhaps in the KXStudio repos?
Think like a gun.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: [ANN] Infamous Plugins

Post by ssj71 »

dednikko wrote:It was roughly one year ago I began lamenting that I can only use the envelope follower in LMMS to create the reactive filtering that I use in my music. Unfortunately this is STILL the case, as I am apparently too obtuse to suss out the instructions for getting a functional x64 lv2 for Infamous Envelope Follower out of this.

I very much appreciate your efforts, and look forward to using these tools when I manage to figure out the steps necessary.

Just to make sure, I am not missing a compiled lv2 somewhere on those pages, am I? Or perhaps in the KXStudio repos?
Sorry dednikko, there are users of all levels here (as it should be) and I often assume everyone is comfortable with using the terminal (which is a bad assumption). Falk has packaging this on his todo list, but I have no idea when he'll get to it. To install you just need to download and extract the tarball (if you don't care about the distortion go to the downloads section on my sourceforge project, otherwise click the button in the code section that says "Download snapshot." This will download a tarball which you must extract (use file-roller or whatever tool of choice). Navigate a terminal to that folder. Using thunar you can just right click the folder and select open a terminal here. Otherwise just start a terminal and use

Code: Select all

cd Directory/that_it_downloaded_to/infamous_plugins-codeblabla
to get there. From there you only need to run the install script using

Code: Select all

./install.sh
. If you have qmake and the lv2-dev headers it should compile just fine and install into your lv2 directory. Come back and let me know if you have any issues. I'll help as much as I can.

linuxdsp wrote:Looked that way to me (only a quick look at the code) - in some cases this can provide optimizations above using conventional floating point math, but normally only in very specific cases (which should require detailed knowledge of the architecture and / or compiler). The main danger with these things in "generic" code is always that (even if they are commented with dire warnings etc) they can get picked up and used in other code ad hoc (often without proper appreciation of the technical issues). A lot of waveshaper algorithms can be better optimized with relatively simple (rearrangement of the) maths and in most cases something which is specifically designed as a waveshaper will need oversampling / upsampling too (which will be by far the greatest drain on CPU resources making this kind of optimization almost irrelevant in that case).
Yes, I'm manipulating the float through type punning. So the only float operations are the assign to a union and to the output, the other operations are integer manipulations. Heck, here it is straight from the source:

Code: Select all

//this bitfield punning buisness is bad form and you're a bad developer for
//even looking at code like this. But it works with gcc on x86 so I did it.
typedef union
{
  float f;
  struct
  {
    union val
    {
      uint32_t num : 31;
      struct ieee
      {
        uint32_t significand : 23;
        uint32_t exponent : 8;
      } ieee754;
    } value;
    uint32_t sign : 1;
  } parts;
}float_dissector; 
...

void pluginRun(CHEAP_DISTORTION * plugin)
{
  float_dissector f;
  uint8_t index = (uint8_t)*plugin->Host.In[LV2_AGGRESSION];
  while (plugin->Host.Begin < plugin->Host.End)
  {
    f.f = *(plugin->Host.AudioIn[0] + plugin->Host.Begin);
    f.parts.value.num = (f.parts.value.num)>>index;
    f.parts.value.ieee754.exponent += plugin->scale[index];
    *(plugin->Host.AudioOut[0] + plugin->Host.Begin) = f.f;
    ++plugin->Host.Begin;
  }
} 
I meant the math isn't done using the fpu. I ought to look at the dissasembly. So its very architecture dependent, assuming the ieee754 implementation and endianness and everything is the same. My install script at least uses gcc, reducing the risk of other compilers being used but I understand someone might pull the code out and try to use it elsewhere, and with other architectures all bets are off. I mostly did it out of curiosity and personal desire. If its preferred by the community I can keep it in the devel branch and never include it in the releases (I prefer not to distribute binaries for something like this anyway). It has some artifacts because of the lack of oversampling or anything, but I like to think it gives it character.

Besides, I never said whether it was cheap for the processor time or just the quality of the plugin ;) I suppose this will cast a dark light on my project. Its already infamous.... just give the word I'll take it out of master if you think it best.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
User avatar
dednikko
Established Member
Posts: 152
Joined: Mon Dec 03, 2012 7:47 am
Location: Dallas, TX
Contact:

Re: [ANN] Infamous Plugins

Post by dednikko »

Still no luck compiling. I tried and got errors =(

It seems that some of the dependencies are out of date on my end.

I suppose that's what I get for using DreamStudio and not KXStudio?

I have been planning on checking out KXStudio once 12.04.3 is final, so I probably won't have to worry about that much longer!
Think like a gun.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: [ANN] Infamous Plugins

Post by ssj71 »

well, if you want to just switch distros thats fine. Are you on 32 bit or 64 bit? If you want to try to solve it on your current system copy the output from the terminal when you run the install script (highlight it, right click and select copy in the context menu). I'm sad its not working for you. Thanks for being patient!
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
male
Established Member
Posts: 232
Joined: Tue May 22, 2012 5:45 pm

Re: [ANN] Infamous Plugins

Post by male »

I'd just like to point out the fallacy in assuming that integer is faster than floating point. Without proof, you have nothing. But just as food for thought, which SSE instruction can you use to vectorize integer processing?

Some compromises are worth making, but I've never had any problems with a distortion plugin overloading my CPU ;-) Start from the sound you want, then optimize. Or if you just like the weird sound you get from doing random things (it's not the first distortion plugins use such a technique), that's fine, but don't go around advertising it as being higher performance unless it actually is in some meaningful way.
Image
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: [ANN] Infamous Plugins

Post by ssj71 »

fair enough. Again, it was mostly done with the goal of not performing floating point operations, mostly because I had been unsuccessful in getting guitarix running on my atom machine with acceptable latency. I imagine other distortion plugins would work and sound better on the system, but I grew curious about how to get a mildly decent saturation function by performing bitwise operations on the float representation. So it wasn't really a big performance goal, just a pet project. Had it been so I would have done benchmarking. But I got all excited and started making unwarranted performance claims. Apologies.

Anyhow, it seems there is little interest in this plugin, so I'm removing it from the repository. I'm leaving hip2b as I feel it gives a significantly different sound from the other plugins I've heard.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
tramp
Established Member
Posts: 2348
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 468 times

Re: [ANN] Infamous Plugins

Post by tramp »

ssj71 wrote:Again, it was mostly done with the goal of not performing floating point operations, mostly because I had been unsuccessful in getting guitarix running on my atom machine with acceptable latency.
You may contact the guitarix devs for some hints.There are a couple of optimizations possible in the source and during compilation which will reduce the CPU usage drastically. :wink:
On the road again.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: [ANN] Infamous Plugins

Post by ssj71 »

I'll look into that. Thanks tramp.

Also in my own defense, I find it unlikely that a bitshift and add isn't faster than the equivalent square/quartic/octal root that the operation approximates. These floating operations would be required to get the same shape that the integer operations create without the type punning. So its not that the operations are done in integer representation, more that they're approximating a traditionally computationally intense function. SO of course I was excited when it worked so well for me. [/rant]

That being said I reaffirm that I am in no position to make performance claims. :D
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
Post Reply