beepmusic

所属分类:其他
开发工具:C
文件大小:0KB
下载次数:0
上传日期:2024-03-05 01:19:38
上 传 者sh-1993
说明:  用C编写的小型Windows音调生成器。在键A0-B7中播放单个音符或序列。
(A small Windows tone generator written in C. Play individual notes or sequences in keys A0-B7.)

文件列表:
BeepMusic.exe
beepmusic.h
demo.c

# A small Windows tone generator written in C. Play individual notes or sequences in keys A0-B7. All you need to do is ```#include "beepmusic.h"``` after placing it within your project source directory. After you have included the header file, you will now have access to 96 #define constant floating point values which contain the frequencies for keys A0-B7, as well as functions for easily playing individual notes or random sequences. This library is an abstraction of the following Windows function... ``` BOOL Beep( [in] DWORD dwFreq, [in] DWORD dwDuration ); ``` By including ```beepmusic.h``` you can call these functions. ```void PlayNote(float key, int length)``` ```void PlayRandomSequence(int numberOfNotes)``` ```void PlayRandomSequenceAtFixedRate(int numberOfNotes, int rateInMilliseconds)``` Each of these functions will call ```Beep(DWORD dwFreq, DWORD dwDuration)``` under the hood and allow you to precisely set the desired key and length of every note that is played. By using one of the random sequences, you can specify the number of notes and a fixed length that will be used when playing random notes between A0-B7. It should be noted that the original Windows function is synchronous when sending instructions to the computer speaker, which means that you cannot stack these sounds across different threads to play multiple notes on top of each other. A demo program is also included that demonstrates two custom sequences, as well as two random sequences. # Future Plans - Major and Minor scales for playing back random sequences. - Importing and Exporting MIDI.

近期下载者

相关文件


收藏者