Borland C++ Builder - Sound
Sonification |
|
The VOTRAX speech synthesizer can talk. |
Plain vanilla code examples: |
Beep(frequency in cycles per second or Hertz, duration in milliseconds) Beep() is a "legacy" Windows API function. It is easy to use but doesn't offer any elaboration. Your code will wait for Beep() to finish before continuing to execute. In older operating systems, Beep()played through the internal 2" speaker without a sound card. In newer operating systems, Beep() plays through the sound card. |
|
beepRamp()Equal Interval Scale Optimized for Windows 7 This application explores the primitive Windows function Beep(hertz, milliseconds) in an effort to construct a beepRamp(part, whole, milliseconds) function which can be used to sonify a data set. The derived beepRamp() function allocates 100 notes to the scale, and in that sense it is more finely grained than the midiRamp(whole, part, milliseconds) function. Although beepRamp() does not offer the range of voices available in midiRamp(), the sound envelope it produces is unique. Each call to beepRamp() produces a sharp spike or click at the beginning of the note, This is sometimes louder than the note itself and and for short note durations, can be disturbing. Beep() works differently in Windows7 and in WindowsXP. In Windows7 it appears to be sent through the system sound card, producing a softer tone, limiting its range and limiting its speed of execution. In Windows XP it is sent through the primmitive 2" speaker inside (and is not subject to volume control) the box and produces a more mechanical and raspier tone. Some of the sound effects are similar to those generated by the early computer games. |
|
The MIDI Synthesizer There is a different range of playable notes for each instrument. The applications that follow assume the same range of 47 notes for each instrument. |
|
MIDI KEYBOARD COMPATIBLE WITH WINDOWS 7 - 2011
|
|
MIDI Timer - 2009 |
|
![]() |
Mini MIDI - 2005 |
MUSIC BOX A century-old steel compact disk was photographed and the photo converted to black or white using the threshold function. Imported as a bitmap, the software scans the digital tracks and analog sectors and converts the perforations into MIDI notes according to the midiRamp() function. There are 61 notes on the disk but only 47 MIDI notes, so the 61 have been compressed to 47. The application has been set to play the disk clockwise with the low notes at the outside of the disk. It is not known if this is correct, but the settings can be changed. It is also not known which tracks are intended to play which notes, or even if some of the tracks may be for drums or cymbals. Also, the image of the disk is slightly distorted which interferes with tracking. This is a proof-of-concept application, so there is much more to be done... |
|
mciSendString() Allows you to play .mid files |
|
For Windows 8, try: Type this in with the other "include.h" commands: The following files should already be on your Windows installation: |
|
PlaySound() |
|
Library of professionally recorded commercial aviation .wav files. | Free Sound Project |
These examples assume that your .wav files are NOT part of your executable For Windows 8 the format has changed. The path must be the parameter in the function call TEXT(): If your .wav file is in the same folder as your executable, try: A double quote was valid prior to Windows 7: SND_SYNC means "synchronous play" and will halt program execution until the sound stops playing. PlaySound(NULL, NULL, SND_ASYNC)will stop any playing sound. |
|
Bogey - a simple demonstration |
To import your .wav files into your executable: Put your .wav files in with your Project and Unit files. In the Embarcadero IDE: Under the New1.rc tab enter your file names: In your Unit1.cpp source code, call the sounds with: Thanks to Antonio Estevez and Remy Lebeau for this information. |
A Dice Roll with Voice Output A simple challenge to simulate the roll of a pair of dice provides the opportunity to exercise some of the AnsiString capabilities of the Visual Component Library. Invoked are the Caption, TextOut, Text and Lines properties as well as string concatenation. Images of each of the two dice appear after each roll. A voice gives the sum of the two dice using a suite of number .wav files imported into the application. |
|
![]() Standard .wav files available in Window 7 |
![]() Thematic .wav files available in Window 7 |
Wave Sound Sampler for Windows 7 |
|
Windows Speech API (SAPI) |
|
Windows Speech API |
|
Votrax Speech Synthesizer (not updated to Windows 7) |
|
VOTRAX The Votrax
phoneme chart is based upon |
|
Other Sonified Applications (not necessarily updated to Windows 7) |
|
![]() |
Flocking Crowd Sonified |
![]() |
2005 - Adam Skory's Evolutune The green triangle button is PLAY. |
![]() |
2005 - Theremin |
![]() |
Images and Sounds A list
of Wave files (wavefile.wav)
|
![]() |
Wave Harp |
![]() |
Midi Generator An updated Delphi & C++Builder MIDI component which allows the simple creation of sound effects and note sequences within an application without the need for external files or resources. TMidiGen achieves this by generating the MIDI data in memory. This update overcomes the memory allocation problems encountered with certain MIDI drivers. Reproduced courtesy of Alan Warriner. |
![]() |
Tone Generator A Delphi & C++Builder component which allows the simple creation of sound effects within an application without the need for external audio files or resources. TToneGen achieves this by generating and processing WAV waveforms in memory. Reproduced courtesy of Alan Warriner.
|