YM + digidrum won't work

GFA, ASM, STOS, ...

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

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

YM + digidrum won't work

Postby Targhan » Fri Jul 06, 2018 10:01 am

Hi all,

My tracker (Arkos Tracker 2) successfully generates YM, but till now, without digidrums. I started implemented that, and for reason unknown, the digidrums simply do NOT work. NOTHING can be heard (the music sounds very fine except that).

I wondered if anyone could "debug" this tiny and very simple YM6, which has only one sample (index 0), played every 24 frames on channel B, without any other sound.
digi.zip


In header, you can see that:
- The frame count is #180
- The song attribute is 1 (interleaved). I use signed sample, but setting bit 1 doesn't change anything.
- There is one sample declared, its size is #1646.

Image


Since I only want to play drums, and nothing else, all my registers show 0, except:
Reg 3, at #1b05:
Image
value #20 every 24 frames. According to the doc, bit 5-4 indicates the channel where to play the digidrum:
00 = nothing
01 = channel A
10 = channel B
11 = channel C

So my value is "0b100000" to play on channel B, hence #20.

Reg 7 is always #3f (all sound and noise to off).
Reg 8 at #2285 indicates the volume (here, 0 because no digidrum on channel A), and TP (Timer predivisor), on bit 7-5. I use a predivisor of 4, so encoded as 1 (according to the doc), hence 0b00100000, or #20. Once again, this is triggered every 24 frames.
Image
Reg 9 at #2405 shows either the volume (I have none, as I only have digidrum), or the sample number. In my case, this is still 0 because I only have one sample. So, 0 all along this register.

Reg 15 is the TC (Timer Counter). I used #4c. I tried using higher and lower values, but nothing changes.
Image

So, where is my mistake?? I have also switched my sample with a sample from a madmax song, but I still don't hear a thing. I compared my bytes with other music with digidrums, and can not find anything wrong. Please help, I'm getting crazy on this :).

For information, all the offset of the registers, for faster browsing:
Reg 0 = #1685
Reg 1 = #1805
Reg 2 = #1985
Reg 3 = #1b05
Reg 4 = #1c85
Reg 5 = #1e05
Reg 6 = #1f85
Reg 7 = #2105
Reg 8 = #2285
Reg 9 = #2405
Reg 10 = #2585
Reg 11 = #2705
Reg 12 = #2885
Reg 13 = #2a05
Reg 14 = #2b85
Reg 15 = #2d05

Thanks a lot!
You do not have the required permissions to view the files attached to this post.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: YM + digidrum won't work

Postby mlynn1974 » Sun Jul 08, 2018 12:40 am

Hi Targhan,

Which doc are you referring to?

I only have this document:
http://leonard.oxg.free.fr/ymformat.html
but that document doesn't mention "bit 5-4 indicates the channel where to play the digidrum".

I tried the WinAmp plug and AY-Player but as you say no sound is heard. Both play the YM for 7 seconds.

Things to check:
1. I thought that the volume of channel B would have to be specified. What happens if you set it to decimal 63 (hex: 0x3f)?
2. I thought interleaved meant that all r0, r1 etc. are grouped together for better compression.
Your song seems correctly interleaved in my opinion as it goes frame0[r0, r1, r2], frame1[r0, r1, r2] etc.

Leonard's document seems a bit unclear:
"That's why there is an interleaved format: file contains all r0 for all frames, then all r1 for all frame on so on."
I would think that's a description of non-interleaved format.

I wish I could help more. Please reply with the fixed YM once you fix it.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Sun Jul 08, 2018 10:10 am

Thanks for your reply.

The doc on the Leonard is vastly incomplete, the doc I'm referring to is here.

I thought that the volume of channel B would have to be specified. What happens if you set it to decimal 63 (hex: 0x3f)?

Why 0x3f? The doc states that it should either be the volume (5 bits) if there is no digidrum, or the digidrum number if there is a digidrum (hence, 0 in my case).

I thought interleaved meant that all r0, r1 etc. are grouped together for better compression.

No, "interleaved" is a bit of a misnomer in my opinion. Please have a look at the doc, this is more clearer, but "interleaved" means: all the R0, then all R1, etc.

