Godot-Mixing-Desk icon indicating copy to clipboard operation
Godot-Mixing-Desk copied to clipboard

Error when song stops

Open oppenheimer- opened this issue 4 years ago • 4 comments

I'm following your tutorial over at youtube and installed the github version. Autoplay of the first song and the attached random ambient pieces seem to work fine, but when the core container is done playing it throws this error.

mixing_desk_music.gd Attempt to call function 'get_playback_position' in base 'null instance' on a null instance. Line 103 time = ref_track.get_playback_position()

Took some screenshots as well, maybe they help:

Node setup

image

Song settings

image

Inspector

image

oppenheimer- avatar Nov 28 '20 00:11 oppenheimer-

I can confirm this issue. I followed the explanation in the documentation and I bumped into this the first time. I was using a WAV file. When I changed to the OGG format, it worked.

vanoak avatar Jan 31 '21 13:01 vanoak

Hi, I'm currently reading all the code and adding code comments and do cleanup. Can you upload a small test project for me, please? I'll go fix it : )

MJacred avatar Mar 27 '21 19:03 MJacred

Hi, I ran into the above error message and my program aborting. As sound file I used a one bar Ogg Vorbis file in an AudioStreamPlayer, added to a CoreContainer, which was added to a Song container, which was added to a MixingDeskMusic instance. To check it had nothing to do with the file length, I added 5ms of silence to the sound file, still the same result. A quick workaround seems to be an extra check under 'if playing:' in _process() in mixing_desk_music.gd:

if playing:
	if is_instance_valid(ref_track):
		time = ref_track.get_playback_position()
		beat = int(floor(((time/beats_in_sec) * 1000.0) + 1.0))
		if beat != last_beat && (beat - 1) % int(bars * beats_in_bar) + 1 != last_beat:
			_beat()
		last_beat = beat

(No else statement). If I catch and print all relevant signals from MixingDeskMusic, I can print something like

Current bar 1 Current beat 1 Current beat 2 Current beat 3 Current beat 4 Current bar 2 Song 0 has ended. Current beat 1

I can work with this. No idea if this works in lists of songs or lists of songs with transitions

FFoeth avatar Jun 27 '21 10:06 FFoeth

THIS FUKIN BUG AAAAAAAAAAAAAAAAA

caliconiko avatar Aug 18 '22 10:08 caliconiko