How to replace the windows `beep` sound

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

PaulDaMacMan
Posts: 683
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: How to replace the windows `beep` sound

Post by PaulDaMacMan » Sat Jan 18, 2025 12:29 am

Its not an OS issue, MC, RR, LC never had the built-in ability to play sound sample pitch-shifted to different notes (unless you include 'beep' sine-waves on some OSes)

There are a few ways to do realtime(ish) interactive musical sound...

On Windows 10 you can still use the very old Win32 API MCI Strings (Media control Interface) to play MIDI files using the systems MS Wavetable Synth (much the same as the low-quality, 30+ year-old Roland sound bank that still comes with macOS too, inside of CoreAudio framework). Using MCI there may be some delay while it loads up, before playback the first time, not an ideal solution.

Haven't created anything for doing sheet music (although I have made a set of notation symbols as SVG icon family). but I do have a bunch of Music, MIDI, and Soundfont related things I've worked on / shared. Extensions and scripts that should work with LiveCode (although not test in the latest version 10 or LC Create, because I don't have a subscription).

A few of these things only work on macOS (CoreMIDI/CoreAudio) like this using CoreMIDI: https://www.youtube.com/watch?v=s_knX8mJg1c
but some are cross-platform.

Piano Widget is for Musical UI (so you don't need to build one from graphic objects) and it works on the platforms just fine (including web):
https://github.com/PaulMcClernan/OpenXTalk-Piano-Widget

The demo for that on LiveCode share site has a two octave set of piano sound small, super-low-quality samples included embedded within the stack, here: https://livecodeshare.runrev.com/stack/ ... Demo-1-3-6
It's very lo-fi but it serves the purpose for the demo, and it works with the sound player that's already built into the engine.

Piano widget works much better with a real / software sampler/synth as a playback back-end:
https://www.youtube.com/watch?v=E0ByYriKI3M

This here is the extension you would want to use for cross-platform playback, it wraps the FluidSynth software sampler instrument, and I've tested it on Mac, Win, and Linux:
https://github.com/PaulMcClernan/OpenXTalk-FluidSynth
That uses SoundFonts .sf2 or (DownlLoadable Sound) .DLS sound banks to play MIDI. you can find some free super-high-quality Soundbanks to use with it on the net. Another option for playback could be using external command-line players like TMidity, or WildMIDI.

Also, there's a library called MakeSMF. PlayPMD by a a person occasionally on these forums 'UDI' that allows you to use a superset of HyperCard's 'ABC' text style music-notation (''playSenences') and translates it into a standard MIDI file that you can playback with the player of your choice (the FluidSynth extension above can play MIDI files).

Also I wrote this library that tries to tie much of that all together, and provides utility functions for reading patch names from Soundbank files, working with lists 'General MIDI' instrument names, note names, MIDI continuous controllers, etc. here:
https://github.com/OpenXTalk-org/org.op ... neralmusic
Unlike my others works that were made with Extension Builder, this extension is a script-only stack library.

All of the stuff I mentioned here are free and open-source. Stuff I created listed above is all GPLv3, so it will stay open-source (the others I believe are more liberal licensed).
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply