Ultimate Amiga

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

Title: Knowing when a sample has finished?
Post by: Volvo_0ne on January 25, 2018, 08:47:40 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 January 27, 2018, 10:16:06 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 January 28, 2018, 05:05:14 PM
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 February 18, 2018, 06:48:39 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