// Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
// If Buffer is nil this method will panic.
513545
func (bw PVBrickWall) Rate(rate int8) Input {
	CheckRate(rate)
	if bw.Buffer == nil {
		panic("PVBrickWall requires a Buffer parameter")
	}
	(&bw).defaults()
	return NewInput("PV_BrickWall", rate, 0, 1, bw.Buffer, bw.Wipe)
}
274146
func (fft FFT) Rate(rate int8) Input {
	CheckRate(rate)
	if fft.Buffer == nil {
		panic("FFT expects Buffer to not be nil")
	}
	if fft.In == nil {
		panic("FFT expects In to not be nil")
	}
	(&fft).defaults()
	return NewInput("FFT", rate, 0, 1, fft.Buffer, fft.In, fft.Hop, fft.WinType, fft.Active, fft.WinSize)
}
949715
func (o OneZero) Rate(rate int8) Input {
	CheckRate(rate)
	(&o).defaults()
	return NewInput("OneZero", rate, 0, 1, o.In, o.Coeff)
}
390276
func (gv GVerb) Rate(rate int8) Input {
	CheckRate(rate)
	if gv.In == nil {
		panic("GVerb expects In to not be nil")
	}
	(&gv).defaults()
	return NewInput("GVerb", rate, 0, 2, gv.In, gv.RoomSize, gv.RevTime, gv.Damping, gv.InputBW, gv.Spread, gv.DryLevel, gv.EarlyRefLevel, gv.TailLevel, gv.MaxRoomSize)
}
841906
func (s Slew) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("Slew", rate, 0, 1, s.In, s.Up, s.Dn)
}
534006
func (pan PanB2) Rate(rate int8) Input {
	CheckRate(rate)
	if pan.In == nil {
		panic("PanB2 requires an input")
	}
	(&pan).defaults()
	return NewInput("PanB2", rate, 0, 3, pan.In, pan.Azimuth, pan.Gain)

}
1275880
func (l Lag) Rate(rate int8) Input {
	CheckRate(rate)
	if l.In == nil {
		panic("Lag requires an input signal")
	}
	return NewInput("Lag", rate, 0, 1, l.In, l.LagTime)
}
462907
func (out OffsetOut) Rate(rate int8) Input {
	CheckRate(rate)
	return NewInput("OffsetOut", rate, 0, 1, out.Bus, out.Channels)
}
933908
func (g Gendy1) Rate(rate int8) Input {
	CheckRate(rate)
	g.rate = rate
	(&g).defaults()
	return NewInput("Gendy1", rate, 0, 1, g.AmpDist, g.DurDist, g.ADParam, g.DDParam, g.MinFreq, g.MaxFreq, g.AmpScale, g.DurScale, g.InitCPs, g.KNum)
}
1156516
func (formlet Formlet) Rate(rate int8) Input {
	CheckRate(rate)
	if formlet.In == nil {
		panic("Formlet expects In to not be nil")
	}
	(&formlet).defaults()
	return NewInput("Formlet", rate, 0, 1, formlet.In, formlet.Freq, formlet.AttackTime, formlet.DecayTime)
}
620136
func (l Latch) Rate(rate int8) Input {
	CheckRate(rate)
	if l.In == nil {
		panic("Latch requires an input signal")
	}
	if l.Trig == nil {
		panic("Latch requires an trig signal")
	}
	return NewInput("Latch", rate, 0, 1, l.In, l.Trig)
}
645625
func (impulse Impulse) Rate(rate int8) Input {
	CheckRate(rate)
	(&impulse).defaults()
	return NewInput("Impulse", rate, 0, 1, impulse.Freq, impulse.Phase)
}
238944
func (wrp Warp1) Rate(rate int8) Input {
	CheckRate(rate)
	(&wrp).defaults()
	return NewInput("Warp1", rate, 0, wrp.NumChannels, wrp.BufNum, wrp.Pointer, wrp.FreqScale, wrp.WindowSize, wrp.EnvBufNum, wrp.Overlaps, wrp.WindowRandRatio, wrp.Interp)
}
992342
func (pan PanAz) Rate(rate int8) Input {
	CheckRate(rate)
	if pan.In == nil {
		panic("PanAz requires an input")
	}
	(&pan).defaults()
	return NewInput("PanAz", rate, 0, pan.NumChans, pan.In, pan.Pos, pan.Level, pan.Width, pan.Orientation)

}
405646
func (s *Sample) Rate() int64 {
	return int64(float64(s.JobMsgCnt) / s.Duration().Seconds())
}
926122
func (lfsaw LFSaw) Rate(rate int8) Input {
	CheckRate(rate)
	(&lfsaw).defaults()
	return NewInput("LFSaw", rate, 0, 1, lfsaw.Freq, lfsaw.Iphase)
}
720532
func (g GrainSin) Rate(rate int8) Input {
	CheckRate(rate)
	(&g).defaults()

	in := NewInput("GrainSin", rate, 0, 1, g.Trigger, g.Dur, g.Freq, g.Pan, g.EnvBuf, g.MaxGrains)
	if g.NumChannels == 1 {
		return in
	}
	mult := make([]Input, g.NumChannels)
	for i := range mult {
		mult[i] = in
	}
	return Multi(mult...)
}