extends Spatial

var main = load("res://mirrors/main.tscn")
var sub = load("res://mirrors/osc.tscn")

func _ready():
	# 'main' at center.
	var m = main.instance()
	add_child(m)
	m.set_size(rand_range(0.1, 2))
	m.audible_range_max = 80
	m.set_preset(randi()%12 + 1)
	m.set_gain(40)

	# many 'sub' surrounds 'main' like satellites
	for i in range(25):
		var s = sub.instance()
		add_child(s)
		s.set_preset(wrapi(i, 6, 23)) # get 6 ... 23
		s.set_size(rand_range(0.1, 1.2))
		s.set_color(Color.blue)
		var d = polar2cartesian(rand_range(1, 10), rand_range(0, PI))
		s.translate(Vector3(d.x, rand_range(-5, 5), d.y))
		s.set_freq(rand_range(1, 100))
		s.set_gain(0.3)
