/// Get next sample of pink noise.
Get next sample of pink noise.
Get next sample of pink noise .
pub fn noise(&mut self) -> Signal {
        // Different functions for each sample.
        let r = match self.which {
            _x if _x % 2 != 0 => self.a(), // odd #s
            _x if _x % 4 != 0 => self.c(),
            _x if _x % 8 != 0 => self.d(),
            0 => {
                let mask = pnmask(self.pncnt).into();
                self.pncnt = self.pncnt.wrapping_add(1);
                self.f(mask)
            }
            8 => self.e(),
            _ => unreachable!(),
        } as f64
            / (std::i16::MAX as f64);
        self.which += 1;
        self.which %= 16;
        Signal::from(r)
    }
pub fn noise ( & mut self ) -> Signal { // Different functions for each sample. let r = match self . which { _x if _x % 2 != 0 => self . a ( ) , // odd #s _x if _x % 4 != 0 => self . c ( ) , _x if _x % 8 != 0 => self . d ( ) , 0 => { let mask = pnmask ( self . pncnt ) . into ( ) ; self . pncnt = self . pncnt . wrapping_add ( 1 ) ; self . f ( mask ) } 8 => self . e ( ) , _ => unreachable ! ( ) , } as f64 / ( std :: i16 :: MAX as f64 ) ; self . which += 1 ; self . which %= 16 ; Signal :: from ( r ) }
Get next sample of pink noise.
Get next sample of pink noise .
&mut self