Jump to content

0

differences in sound channels by default?


6 replies to this topic

#1 ProWizard OFFLINE  

ProWizard

    River Patroller

  • 2,329 posts
  • Location:Not here

Posted Wed Feb 22, 2012 4:32 AM

Hi!

Why does writing

#$AF to AUDC1 and writing #$1D to AUDF1 result in a high pitched, high volume, pure tone?


#$AF to AUDC2 and writing #$1D to AUDF2 result in a high pitched, high volume, pure tone?


#$AF to AUDC3 and writing #$1D to AUDF3 result in a short "brt" and then silence?


#$AF to AUDC4 and writing #$1D to AUDF4 result in a LOW pitched, high volume, pure tone?


What do I have to do to get a high pitched tone out of channel 3 or 4?

Tested on Atari 800XL PAL.

Thanks
M

#2 emkay OFFLINE  

emkay

    Quadrunner

  • 7,042 posts
  • What's up?
  • Location:Holy Grail ;)

Posted Wed Feb 22, 2012 4:42 AM

Have you reset the registers first?

I'd say chn3 and 4 have been prepared for SIO (16 bit) when testing this.

#3 Rybags OFFLINE  

Rybags

    Quadrunner

  • 11,194 posts
  • Location:Australia

Posted Wed Feb 22, 2012 5:05 AM

^ that and ...

Channel 1/2 output is "inverted" vs channel 2/3.  So, playing a same pitched sound on 1 + 2 or 3 +4 will have some additive effect.

But, do the same e.g. with 1 + 4 and you get some cancellation.  The amount of cancellation can vary.  You can make it full by hitting STIMER, which will sync all the voices.

By doing arbitrary setting of the AUDC/F registers you'll hit some random spot in the waveform.  With known delays, the resultant waveform can be controlled.


For normal circumstances though, you can put the knowledge to use in that if you want to play similar frequencies on 2 voices, it's usually best to do so on 1/2 and 3/4 pairs.

#4 ProWizard OFFLINE  

ProWizard

    River Patroller

  • 2,329 posts
  • Location:Not here

Posted Wed Feb 22, 2012 5:20 AM

Hmm... I'm not sure I described my problem well enough.

All these 4 lines are programs on their own. Not together.

So I was wondering (and perhaps Emkay gives the answer... I'm not sure yet)...  why does simply putting:

#$AF in AUDC4 and #$1D in AUDF1 not result in a high pitched tone.

Obviously these 4 channels do not behave the same?

You might want to know why I need this... well let me explain.

There is a little program in my BBS called CALLSYS.
It is a call-sysop feature, which plays a high tone on my PC speaker when someone hits the "C" button.

But here it comes:
Since I switch from BlackBox R: to Atari 850 the BBS is using the SIO and this CallSys program has a problem: as soon as this BEEP is played, a lot of garbage is send over the R: (R: and pokey sound share the same). So I thought: let me use another pokey channel for this SOUND output. So I tried other channels, but they all refuse working properly. So I thought: hmmm let me try this in Mac/65 with nothing but playing a beep on one of the 4 channels. And I was surprised to find out that channel 3 and 4 simply do not behave like channel 1 and 2.

so now let's make the question simpler:

Who can show me a very short program (assembler) that plays a high pitched beep on pokey channel 3 or 4.

Thanks
Marius

#5 Rybags OFFLINE  

Rybags

    Quadrunner

  • 11,194 posts
  • Location:Australia

Posted Wed Feb 22, 2012 5:22 AM


lda #3
sta $d20f ; set SKCTL to default
lda #0
sta $d208; set AUDCTL to default
lda #$20
sta $d206 ; AUDF4
lda #$a8
sta $d207 ; AUDC4


+ easy way to diagnose your problem

Run Altirra, hit F8 when the sound isn't doing what you expect.  Type .pokey in the debug window.
Note what values in AUDCTL, SKCTL and the AUDF/C for each voice.

Edited by Rybags, Wed Feb 22, 2012 5:24 AM.


#6 emkay OFFLINE  

emkay

    Quadrunner

  • 7,042 posts
  • What's up?
  • Location:Holy Grail ;)

Posted Wed Feb 22, 2012 7:52 AM

POKEY channel 3 and 4 seem to set to 16 bit. So chn 4 is clocked by a divisor of channel 3. set AUDCTL (unset the 16 bit of chn 3 and 4) )to standard and all 4 channels get the same pitch.

#7 ProWizard OFFLINE  

ProWizard

    River Patroller

  • 2,329 posts
  • Location:Not here

Posted Wed Feb 22, 2012 9:23 AM

Thanks rybags and emkay. This was very helpful!




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users