YM : Sample and R13 retrig questions.

GFA, ASM, STOS, ...

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Targhan
Atarian
Atarian
Posts: 4
Joined: Thu Mar 23, 2017 2:18 pm

YM : Sample and R13 retrig questions.

Postby Targhan » Thu Mar 23, 2017 2:51 pm

Hi all,

I'm a coder/musician on Amstrad CPC and I have a few technical questions for you guys, as we "almost" share the same sound processor:

- You manage to play 4 channels MODs on 8 bits. I understand you use the summing of the volume of all the three channels (thanks to one single instruction of the 68000 to change their value). So there is a table converting a 8-bit value to 2 (or 3?) 4-bit values. Is there somewhere I can see this table ?
- Is the result *really* 8 bits? Shouldn't it be only 5 bits (3 * 4-bit numbers) ?
- In a lot of ST Trackers, there is an option called "Start syn" or "hardsync" to reset the hardware envelope and synchronize it with the software sound wave. On CPC, we do it by setting a value to the R13, even if it's the same. It works, but the software wave is not reset, so the synchronization is not perfect. Is there something you do that we do not, or is it something specific to the YM?

Thanks a lot,
Targhan/Arkos.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2058
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: YM : Sample and R13 retrig questions.

Postby charles » Thu Mar 23, 2017 10:07 pm

there are couple good books I know off top of my head ,,,midi and sound book for Atari st
and lots of gfa code examples for sample tracker playback .......gfa manual from michtron is good too!
let me know if this helps or not
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 350
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: YM : Sample and R13 retrig questions.

Postby farvardin » Thu Mar 23, 2017 10:48 pm

I can't answer those questions, but I just wanted to highlight the fact that Targhan made the awesome Starkos and Arkos trackers for the CPC, so please share your informations with him, it will be well used! ;) Salut Targhan !

Admire the wonderful trackers in action:
https://www.youtube.com/watch?v=GTIvkKZxKww

https://www.youtube.com/watch?v=XKHyBK3D2bY

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: YM : Sample and R13 retrig questions.

Postby leonard » Fri Mar 24, 2017 3:57 pm

Targhan wrote:So there is a table converting a 8-bit value to 2 (or 3?) 4-bit values. Is there somewhere I can see this table ?
- Is the result *really* 8 bits? Shouldn't it be only 5 bits (3 * 4-bit numbers) ?


I attached one of these table here. The table layout is specific to please 68000 replay rout so some explain: the table is made for unsigned 8bits sample, so it has 256 entries. Each entry is 8 bytes long, but you really need only 12bits ( 3 * 4bits volume register). Here is one 8bytes entry of the table:

xx xx 0A xx xx 0B xx 0C

0A, 0B and 0C are the 4bits volume value to put in volume reg A,B & C. That's all

Targhan wrote:- Is the result *really* 8 bits? Shouldn't it be only 5 bits (3 * 4-bit numbers) ?


Theorically the table could encode 16^3 / (3!) = 682 values, so better than 8bits ( 3! because a,b,c is same than c,b,a for instance). In practice you could consider a bit less than 8bits for perceived quality (if you compare to a real 8bit DAC) because YM volumes are not linear so the 682 resulting values are not linearly spread.

Targhan wrote:Is there something you do that we do not, or is it something specific to the YM?


I really don't know what you mean by "software wave" but what I know is that writing to reg13 (even the same value as before) reset the envelop position. Doing this in a timer routine could do really nice sound ( called "sync buzzer" on some ATARI players)
You do not have the required permissions to view the files attached to this post.
Leonard/OXYGENE.

Targhan
Atarian
Atarian
Posts: 4
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM : Sample and R13 retrig questions.

Postby Targhan » Mon Mar 27, 2017 7:47 am

Thanks a lot for all your replies!

Your table makes sense, thanks.

About writing to R13, it indeed resets the hardware envelope. However, on CPC at least, it does not also reset the software envelope too, so it doesn't always sound the same whenever R13 is reset. The sound doesn't have the same "attack", it doesn't sound as good as on ST. So I was wondering if you used another trick besides resetting R13, to also synchronize the high/low shelf of the rectangular wave.

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: YM : Sample and R13 retrig questions.

Postby leonard » Mon Mar 27, 2017 6:09 pm

Targhan wrote:it does not also reset the software envelope too


what do you mean by software envelope? You mean square wave generator? To my understanding, the YM works exactly the same on ATARI or CPC. On Atari at least it just reset the volume enveloppe. It does absolutly nothing on the three square wave generators. (and to my knowledge ATARI music drivers didn't do anything special on square wave generator voices when using sync-buzzer)
Leonard/OXYGENE.

Targhan
Atarian
Atarian
Posts: 4
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM : Sample and R13 retrig questions.

Postby Targhan » Tue Mar 28, 2017 7:32 am

Yes, I meant the square wave generator. I had a quick word with Gwem, and like you said, R13 only resets the hardware wave. However, to get their "Start syn" effect, the square wave frequency is set to 0, then back to its original value, so that both square and hardware waves are synchronized. I thought I already tested that, but I must have done something wrong :).

Targhan
Atarian
Atarian
Posts: 4
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM : Sample and R13 retrig questions.

Postby Targhan » Mon Apr 03, 2017 7:23 am

Well, setting the square frequency to 0 and then to its original value did the trick. Combined with the reset of R13, it synchronizes both waves. Thanks !
The only problem is that doing so costs quite a lot of Amstrad CPC, as the access to our AY is very slow.

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: YM : Sample and R13 retrig questions.

Postby leonard » Mon Apr 03, 2017 8:19 am

Targhan wrote:Well, setting the square frequency to 0 and then to its original value did the trick.


Wow I even don't know that trick myself :) obviously this is not supported by YM STSound format :(
Leonard/OXYGENE.

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 951
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: YM : Sample and R13 retrig questions.

Postby FedePede04 » Mon Apr 03, 2017 8:46 am

leonard wrote:
Targhan wrote:it does not also reset the software envelope too


what do you mean by software envelope? You mean square wave generator? To my understanding, the YM works exactly the same on ATARI or CPC. On Atari at least it just reset the volume enveloppe. It does absolutly nothing on the three square wave generators. (and to my knowledge ATARI music drivers didn't do anything special on square wave generator voices when using sync-buzzer)


and to my knowledge the square wave always run, it is being "OR" with the mixer register.
same with the noise generator it is also running, it also get "OR" with the mixer register.
and the output of the Sound and noise is "AND" together.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

distantminds
Atari maniac
Atari maniac
Posts: 94
Joined: Thu Sep 29, 2005 5:03 pm

Re: YM : Sample and R13 retrig questions.

Postby distantminds » Mon Apr 03, 2017 9:42 am

Hey guys,

Gwem did a lot of research on this and you can read the results here:

http://alive.atari.org/alive9/ymsamp.php

cheers,

D


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 1 guest