Discussion:
How do I play music with a BIOS POST beeper?
Add Reply
s7382
2021-05-02 02:01:09 UTC
Reply
Permalink
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
Ed Lee
2021-05-02 02:19:09 UTC
Reply
Permalink
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
Rick C
2021-05-02 05:37:16 UTC
Reply
Permalink
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.

I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
--
Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209
Ed Lee
2021-05-02 13:20:15 UTC
Reply
Permalink
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.
I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
Doesn't matter if it works or not. Just "sound good".

Seem like another remote interviewing questions. You are hired for the engineering and i am hired for the marketing. For marketing, they need tease and elegant sounding solution, not necessary the best solution. So:

1. How to do CPU fan out video and audio - FPGA synthesized input phase locked freq up shifted audio and down shifted single pixel video monitor.

2. How to play PC speaker music - 5 nm FinFET x86 single chip digital audio processor with programmable timer/counter.
bitrex
2021-05-02 22:38:59 UTC
Reply
Permalink
Post by Ed Lee
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.
I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
Doesn't matter if it works or not. Just "sound good".
1. How to do CPU fan out video and audio - FPGA synthesized input phase locked freq up shifted audio and down shifted single pixel video monitor.
2. How to play PC speaker music - 5 nm FinFET x86 single chip digital audio processor with programmable timer/counter.
On Linux it's easy there's a "beep" command with command line arguments
for frequency and duration, apt-get install beep on Debian/Ubuntu. also
snd-pcsp module lets you use the pc speaker as a crude DAC.

If a -nix type OS isn't allowed then hopefully your x86 assembler is
good because you can't do it on Windows; 'in' and 'out' assembly
instructions aren't available to user-mode programs and there's no API
to make the equivalent of a kernel-mode system call to access the
internal speaker.

If you're expected to do the whole exercise yourself you have to write a
custom bootloader to boot the x86 processor into real mode and do
Ed Lee
2021-05-02 23:00:08 UTC
Reply
Permalink
Post by bitrex
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.
I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
Doesn't matter if it works or not. Just "sound good".
1. How to do CPU fan out video and audio - FPGA synthesized input phase locked freq up shifted audio and down shifted single pixel video monitor.
2. How to play PC speaker music - 5 nm FinFET x86 single chip digital audio processor with programmable timer/counter.
On Linux it's easy there's a "beep" command with command line arguments
for frequency and duration, apt-get install beep on Debian/Ubuntu. also
snd-pcsp module lets you use the pc speaker as a crude DAC.
If a -nix type OS isn't allowed then hopefully your x86 assembler is
good because you can't do it on Windows; 'in' and 'out' assembly
instructions aren't available to user-mode programs and there's no API
to make the equivalent of a kernel-mode system call to access the
internal speaker.
.byte, .word or equivalent is usually your friend there.
bitrex
2021-05-02 23:26:16 UTC
Reply
Permalink
Post by Ed Lee
Post by bitrex
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.
I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
Doesn't matter if it works or not. Just "sound good".
1. How to do CPU fan out video and audio - FPGA synthesized input phase locked freq up shifted audio and down shifted single pixel video monitor.
2. How to play PC speaker music - 5 nm FinFET x86 single chip digital audio processor with programmable timer/counter.
On Linux it's easy there's a "beep" command with command line arguments
for frequency and duration, apt-get install beep on Debian/Ubuntu. also
snd-pcsp module lets you use the pc speaker as a crude DAC.
If a -nix type OS isn't allowed then hopefully your x86 assembler is
good because you can't do it on Windows; 'in' and 'out' assembly
instructions aren't available to user-mode programs and there's no API
to make the equivalent of a kernel-mode system call to access the
internal speaker.
.byte, .word or equivalent is usually your friend there.
Not sure I follow you there, but you can't access the "real" memory
space where memory-mapped I/O devices live from a user-mode process, any
attempt to go outside the bounds of the virtual address table for the
process will segfault the program.