So this simple YM is well formatted. Just so you know, I've produced both more complex YMs, both interleaved and non-interleaved, and they all play well in YM Players (ST Sound, AY Emulator). Except that in all cases, the digidrums are not read. So there must be *something* I am missing, but I can't figure out what!

Thanks!
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: YM + digidrum won't work

Postby mlynn1974 » Sun Jul 08, 2018 10:02 pm

Hi Targhan,
I don't know if this is significant. I wrote a program to list out the YM6 attributes, just the headers at the moment. It also dumps your digidrum
sample to a file. It is 8-bit unsigned and can be read by Audacity.

The original specification just mentions 4-bit audio samples, but I'm sure that 8-bit is supported.
If you set the sound sample are to FFFFFFF then very quiet hiss is heard instead of the digidrum so it is trying to get the sample.

I replaced the digidrum with a signed version and set the sign bit, but still it didn't work.

Regards,
Michael.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: YM + digidrum won't work

Postby metalages » Mon Jul 09, 2018 6:00 am

I do not know anything about ym but guessing what can be done in terms of code, would it be possible the interupt stops as soon as it finds a zero value into the sample ?

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Mon Jul 09, 2018 7:21 am

@mylynn1974 Actually, there is a flag in the "flag attributes" which SHOULD be set to 1 (signed sample, bit 1). But on the YM I studied, it is never set to one, even though the samples are signed. Anyway, I tried producing signed/unsigned sample, setting/resetting this bit, and it doesn't change anything. From experience, if you replay an unsigned sample, thinking it is a signed sample, it plays a LOT of dirty sounds, so it should definitely be heard!

@metalages zero has no special meaning, especially for signed sample, where it means "lowest value". As I already switched the drums from Turrican 2 with mine, and it didn't work better, so...
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Zippy
Captain Atari
Captain Atari
Posts: 161
Joined: Sun Feb 01, 2004 1:58 am

Re: YM + digidrum won't work

Postby Zippy » Mon Jul 09, 2018 2:38 pm

Could it be something to do with your playback code rather than the data in the music files?

When I ripped the Chambers of Shaolin music (the first with digi drums on the ST) the soundchip part worked fine but there were no digi drums. Turned out that the MFP interrupt at $114.w also had to be setup, which is what I was missing.

With the Turrican music there was a similar problem, soundchip stuff played fine but no digi drums again... that time it was to do with the MFP register at $fffffa17 , it needed bit 3 clear to put the MFP interrupt handling into the correct mode and allow the digi drums to play.

This is from the comments on the playback code:

; This is the source for playing back the music from Turrican.
;
; The sample drums install on $114.w
; If you have ever tried to rip this music (or the Wings of Death
; music) then you'll have noticed that the sample drums don't play
; properly, although the sound chip music does.
; This is because the mfp is still in software end of interrupt
; mode (ie. at the end of your mfp interrupt you have to clear the
; interrupt in service bit, or all other lower priority interrupts
; will be masked out). The music player used in these games does
; not clear this bit, so it must be executed in automatic end of
; interrupt mode, where the mfp handles these bits accordingly.

and in the code:

bclr #3,$fffffa17.w ;put mfp into automatic end of interrupt mode


No idea if any of this is useful or relevant at all but thought it might be worth mentioning as I remember these problems with digi drums not working while the rest of the music was OK. :)

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Mon Jul 09, 2018 2:48 pm

Thanks for your reply. However, I didn't even tried to replay the YM on an Atari (I don't even code on 68000!). I simply exported the YM from my Tracker, and tried it with various PC players (ST Sound, AY emul). The music always works fine, but the digidrums are never heard.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Tue Jul 10, 2018 8:28 am

@zippy : Since you managed to produce digidrum correctly, can you have a look at my YM to quickly check if my data seems fine to you? Just check the registers in my post, don't bother analysing the YM. Maybe you'll understand what is wrong.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: YM + digidrum won't work

Postby metalages » Tue Jul 10, 2018 8:35 am

I am curious : how do PC players emulate timer stuffs ?
Do they have a complete 68k + MFP emulation ?

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Tue Jul 10, 2018 8:46 am

No idea, but I don't think they have, they don't need to! JAM is probably doing that, because it imports SNDH, so 68+MFP are emulated. But for "simple" AY emulator (ST Sound, AY emul), I would say no.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Zippy
Captain Atari
Captain Atari
Posts: 161
Joined: Sun Feb 01, 2004 1:58 am

