Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: Volvo_0ne on 25 Jan, 2018, 09:47 PM

Title: Knowing when a sample has finished?
Post by: Volvo_0ne on 25 Jan, 2018, 09:47 PM
OK I have several short samples which I play with Sam Raw which is just fine

BUT

How can I find out when each sample has finished playing so that I can play the next one?

This is further complicated by the particular sample to play is done by human interaction.

Think Space Invaders

TIA
V1
Title: Re: Knowing when a sample has finished?
Post by: adrazar on 27 Jan, 2018, 11:16 AM
FLAGS=Deek($DFF01C)

Bit 7-10 in FLAGS (counting from bit 0) tells which voices are currently being played. Each bit corresponds to one of the four voices (bit 7 <--> voice 0, etc.). If a bit is cleared it means the corresponding voice is finished, so using this you can figure out when to play the next sample :).
Title: Re: Knowing when a sample has finished?
Post by: Volvo_0ne on 28 Jan, 2018, 06:05 PM
Quote from: adrazar on 27 Jan, 2018, 11:16 AM
FLAGS=Deek($DFF01C)

Bit 7-10 in FLAGS (counting from bit 0) tells which voices are currently being played. Each bit corresponds to one of the four voices (bit 7 <--> voice 0, etc.). If a bit is cleared it means the corresponding voice is finished, so using this you can figure out when to play the next sample :).

Excellent!  I will try that tonight.
Thank you so much for your help.

V1
Title: Re: Knowing when a sample has finished?
Post by: Volvo_0ne on 18 Feb, 2018, 07:48 PM
After a bit of experimenting, I realised that I could squeeze all my sample playing into 2 channels, and time the playback rather than need to detect the sample ends.

Thanks for the insight tho guys :)

V1