Exemple #1
0
func (s *seq) Set(pos string, index int) supergollider.Pattern {
	if index < 0 {
		panic("index < 0 not allowed")
	}
	if len(s.Scales)-1 <= index {
		panic("index larger than len(Scales)-1")
	}
	return supergollider.Exec(pos, func() { s.current = index })
}
Exemple #2
0
func (s *seq) Next(pos string) supergollider.Pattern {
	return supergollider.Exec(pos, func() {
		if len(s.Scales)-1 <= s.current {
			s.current = 0
			return
		}
		s.current++
	})
}