Might be able to write a kernel-mode device driver and your own API for
it but AFAIK nothing like this is
Jasen Betts
2021-05-03 08:12:24 UTC
Reply
Permalink
Post by bitrex
Post by Ed Lee
Post by Ed Lee
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You reprogram the timer/counter.
You beat me to it. I actually did that one time way back in the day when PCs still used TTL chips in them. The timer counter was an Intel chip with one counter for driving the speaker and another counter for timing the PC timer interrupt (the third was for DRAM refresh or DMA or something). I reprogrammed the time interrupt to 8 kHz and used the speaker timer as a PWM output. The audio was rough, but recognizable. At the time I was working for a company making equipment for monitoring various comms equipment including phone line modems. The only sound file I had handy was a modem protocol so I used that. A manager stuck his head in the lab when he heard the sound. At that time "multimedia" cards were a not so cheap option and so PCs just didn't have sound mostly. He wanted to know how I was making that sound and I explained it. Turns out they had a customer for their training software who could not get approval for "multimedia" add ons (they were considered a frill) so the training was done without ever actually hearing the sounds which the operator would hear when using the software. He was very interested in this even though it was crude.
I don't know if this would work as well these days. There's a lot going on and getting a timely response to the 8 kHz interrupt might not be so easy. I'm not sure they even have the real time clock timer anymore or if you can access the hardware directly. But it's worth a try.
Doesn't matter if it works or not. Just "sound good".
1. How to do CPU fan out video and audio - FPGA synthesized input phase locked freq up shifted audio and down shifted single pixel video monitor.
2. How to play PC speaker music - 5 nm FinFET x86 single chip digital audio processor with programmable timer/counter.
On Linux it's easy there's a "beep" command with command line arguments
for frequency and duration, apt-get install beep on Debian/Ubuntu. also
snd-pcsp module lets you use the pc speaker as a crude DAC.
If a -nix type OS isn't allowed then hopefully your x86 assembler is
good because you can't do it on Windows; 'in' and 'out' assembly
instructions aren't available to user-mode programs and there's no API
to make the equivalent of a kernel-mode system call to access the
internal speaker.
There'a also a snd-pcsp kernel module that makes a sound device
capable of playing sampled audio (badly).

menuconfig says:

