Jump to content

Photo

Highest and lowest possible audible sounds


14 replies to this topic

#1 notwhoyouthink OFFLINE  

notwhoyouthink

    Star Raider

  • 63 posts

Posted Thu Aug 10, 2017 1:16 AM

I was tinkering around with the TI under Classic99, and i have come up with the following values for the highest and lowest possible audible sounds i could get it to produce:

109.26625 & 10650.85714

 

tested with

1 X=[various values]
2 CALL SOUND(500,X,0)
RUN

until i found either a bad value or a value i could not hear at 100% PC speaker volume.

 

Just thought some may find this interesting for whatever reason.



#2 carlsson OFFLINE  

carlsson

    River Patroller

  • 4,530 posts
  • Location:Västerås, Sweden

Posted Thu Aug 10, 2017 1:33 AM

If I recall correctly, the range of sound frequencies the SN76489 (or TMS9919 as it is called on the TI-99/4A) depends on the input clock frequency. In particular on Z80 systems like Colecovision, Sord M5 and others which for simplicity use the video/CPU clock of 3.5 MHz it bottoms out at 110 Hz which is A-1 or something similar in terminology. Not a particularly low note. I understand the 99 clocks at 3 MHz so pretty much the same range. The SN76489 was also used with a few 6502 based systems like the Acorn BBC Micro/Master and the VTech Creativision/Laser 2001. These were clocked at 2 MHz, and from practical testing it seems the sound chip then will produce lower notes but also not as dog scaring high pitches on the other end of the scale.

 

The General Instruments AY chip has a bigger frequency resolution (12 bits instead of 10 bits) which it seems to use to start the frequencies lower, which is I've understood in particular Colecovision users get the Super Games Module with an AY chip to get bass notes plus any other improvements the AY has over the SN. Personally I'm not sure the differences are that great.

 

The 110 Hz as a lower end is also found on some systems with proprietary sound chips like the Commodore 16 and Plus/4 whose TED chip for some reason bottoms out there as well.

 

If the sound chip on the TI was fed another clock frequency, its sound range likely would differ.


  • jhd likes this

#3 digdugnate OFFLINE  

digdugnate

    Moonsweeper

  • 451 posts
  • Location:SW Missouri

Posted Thu Aug 10, 2017 2:29 AM

check out this link- http://www.unige.ch/...i99/tms9919.htm for more info on the tms9919 :)



#4 carlsson OFFLINE  

carlsson

    River Patroller

  • 4,530 posts
  • Location:Västerås, Sweden

Posted Thu Aug 10, 2017 2:41 AM

Interesting fact about the jumper to select CPUCLK or GROMCLK. What happens if you change it without replacing the sound chip, do you get frequencies in the range of 13.75 Hz - 1330 Hz?



#5 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,262 posts
  • Location:Silver Run, Maryland

Posted Thu Aug 10, 2017 8:21 AM

“Section 20: Sound” of the Editor/Assembler Manual details, pretty much, all you want to know about generating sound on the TI-99/4A.  Much of this information is repeated in the TI Extended Basic Manual.  The possible range is 110 Hz – 55,938 Hz.  Your observation re the highest frequency you could hear is in line with what most of us can hear—but, you can go higher, as noted above, likely irritating any nearby, non-human wildlife.

 

...lee



#6 carlsson OFFLINE  

carlsson

    River Patroller

  • 4,530 posts
  • Location:Västerås, Sweden

Posted Thu Aug 10, 2017 8:29 AM

That is assuming the TV speaker is able to reproduce those very high frequencies. Has anyone tested this with their pets to see if they react to the TI or other SN based system? I understand that cats have an even larger range of hearing than dogs have.



#7 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,401 posts
  • Location:Denmark

Posted Thu Aug 10, 2017 8:37 AM

It is possible to play low frequency sounds using periodic noise. I have used that a lot.

 

The F18A has a register for setting the GROM clock. 



#8 carlsson OFFLINE  

carlsson

    River Patroller

  • 4,530 posts
  • Location:Västerås, Sweden

Posted Thu Aug 10, 2017 8:58 AM

The LFSR? Yes, I've experimented with it too. It produces a different timbre than the square wave and with an entirely different frequency table for music routines, plus that it effectively cuts off one of the square wave voices since the frequency register is tied to it. So it either is three voices of square wave plus noise at a few set frequencies, or two voices of square wave plus either LFSR bass or fully programmable white noise.



#9 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,401 posts
  • Location:Denmark

Posted Thu Aug 10, 2017 9:22 AM

The LFSR? Yes, I've experimented with it too. It produces a different timbre than the square wave and with an entirely different frequency table for music routines, plus that it effectively cuts off one of the square wave voices since the frequency register is tied to it. So it either is three voices of square wave plus noise at a few set frequencies, or two voices of square wave plus either LFSR bass or fully programmable white noise.

 

You can alternate between playing bass notes using periodic noise and 'percussion' using white noise. And while you play white noise you can play square wave for added depth. If you use a tracker like MOD2PSG2 of DefleMask in combination with Tursi's VGM player this is quite manageable. Because of the frequency calculations I wouldn't want to mess around with it from BASIC or the standard TI assembly sound list player, however.



