-
Notifications
You must be signed in to change notification settings - Fork 0
/
audiosync_player.gd
50 lines (36 loc) · 1.72 KB
/
audiosync_player.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class_name AudioSyncPlayer extends AudioStreamPlayer
func _on_bass_toggled(toggled) -> void:
var synchrostream : AudioStreamSynchronized = stream as AudioStreamSynchronized
var tween : Tween = create_tween()
if !toggled:
tween.tween_property(synchrostream, "stream_0/volume", 0.0, 3.0)
else:
tween.tween_property(synchrostream, "stream_0/volume", -60.0, 3.0)
func _on_guitar_toggled(toggled) -> void:
var synchrostream : AudioStreamSynchronized = stream as AudioStreamSynchronized
var tween : Tween = create_tween()
if !toggled:
tween.tween_property(synchrostream, "stream_1/volume", 0.0, 3.0)
else:
tween.tween_property(synchrostream, "stream_1/volume", -30.0, 3.0)
func _on_hh_toggled(toggled) -> void:
var synchrostream : AudioStreamSynchronized = stream as AudioStreamSynchronized
var tween : Tween = create_tween()
if !toggled:
tween.tween_property(synchrostream, "stream_2/volume", 0.0, 3.0)
else:
tween.tween_property(synchrostream, "stream_2/volume", -60.0, 3.0)
func _on_snare_toggled(toggled) -> void:
var synchrostream : AudioStreamSynchronized = stream as AudioStreamSynchronized
var tween : Tween = create_tween()
if !toggled:
tween.tween_property(synchrostream, "stream_3/volume", 0.0, 3.0)
else:
tween.tween_property(synchrostream, "stream_3/volume", -60.0, 3.0)
func _on_kick_toggled(toggled) -> void:
var synchrostream : AudioStreamSynchronized = stream as AudioStreamSynchronized
var tween : Tween = create_tween()
if !toggled:
tween.tween_property(synchrostream, "stream_4/volume", 0.0, 3.0)
else:
tween.tween_property(synchrostream, "stream_4/volume", -60.0, 3.0)