┌────────────────── PC-Speaker support (READ HELP!) ──────────────────┐
│ CONFIG_SND_PCSP: │
│ │
│ If you don't have a sound card in your computer, you can include a │
│ driver for the PC speaker which allows it to act like a primitive │
│ sound card. │
│ This driver also replaces the pcspkr driver for beeps. │
│ │
│ You can compile this as a module which will be called snd-pcsp. │
│ │
--
Jasen.
none) (albert
2021-05-02 14:50:42 UTC
Reply
Permalink
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.

Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
***@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
D***@decadence.org
2021-05-02 15:20:57 UTC
Reply
Permalink
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can
song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
You have to use a boot loader that allows it.

My Linux PC plays 'Fur Elise' and the theme from Close Encounters
when it boots.

I used a variant of GRUB called BURG. It is no longer in development
or support, ut getting an old version to work and play an audio chirp
song through the BIOS is one thing it was able to do before choosing
the OS one wants to boot.
D***@decadence.org
2021-05-02 15:22:00 UTC
Reply
Permalink
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can
song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration only.
Rick C
2021-05-02 15:46:03 UTC
Reply
Permalink
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can
song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration only.
Nonsense. The timing generator is working as a PWM DAC. It will produce as many phonies as you establish in the audio to be reproduced.

What I have always wanted was a simple interface to allow me to play sound files from a Forth app without the app having special privileges. I've never found a way to do that which doesn't require paying for special development tools.
--
Rick C.

+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209
none) (albert
2021-05-02 20:14:08 UTC
Reply
Permalink
Post by Rick C
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the Can-can
song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration only.
Nonsense. The timing generator is working as a PWM DAC.
It will produce as many phonies as you establish in the audio to be reproduced.
In general the timer is used and intended as single tones and tone duration.
It is certainly not working as PWM just so.
If you have a reference to how to make it work as PWM, that would be
nice. It is probably easier to bitbang a handshake bit on an RS232
port.

That the program need to be installed in grub is nonsense.
This is how I compile and run a program that is available from
the rosetta code site :

~/PROJECT/ciforths/ciforth/TOOLS$ lina -c rosetta.frt
# : ISN'T UNIQUE
$-PREFIX : (WARNING) NOT PRESENT, THOUGH WANTED
1 ~/PROJECT/ciforths/ciforth/TOOLS$ sudo ./rosetta

You can pick up the lina compiler from
https://github.com/albertvanderhorst/ciforth/tree/master/release
(e.g. the .deb is easy to install).

/---------------------------------------------------------------

\ Copyright (2001): Dutch Forth Workshop Holland by GNU Public License.

\ The sound is produced by the internal speaker that is directly
\ connected to the motherboard. No speaker, no sound.
\ This works on IBM-compatible pc's from 80's XT-pC to current day
\ UEFI 8-core's.

WANT $-PREFIX
WANT -scripting-
WANT PC!
WANT XOS

\ Real time section ---------------------------------------------------

\ Set N on the timer of the `pc'. This is the time for one
\ sound cycle, so the reciprocal of a frequency.
: SET-FREQUENCY $B6 $43 PC! DUP $42 PC! 8 RSHIFT $42 PC! ;

\ Let the cycles generated by the timer onto the speaker.
: SPEAKER-ON $61 PC@ 3 OR $61 PC! ;

\ And block them again.
: SILENT-SPEAKER $61 PC@ $FC AND $61 PC! ;

\ NOTE -> one secunde higher NOTE, ratio of a secunde, 2^(1/12).
\ Uses best 16 bit convergent for 1.0594630943593
: secunde 17843 18904 */ ;

\ Conversion table a note number to a wave frequency.
\ Entries must be 16-bit unsigned representable.
CREATE _notes 17806 ( C2) 12 0 DO DUP , secunde LOOP DROP

\ For midi NOTE get timing CONSTANT.
: >timing 36 - 12 /MOD SWAP CELLS _notes + @ SWAP RSHIFT ;

\ Start a midi NOTE the speaker).
: NOTE-ON >timing SET-FREQUENCY SPEAKER-ON ;

\ Perform a note off EVENT (for the speaker).
: NOTE-OFF DROP SILENT-SPEAKER ;

\ Play a NOTE for DURATION.
: PLAY-NOTE OVER NOTE-ON MS NOTE-OFF ;

\ Play a scale starting at the keyhole c.
: PLAY-SCALE
60 1000 PLAY-NOTE \ c'
62 1000 PLAY-NOTE \ d'
64 1000 PLAY-NOTE \ e'
65 1000 PLAY-NOTE \ f'
67 1000 PLAY-NOTE \ g'
69 1000 PLAY-NOTE \ a'
71 1000 PLAY-NOTE \ b'
72 1000 PLAY-NOTE \ c''
3000 MS
;


\ This program can be run on a 16 bit Forth on MSDOS.
\ It wil also with root privileges on a 32 bit ciforth,
\ with the following addition.

WANT -syscalls-

\ Make the io-port PORT accessable, i.e. guarantee the privilege
\ to acces it. (port -- )
: MAKE-ACCESSABLE 1 1 __NR_ioperm XOS
DUP IF ." You cannot access i/o ports, become root" CR
THROW THEN ;

\ Hardware ports in use for the speaker itself and the timer connected
\ to the speaker.
: MAKE-SPEAKER-ACCESSABLE
$42 MAKE-ACCESSABLE
$43 MAKE-ACCESSABLE
$61 MAKE-ACCESSABLE
;

: doit MAKE-SPEAKER-ACCESSABLE PLAY-SCALE ;
.

\ The strength is that it really shows how to get sound from your computer
\ to the lowest level.
\ The weakness is that is is not a portable Forth program (but then,
\ how could it.).

/---------------------------------------------------------------
Post by Rick C
What I have always wanted was a simple interface to allow me to play sound files from a Forth app without the app having special privileges. I've never
found a way to do that which doesn't require paying for special development tools.
On a MS-Windows system it is easy because there is a player for midi messages
in WINMM.DLL ("Multi Media")

You only need calls to MidiOutOpen MidiOutClose MidiOutShortMsg
It worked last time I used MS-Windows. (That was Windows XP).
You can do that from d it
Post by Rick C
--
Rick C.
Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
***@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
Rick C
2021-05-02 20:33:02 UTC
Reply
Permalink
Post by none) (albert
What I have always wanted was a simple interface to allow me to play sound files from a Forth app without the app having special privileges. I've never
found a way to do that which doesn't require paying for special development tools.
On a MS-Windows system it is easy because there is a player for midi messages
in WINMM.DLL ("Multi Media")
You only need calls to MidiOutOpen MidiOutClose MidiOutShortMsg
It worked last time I used MS-Windows. (That was Windows XP).
You can do that from d it
Sorry, "d it"?
--
Rick C.

-- Get 1,000 miles of free Supercharging
-- Tesla referral code - https://ts.la/richard11209
John Doe
2021-05-02 21:07:40 UTC
Reply
Permalink
Post by none) (albert
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
Holland, the country of wooden shoes, racism, and child porn...

https://www.google.com/search?q=%22Black+Pete%22&tbm=isch

https://www.sott.net/article/375165-The-Netherlands-A-Leading-Distributor-And-
Producer-of-Child-Pornography

At least the creep has the courage to admit where it's from.
D***@decadence.org
2021-05-03 01:46:13 UTC
Reply
Permalink
Post by none) (albert
That the program need to be installed in grub is nonsense.
I never said some lame program you refer to had to be installed in
GRUB.

*I* suggested using BURG, and THAT bootloader includes access to the
motherboard sound gen without installing anything else. ALL BEFORE any
OS boots.
Jasen Betts
2021-05-03 08:19:46 UTC
Reply
Permalink
Post by none) (albert
In general the timer is used and intended as single tones and tone duration.
It is certainly not working as PWM just so.
If you have a reference to how to make it work as PWM, that would be
nice.
It is probably easier to bitbang a handshake bit on an RS232
port.
It probably is,

linux-4.19.181/sound/drivers/pcsp$ wc *
2 9 98 Makefile
239 596 5502 pcsp.c
83 254 2276 pcsp.h
117 292 2304 pcsp_input.c
15 36 327 pcsp_input.h
360 880 9315 pcsp_lib.c
164 437 4112 pcsp_mixer.c

980 2504 23934 total

about 1000 lines of code turn it into a generic mono sound device.
--
Jasen.
D***@decadence.org
2021-05-03 01:43:17 UTC
Reply
Permalink
On Sunday, May 2, 2021 at 11:22:06 AM UTC-4,
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the
Can-can song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration only.
Nonsense. The timing generator is working as a PWM DAC. It will
produce as many phonies as you establish in the audio to be
reproduced.
What I have always wanted was a simple interface to allow me to
play sound files from a Forth app without the app having special
privileges. I've never found a way to do that which doesn't
require paying for special development tools.
Horseshit. The motherboard sound gen is single tone and duration.
Period. Just like the sound in upright video games.

Maybe you are trying to access your soundcard. A completely
different animal.
Rick C
2021-05-03 03:25:33 UTC
Reply
Permalink
On Sunday, May 2, 2021 at 11:22:06 AM UTC-4,
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the
Can-can song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration only.
Nonsense. The timing generator is working as a PWM DAC. It will
produce as many phonies as you establish in the audio to be
reproduced.
What I have always wanted was a simple interface to allow me to
play sound files from a Forth app without the app having special
privileges. I've never found a way to do that which doesn't
require paying for special development tools.
Horseshit. The motherboard sound gen is single tone and duration.
Period. Just like the sound in upright video games.
Maybe you are trying to access your soundcard. A completely
different animal.
I know it is pointless to try to explain things to you, but I will explain again for the benefit of others...

What the Decadent Linux Loser is talking about it using one of the timers in the 8253 programmable interval timer as a square wave generator which is the most basic method of generating sounds using the PC speaker. That is NOT what I did.

As I explained previously, I used this timer as a PWM generator. It ran at a fixed frequency (don't ask me what frequency that was, probably 8 kHz, but maybe not. The PWM value was in essence the DAC sample. On the average the output signal would have a level proportional to this value relative to the full scale value set by the period of this timer.

The only thing remaining to be added was an interrupt from the PC clock timer which was changed from something around 50 Hz I think to 8 kHz. This interrupt would get a TSR link that would program a different value into the other timer which was the PWM value. These values were read from a file for the sound to be produced. Since these two timers working together produced what was in essence a PWM based DAC, ANY TYPE OF SOUND could be produced on a PC through the built in speaker.

The quality was rather poor and I'm sure improvements could be made to the timing and the sound, but it worked well enough that a manager recognized the modem training sounds that were being produced.

As I had said, this did not use the sound or "multimedia" card, because they still cost around $1,000 at that time and none of our PCs had one unless it was being used for a special project. This was a general lab machine that I used sometimes.

This is a simple thing that is done often on low end MCUs these days and is no big deal. There is nothing in the old PCs that precluded doing this. It worked, it happened, get over it and stop pushing your bad memory on the story. Try just once to actually understand what I just told you.
--
Rick C.

-+ Get 1,000 miles of free Supercharging
-+ Tesla referral code - https://ts.la/richard11209
D***@decadence.org
2021-05-03 05:27:56 UTC
Reply
Permalink
On Sunday, May 2, 2021 at 9:43:25 PM UTC-4,
On Sunday, May 2, 2021 at 11:22:06 AM UTC-4,
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the
Can-can song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration
only.
Nonsense. The timing generator is working as a PWM DAC. It will
produce as many phonies as you establish in the audio to be
reproduced.
What I have always wanted was a simple interface to allow me to
play sound files from a Forth app without the app having
special privileges. I've never found a way to do that which
doesn't require paying for special development tools.
Horseshit. The motherboard sound gen is single tone and duration.
Period. Just like the sound in upright video games.
Maybe you are trying to access your soundcard. A completely
different animal.
I know it is pointless to try to explain things to you, but I will
explain again for the benefit of others...
What the Decadent Linux Loser is talking about it using one of the
timers in the 8253 programmable interval timer as a square wave
generator which is the most basic method of generating sounds
using the PC speaker. That is NOT what I did.
This is NOT about what you did, you fucking twerp motherfucker.
The original post and the original poster wants to know about
utilizing the sound channel the BIOS uses on the motherboard to play
music.

I have done so. Many people have done so. It is, however,
regardless of how many times you piss and moan and call me a loser,
you loser motherfucker, a single tone generator and that's it.

So fuck off and die with your childish fucktard manipulation of my
nym, you pathetic elementary school playground bully wannabe
dumbfuck. I've got nine inches of loser to go up in your wussy boy
ass with, chump.
As I explained previously, I used this timer as a PWM generator.
It ran at a fixed frequency (don't ask me what frequency that was,
probably 8 kHz, but maybe not. The PWM value was in essence the
DAC sample. On the average the output signal would have a level
proportional to this value relative to the full scale value set by
the period of this timer.
You are an idiot.
The only thing remaining to be added was an interrupt from the PC
clock timer which was changed from something around 50 Hz I think
to 8 kHz. This interrupt would get a TSR link that would program
a different value into the other timer which was the PWM value.
These values were read from a file for the sound to be produced.
Since these two timers working together produced what was in
essence a PWM based DAC, ANY TYPE OF SOUND could be produced on a
PC through the built in speaker.
Bullshit, putz.
The quality was rather poor and I'm sure improvements could be
made to the timing and the sound, but it worked well enough that a
manager recognized the modem training sounds that were being
produced.
As I had said, this did not use the sound or "multimedia" card,
because they still cost around $1,000 at that time and none of our
PCs had one unless it was being used for a special project.
You are also stupid about sourcing. Sound cards did not cost that
much then.
This
was a general lab machine that I used sometimes.
I think you made this stupid shit up like CurdSipper Dumb did about
his meetings with the Prince.
This is a simple thing that is done often on low end MCUs these
days and is no big deal.
You are not too up on how a PC motherboards works.
There is nothing in the old PCs that
precluded doing this. It worked, it happened, get over it and
stop pushing your bad memory on the story. Try just once to
actually understand what I just told you.
You are a fucking twit and you told me nor anyone else anything.

FACT a PC speaker driven by the BIOS can produce the impression of
polyphony.

Here is one for ya, putz. It is called "swift arpeggios".

Maybe one day you will figure out what the truth is. Right now, you
don't even rate the Group W bench, boy.

Your PWM method is also a fudge on true polyphonic reproduction.

Nice try though, Dick C. Or is that Dick who didn't see?
bitrex
2021-05-03 19:35:15 UTC
Reply
Permalink
Post by D***@decadence.org
On Sunday, May 2, 2021 at 9:43:25 PM UTC-4,
On Sunday, May 2, 2021 at 11:22:06 AM UTC-4,
In article
Post by s7382
How do I modify a BIOS POST beeper from a PC to play the
Can-can song? If polyphony is possible, how do I do it?
You can find examples for that at
rosettacode.org/wiki/Musical_scale#Forth
in Forth or any other language you may prefer.
Accessing a speaker may require root privilege.
You need a classic boat ancre pc, not a tablet (duh).
Groetjes Albert
No polyphony in BIOS audio. Single tones and tone duration
only.
Nonsense. The timing generator is working as a PWM DAC. It will
produce as many phonies as you establish in the audio to be
reproduced.
What I have always wanted was a simple interface to allow me to
play sound files from a Forth app without the app having
special privileges. I've never found a way to do that which
doesn't require paying for special development tools.
Horseshit. The motherboard sound gen is single tone and duration.
Period. Just like the sound in upright video games.
Maybe you are trying to access your soundcard. A completely
different animal.
I know it is pointless to try to explain things to you, but I will
explain again for the benefit of others...
What the Decadent Linux Loser is talking about it using one of the
timers in the 8253 programmable interval timer as a square wave
generator which is the most basic method of generating sounds
using the PC speaker. That is NOT what I did.
This is NOT about what you did, you fucking twerp motherfucker.
The original post and the original poster wants to know about
utilizing the sound channel the BIOS uses on the motherboard to play
music.
I have done so. Many people have done so. It is, however,
regardless of how many times you piss and moan and call me a loser,
you loser motherfucker, a single tone generator and that's it.
So fuck off and die with your childish fucktard manipulation of my
nym, you pathetic elementary school playground bully wannabe
dumbfuck. I've got nine inches of loser to go up in your wussy boy
ass with, chump.
lolwut
Mike
2021-05-03 13:02:48 UTC
Reply
Permalink
As I explained previously, I used this timer as a PWM generator. It ran at=
a fixed frequency (don't ask me what frequency that was, probably 8 kHz, b=
ut maybe not. The PWM value was in essence the DAC sample. On the average=
the output signal would have a level proportional to this value relative t=
o the full scale value set by the period of this timer. =20
A similar technique was used in MODPlay/MODEdit, to replay 4 channels of
sampled audio via the PC speaker. Quality *was* rough, but it worked. An
actual DAC was better, or multiple DACs (one per channel) as mapped I/O
devices, printer port hacks (parallel out to a DAC) etc, and all were
supported by different "drivers" for sound output devices, including
ability to add your own.

Of course, it also covered the standard SoundBlaster too, for those that
could afford one.
--
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk | http://www.signal11.org.uk
bitrex
2021-05-03 19:39:26 UTC
Reply
Permalink
Post by Mike
As I explained previously, I used this timer as a PWM generator. It ran at=
a fixed frequency (don't ask me what frequency that was, probably 8 kHz, b=
ut maybe not. The PWM value was in essence the DAC sample. On the average=
the output signal would have a level proportional to this value relative t=
o the full scale value set by the period of this timer. =20
A similar technique was used in MODPlay/MODEdit, to replay 4 channels of
sampled audio via the PC speaker. Quality *was* rough, but it worked. An
actual DAC was better, or multiple DACs (one per channel) as mapped I/O
devices, printer port hacks (parallel out to a DAC) etc, and all were
supported by different "drivers" for sound output devices, including
ability to add your own.
Of course, it also covered the standard SoundBlaster too, for those that
could afford one.
Yep. and anything you could do with the instruction set of the 16 bit
8086 you should be able to do on a modern x86 processor in real mode
prior to entering protected mode, with a simple boot-loader that just
never enters it, all the same interval timers and timer overflow
interrupt vectors should be there.
Johnny B Good
2021-05-04 01:49:08 UTC
Reply
Permalink
Post by Mike
As I explained previously, I used this timer as a PWM generator. It ran at=
a fixed frequency (don't ask me what frequency that was, probably 8 kHz, b=
ut maybe not. The PWM value was in essence the DAC sample. On the average=
the output signal would have a level proportional to this value relative t=
o the full scale value set by the period of this timer. =20
A similar technique was used in MODPlay/MODEdit, to replay 4 channels of
sampled audio via the PC speaker. Quality *was* rough, but it worked. An
actual DAC was better, or multiple DACs (one per channel) as mapped I/O
devices, printer port hacks (parallel out to a DAC) etc, and all were
supported by different "drivers" for sound output devices, including
ability to add your own.
Of course, it also covered the standard SoundBlaster too, for those that
could afford one.
+1
--
Johnny B Good
Loading...