destortion plugin

Got a great idea for the future of LMMS? Post it here.
Forum rules

Make sure to search to see if your idea has been posted before! Check our issue tracker as well, just to make sure you are not posting a duplicate: https://github.com/LMMS/lmms/issues

https://ru.wikipedia.org/wiki/%D0%94%D0 ... 1%88%D0%BD

listen
https://yadi.sk/d/zqzgX73iStnRNA

programm
https://djdnkey.blogspot.com/2018/11/am ... decay.html

java source

Code: Select all

for(int i = 1;i < data.length;i++){
          //destortion
           if(data[i] > 0){
               
               if(data[i] > (127 - (byte)Main.slider)){
                  
                   dataTemp[i] = (byte) ((byte)127 - (byte) Main.slider);
                   
              //     System.out.println("after data[i]: " + data[i]);

               }
               
           }
           
           if(data[i] < 0){
               if(data[i] < (-127 + (byte)Main.slider)){
                   dataTemp[i] = (byte) (-127 + (byte)Main.slider);
               }
           }
           
           
           // System.out.println("slider " + Main.slider);
           
           
          // data[i] = data[i];
       }
        
        if(frame.reberbSelected){
            
            int delaySamples      = (int)((float)frame.delay * 44.1f); // assumes 44100 Hz sample rate
            for (int i = 0; i < data.length - delaySamples; i++){
                // WARNING: overflow potential
                dataTemp[i + delaySamples] += (short)((float)data[i] * frame.decay);
            }
        }
        
        if(frame.amplitudeDecay){
            
            //частота изменения амплитуды
            
            int frequency = data.length / frame.decayFrequency;
            
            //текущее значения инкремента k если k = frequency значит делаем изменение амплитуды обнулямем к и считаем заново
            int k = 0;
            
            //текущий щаг изменения амплитуды
            int steps = 0;
            
            //на сколько изменить амплитуду c каждым шагом 127.
            
            byte amplitudeChange = (byte)(127/frame.decayFrequency);
            
            int distortion       = 127;
            

            for (int i = 0; i < data.length; i++){
                // WARNING: overflow potential
               // dataTemp[i] += (short)((float)data[i] * frame.decay);
                k++;
                if(frequency == k){
                    
                   

                   k = 0;
                   steps++;
                   distortion = distortion - amplitudeChange;
                   
                   
                   System.out.println("distortion "  + dataTemp[i]);
               }
                
               if(data[i] > 0){

                    if(data[i] > (127 - (byte)distortion)){

                         dataTemp[i] = (byte) ((byte)127 - (byte) distortion);

                    }

               }

               if(data[i] < 0){
                    if(data[i] < (-127 + (byte)distortion)){
                          dataTemp[i] = (byte) (-127 + (byte)distortion);
                    }
               }
            }
        }

concept:
mixed two sounds:
1 clear
2 distortion

can you make this plugin in lmms?
padaboo wrote:
Thu Jan 03, 2019 1:45 pm
concept: ....
can you make this plugin in lmms?
I think LMMS wave-shaper does a similar job, but i will move this to suggestions

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 131 on Sat Dec 10, 2016 3:47 pm

Users browsing this forum: No registered users and 4 guests