#10 notwhoyouthink OFFLINE  

notwhoyouthink

    Star Raider

  • Topic Starter
  • 63 posts

Posted Thu Aug 10, 2017 9:26 AM

Am i right in thinking the TI is just rounding everything off?
I.E. my 109.26625 just gets rounded off to 110?



#11 PeteE OFFLINE  

PeteE

    Star Raider

  • 70 posts
  • Location:Beaverton, OR

Posted Thu Aug 10, 2017 10:24 AM

 

You can alternate between playing bass notes using periodic noise and 'percussion' using white noise. And while you play white noise you can play square wave for added depth. If you use a tracker like MOD2PSG2 of DefleMask in combination with Tursi's VGM player this is quite manageable. Because of the frequency calculations I wouldn't want to mess around with it from BASIC or the standard TI assembly sound list player, however.

Can you go into more detail about the frequency calculations?  I had to transpose the low notes in the Tilda music, so it would be nice to have them play more accurately through the periodic noise with frequency from channel 2.  I wrote my own music converter in C, so I should be able to handle the calculations.

 

 

Am i right in thinking the TI is just rounding everything off?
I.E. my 109.26625 just gets rounded off to 110?

You can see how the frequencies get converted to dividers on the sound chip register here.  It does get rounded, but more so for high notes than low notes.  The divider is calculated by "round(111860.8 / freq)" so 110 is 1017 and 109.26625 would be 1024, but the divider limit is 3FF hex = 1023 decimal, so the actual lowest freq is 109.3458.



#12 atrax27407 OFFLINE  

atrax27407

    Dragonstomper

  • 685 posts

Posted Thu Aug 10, 2017 11:29 AM

There was a program "back in the day" that used high frequency sound generated by the TI as a pest/mosquito repellent.



#13 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,401 posts
  • Location:Denmark

Posted Thu Aug 10, 2017 11:47 AM

Can you go into more detail about the frequency calculations?  I had to transpose the low notes in the Tilda music, so it would be nice to have them play more accurately through the periodic noise with frequency from channel 2.  I wrote my own music converter in C, so I should be able to handle the calculations.

 

AFAIK, the frequency of channel 2 needs to be 15 times higher than the desired frequency, and the attenuation should be set to 15 (mute) unless you want to hear a high pitched off-key sound.

 

In the SN76489A variant used in the Sega Master System etc. the frequency needs to be 16 times higher, corresponding to exactly 4 octaves. This is a lot easier to work with and will not produce off-key sounds.



#14 carlsson OFFLINE  

carlsson

    River Patroller

  • 4,530 posts
  • Location:Västerås, Sweden

Posted Thu Aug 10, 2017 1:11 PM

When I worked with the Creativision, I also found that the relation between square wave and LFSR frequencies was 1/15. I used these values, on a 2 MHz system so I don't think they will be useful at all on the TI-99/4A:
 
  ; C-1 to D#4 with square wave
  .word $3f0b,$3c02,$380c,$3509,$3209,$2f0b 
  .word $2d01,$2a08,$2802,$250e,$230c,$210c 
  .word $1f0e,$1e01,$1c06,$1a0c,$1904,$170e 
  .word $1608,$1504,$1401,$120f,$110e,$100e 
  .word $0f0f,$0f00,$0e03,$0d06,$0c0a,$0b0f
  .word $0b04,$0a0a,$0a00,$0907,$080f,$0807
  .word $070f,$0708,$0701,$060b 
 
  ; C-1 to D#4 with LFSR
  .word $1010,$1000,$0f02,$0e04,$0d08,$0c0c
  .word $0c00,$0b06,$0a0c,$0a02,$0908,$0900
  .word $0808,$0800,$0709,$0702,$060c,$0606
  .word $0600,$050b,$0506,$0501,$040c,$0408
  .word $0404,$0400,$030d,$0309,$0306,$0303
  .word $0300,$020d,$020b,$0208,$0206,$0204
  .word $0202,$0200,$010e,$010d


#15 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,716 posts
  • Location:BUR

Posted Fri Aug 11, 2017 12:14 PM

I was tinkering around with the TI under Classic99, and i have come up with the following values for the highest and lowest possible audible sounds i could get it to produce:
109.26625 & 10650.85714


Be aware that the high end under emulation is not going to be correct for the hardware (and will depend on the sample rate you have set the emulator to). If set to 44100Hz, which is the highest Classic99 supports, the highest possible output is half that - 22050Hz. (If set to playback at 22050, which you may be, the maximum is half of that again...)

The real hardware can approach 50khz, as suggested by the math above (although output filtering might restrict that).

The divider is calculated by "round(111860.8 / freq)" so 110 is 1017 and 109.26625 would be 1024, but the divider limit is 3FF hex = 1023 decimal, so the actual lowest freq is 109.3458.


You can actually go one step lower on the 99's version of the sound chip - '0' represents a step of 1024, so you can hit that 109.2Hz value. However I don't think you can get that count from TI BASIC.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users