(self, args)
Generate a noise (NOISE statement).
Generate a noise (NOISE statement).
Generate a noise ( NOISE statement ) .
def noise_(self, args):
        """Generate a noise (NOISE statement)."""
        if not self._sound_on:
            raise error.BASICError(error.IFC)
        source = values.to_int(next(args))
        error.range_check(0, 7, source)
        volume = values.to_int(next(args))
        error.range_check(0, 15, volume)
        dur = values.to_single(next(args)).to_value()
        error.range_check(-65535, 65535, dur)
        list(args)
        # calculate duration in seconds
        dur_sec = dur / TICK_LENGTH
        # loop if duration less than 1/44 == 0.02272727248
        self.emit_noise(source, volume, dur_sec, loop=(dur < LOOP_THRESHOLD))
        # noise is always background
        self._wait_background()
def noise_ ( self , args ) : if not self . _sound_on : raise error . BASICError ( error . IFC ) source = values . to_int ( next ( args ) ) error . range_check ( 0 , 7 , source ) volume = values . to_int ( next ( args ) ) error . range_check ( 0 , 15 , volume ) dur = values . to_single ( next ( args ) ) . to_value ( ) error . range_check ( - 65535 , 65535 , dur ) list ( args ) # calculate duration in seconds dur_sec = dur / TICK_LENGTH # loop if duration less than 1/44 == 0.02272727248 self . emit_noise ( source , volume , dur_sec , loop = ( dur < LOOP_THRESHOLD ) ) # noise is always background self . _wait_background ( )