[NFBCS] Real-time sound generation on Windows/Mac/Linux

Lewis Wood lewislwood at gmail.com
Thu Oct 19 21:51:56 UTC 2023


>From what I understand from the Docs here:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement

The Browser will play and html media tag. The media tag can play any io
stream.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement

So that stream can be coming from your midi device you configured yourself.

Far as clicks simple audio can play in a loop, easy javascript.

Lewis Wood
lewislwood at gmail.com






-----Original Message-----
From: NFBCS <nfbcs-bounces at nfbnet.org> On Behalf Of Doug Lee via NFBCS
Sent: Thursday, October 19, 2023 3:46 PM
To: NFB in Computer Science Mailing List <nfbcs at nfbnet.org>
Cc: Doug Lee <dgl at dlee.org>
Subject: [NFBCS] Real-time sound generation on Windows/Mac/Linux

In the days of DOS, and even Windows through XP, I wrote and used little
background programs that generated clicks for various system events, such as
incoming bytes on a serial port, calls to a certain software or hardware
interrupt, etc. I also had a small program that helped me analyze file
formats by producing extremely short tones, one per byte, pitch representing
the values of the byte from 0 through 255.

All of these utilities used direct PC speaker hardware access. Nowadays of
course, that is no longer practical; and ironically, as technology improved,
my ability to do this little thing has wayned.

So now I finally get round to asking: Does anyone have a recommendation for
a tool or package to use for these two things? Compatibility with Windows. I
want to do these things specifically:

1. Generate a small click for an event, with the understanding that
thousands of these events may occur in one second.

2. Generate either a very short tone, or start a short tone with a way to
shut it off or replace it on demand, again with the understanding that this
will be a continuous stream of sound.

A very nice-to-have would be the ability, for item 2, to pick the wave form
- sine, exponential, sawtooth, etc. Another nice-to-have, almost a
requirement, is the ability to generate any number of these simultaneously,
possibly with a balance position between channels.

Now, for what I have tried or researched:

Sound Exchanger (SoX): Very good at making sounds to spec, but bad at
real-time continuous updating of what to produce, unless I missed a trick
somewhere.

FluidSynth: Says it can do real-time sound but is based on MIDI, which seems
like an unnecessary complication for this.

CSound: Steep learning curve but says it can do real-time sound. This is my
first intended attempt, if nobody has a better idea.

Other packages I've heard of but not tinkered with or researched
extensively:
Faust, which I believe is a redesign or wrapper for Supercollider.
Overtone.
Reaktor, but I believe that costs $200 and I don't know if it does what I
want.

I also read of a project called Loomer but don't have enough info to know if
that belongs in my list.

Any and all thoughts most welcome.

-- 
Doug Lee                 dgl at dlee.org                http://www.dlee.org
"The U. S. Constitution doesn't guarantee happiness, only the pursuit of it.
You have to catch up with it yourself." --Benjamin Franklin

_______________________________________________
NFBCS mailing list
NFBCS at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for NFBCS:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/lewislwood%40gmail.com




More information about the NFBCS mailing list