preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: martindunne on August 01, 2014, 01:50:41 PM

Title: More Effects
Post by: martindunne on August 01, 2014, 01:50:41 PM
XH : Used to be in http://ixox.fr/forum/index.php?topic=63438.0
---------------------------------

is it possible to grab a copy of your os to try it out?
Title: Re: More Effects
Post by: matrix12x on August 02, 2014, 12:27:19 AM
I posted it on gihub as a branch off the original, which I believe I did correctly. you can just download and compile.

or pm me with your e-mail and I'll send you the compiled os file.
Title: Re: More Effects
Post by: martindunne on August 02, 2014, 04:51:05 PM
brilliant, will do
Title: Re: More Effects
Post by: martindunne on August 03, 2014, 12:33:59 PM
awsome bit crusher great for sound design
Title: Re: More Effects
Post by: matrix12x on August 05, 2014, 07:42:59 PM
Thanks. I am still playing around and am not sure I have it quite right. But it does sound cool.
Title: Re: More Effects
Post by: Xavier on August 06, 2014, 11:51:49 AM

A bit crusher ?
Do you have such a effect working ?
Cannot see anything like this in you fork:
https://github.com/matrix12x/preenFM2

By the way this branch is based on an old firmware/bootloader (0.9i / 1.02).

Xavier
Title: Re: More Effects
Post by: martindunne on August 06, 2014, 01:16:01 PM
have a copy of the compiled os if you want to take a look at it
Title: Re: More Effects
Post by: matrix12x on August 06, 2014, 11:46:13 PM
Hi Xavier,
I did not post it yet because it was not quite done yet and sounded a little crazy, but still interesting.

I can post it if you would like.
Title: Re: More Effects
Post by: matrix12x on August 07, 2014, 01:16:39 AM
Please note, I did not get the "bits" knob working yet, only the "frequency" knob. Please excuse the randomness of my coding, I was trying to implement different versions of the bit crunchers that were on the music DSP site. Based on my variable names, you can find the version of the code that I plucked bits and pieces from. When I clean it up i will add proper attribution to the comments in the code.

Basically I did this sloppy mess, with the proper adjustments to the other files to add the menu items:

In the file named Timber.cpp

   case FILTER_BIT:
    {

       float *sp = this->sampleBlock;
       float localv0L = v0L;
       float localv1L = v1L;
       float localv0R = v0R;

   float phasor=0;
       float BitsTwo = params.effect.param1;
   int bits=BitsTwo;
        float step;
       float Frq = params.effect.param2 * PREENFM_FREQUENCY;
       float SR = PREENFM_FREQUENCY;
   float NormFreq = Frq / SR;

       for (int k=0 ; k<BLOCK_SIZE ; k++) {
      if (unlikely(fxParam1 = 0)) {
          fxParam1 = 0.01;
       }

      step = 1 / (pow(2.0, bits));
// left side

          localv0L = (*sp) + localv0L;

      phasor = phasor + NormFreq;
             if (phasor >= 1.0){
         phasor = phasor - 1.0;   
              localv0L = step * floor(localv0L / step + 0.5 ); //quantize
                localv0L = localv0L * fxParam3;
      }

      (*sp) = ((*sp) + localv0L) * mixerGain;


          if (unlikely(*sp > ratioTimbres)) {
             *sp = ratioTimbres;
          }
          if (unlikely(*sp < -ratioTimbres)) {
             *sp = -ratioTimbres;
          }


          sp++;    


Title: Re: More Effects
Post by: Xavier on August 07, 2014, 10:49:20 AM

Great, thank you  :D
I'll take a look....
Title: Re: More Effects
Post by: teevee on August 07, 2014, 10:54:12 AM
Bitcrusher?
This would give PreenFM 2 a option for sounding very nasty and harsh!

It would be cool to see more effects :D
•   Example a Ensemble effect. I think that FM and Ensemble would make a interesting Stringer because FM synthesis has more timbral variations, than the typical Stringer with sawtooth.
Title: Re: More Effects
Post by: pld on August 07, 2014, 12:33:42 PM
Cool, my attempt at bitcrushing was a total failure ;)

Unfortunately I've been bogged down with work so I haven't had time, but I started implementing a delay to see what the performance impact is like (and as an excuse to practice ARM assembler). There's not too much RAM, but IIRC chorus/flanger type stuff doesn't need long delay times anyway.
Hopefully I can get back to that soon...
Title: Re: More Effects
Post by: teevee on August 07, 2014, 02:38:33 PM
Cool, my attempt at bitcrushing was a total failure ;)

Unfortunately I've been bogged down with work so I haven't had time, but I started implementing a delay to see what the performance impact is like (and as an excuse to practice ARM assembler). There's not too much RAM, but IIRC chorus/flanger type stuff doesn't need long delay times anyway.
Hopefully I can get back to that soon...

Hello pld,
Thanks for the info, would be interesting to see your result of Chorus/flanger :)

TeeVee
Title: Re: More Effects
Post by: matrix12x on August 10, 2014, 05:00:28 AM
I updated my code slightly to simplify it.
the bits part does not work still. Frequency has some holes in it for some reason. at 0.5 it has zero effect, and at some small values we get silence.

       float *sp = this->sampleBlock;
       float localv0L = v0L;
       float localv0R = v0R;

   float phasor=0;
       float bits = floor( (params.effect.param1 * 16));   // bits encoder
   if (bits = 0){
      bits = 1;
   }

       float Frq = params.effect.param2 * PREENFM_FREQUENCY / 2; // frequency encoder
       float SR = PREENFM_FREQUENCY;
   float NormFreq = Frq / SR;
   float step;
   step = 1 / pow(2,bits);

       for (int k=0 ; k<BLOCK_SIZE ; k++) {

// left side
          localv0L = (*sp) + localv0L;

      phasor = phasor + NormFreq;
             if (phasor >= 1.0){
         phasor = phasor - 1.0;   
              localv0L = step * floor(localv0L / step + 0.5 ); //quantize
                localv0L = localv0L * fxParam3;  // gain encoder
      }

      (*sp) = ((*sp) + localv0L) * mixerGain;

          if (unlikely(*sp > ratioTimbres)) {
             *sp = ratioTimbres;
          }
          if (unlikely(*sp < -ratioTimbres)) {
             *sp = -ratioTimbres;
          }

          sp++;
Title: Re: More Effects
Post by: Xavier on August 10, 2014, 02:55:56 PM

Thanks for sharing.
Seems like it comes from http://www.musicdsp.org/archive.php?classid=4#139
I'll give a try.

Xavier
Title: Re: More Effects
Post by: matrix12x on August 10, 2014, 05:01:06 PM
Hi Xavier,
Exactly.

would it be possible to shift the bits by doing a x >> y? where x shifted y bits to right
Title: Re: More Effects
Post by: Xavier on August 10, 2014, 05:36:13 PM
No that only works with integer.
And the buffer is still in floating in the effect processing.

But i think i have something that works...
Will share soon.

Xavier
Title: Re: More Effects
Post by: matrix12x on August 11, 2014, 03:56:47 AM
The new effects are cool. I like your bit crusher much better.