Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Knowing when a sample has finished?  (Read 4377 times)

0 Members and 1 Guest are viewing this topic.

Volvo_0ne

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 71
  • A1200 lover
Knowing when a sample has finished?
« 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
Logged
Transuranic heavy elements may not be used where there is life.

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 69
  • Generic Amiga User
Re: Knowing when a sample has finished?
« Reply #1 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 :).
Logged

Volvo_0ne

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 71
  • A1200 lover
Re: Knowing when a sample has finished?
« Reply #2 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
Logged
Transuranic heavy elements may not be used where there is life.

Volvo_0ne

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 71
  • A1200 lover
Re: Knowing when a sample has finished?
« Reply #3 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
Logged
Transuranic heavy elements may not be used where there is life.
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022