extends Spatial

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

func _ready():
	# 'main' at center.
	var m = main.instance()
	add_child(m)
	m.set_size(rand_range(10, 15))
	m.audible_range_max = 80
	m.set_freq(rand_range(100, 300))
	m.set_gain(40)

	# many 'sub' surrounds 'main' like satellites
	for i in range(18):
		var s = sub.instance()
		add_child(s)
		s.set_size(rand_range(0.2, 1.2))
		s.set_color(Color.black)
		var d = polar2cartesian(rand_range(20, 24), rand_range(0, 2*PI))
		s.translate(Vector3(d.x, rand_range(-2, 2), d.y))
		s.set_freq(rand_range(200, 2000))
		s.set_gain(0.1)