Re: YM + digidrum won't work

Postby Zippy » Tue Jul 17, 2018 11:10 am

Targhan wrote:@zippy : Since you managed to produce digidrum correctly, can you have a look at my YM to quickly check if my data seems fine to you? Just check the registers in my post, don't bother analysing the YM. Maybe you'll understand what is wrong.


Sorry, I don't know anything about the data formats or much about the music players, really all I did was rip games from music and demos and get it working in intros or whatever.

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Tue Jul 17, 2018 11:12 am

Ok, no problem. Thanks anyway!
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Wed Jul 18, 2018 6:19 pm

Aaaaaahhhhhhhhhhhhhhhh!!!!!!!!!!!! I've found out!!!!!!!!!!!!!

After many tries, I understood why it didn't work. In R3, bit 6 MUST be 1 when triggering the digidrum. Don't ask me why, I don't know, this is not in the documentation!!!! Bits 5-4 indicate the channel where the digidrum is played (01 = A, 10 = B, 11 = C), BUT bit 6 must also be set.

Maybe this will be of some help to anyone.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: YM + digidrum won't work

Postby mlynn1974 » Wed Jul 18, 2018 9:35 pm

Well done Targhan! Please add this to the documentation.
https://github.com/skeezix/zikzak/blob/ ... format.txt

Is this correct?
To play the digidrum on channel A:
bit: 7654 3210
bin: 0101 0000
=0x50 (80)

To play the digidrum on channel B:
bit: 7654 3210
bin: 0110 0000
=0x60 (96)

To play the digidrum on channel C:
bit: 7654 3210
bin: 0111 0000
=0x70 (112)

So YM format is a register dump of the chip, and on a real ST the drums would be added by playing the sample at the appropriate time. This is simulated in YM format by using these trigger commands and a list of samples stored at the front of the YM.

Can anyone remember if the intro tune for 7 Gates Of Jambala (by Mad Max) had digi drums?
There might be 2 versions one with digidrums and one without. Or maybe as Zippy said in some demos that used it they didn't switch on the interrupt service routine to play the drums.

I personally like YM format because it can be used for Spectrum music as well.

Regards,
Michael.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Wed Jul 18, 2018 9:48 pm

This seems correct to me. I've made a pull request, corrected a small other mistake.
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Fri Jul 20, 2018 10:29 pm

Please accept my PR. Just noticed some other problem, the offset in the header is not right since the digidrum count is on 2 bytes, not 4, and the "Player frequency in Hz" is a DWORD, not a WORD (see the YM3 and YM5 format).
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: YM + digidrum won't work

Postby mlynn1974 » Fri Jul 20, 2018 10:57 pm

I'm not involved in the GitHub thing at all. Is Skeezix on this forum?
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Fri Jul 20, 2018 11:00 pm

Oh sorry, I thought it was you and you weren't notified of the PR. No problem really :).
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Thu Aug 23, 2018 8:00 am

New input from Leonard about these bits 7-6:

"Je ne me souviens plus du tout mais les sources sont disponibles. En regardant YmMusic.cpp dans readYm6Effect je vois que les bits 6 et 7 forment un code de 2 bits:
00: SID
01: Digidrum
10: Sinus-SID
11: Sync-Buzzer"
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: YM + digidrum won't work

Postby mlynn1974 » Thu Aug 23, 2018 9:06 pm

Good old Leonard! A translation from Google Translate:

I do not remember at all, but the sources are available. Looking at YmMusic.cpp in readYm6Effect I see that bits 6 and 7 form a 2-bit code:
00: SID
01: Digidrum
10: Sinus-SID
11: Sync-Buzzer

I think that is documented already.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

Targhan
Atari nerd
Atari nerd
Posts: 49
Joined: Thu Mar 23, 2017 2:18 pm

Re: YM + digidrum won't work

Postby Targhan » Thu Aug 23, 2018 9:45 pm

I think that is documented already.


Well, I'd like it to :). Never saw anything about it. I added this bit to the GitHub, but my MR are not merged still...
Targhan/Arkos.

Check out Arkos Tracker 2, (maybe?) the best 8-bit cross-platform tracker!


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 6 guests