{{fbdoc item="title" value="Generated Sound Commands"}}----
Commands for generated sound, PLAY strings, and sfxlib mix settings.

{{fbdoc item="syntax"}}##
	**Beep** [ //duration//, //pitch// ]
	**Sound** //frequency//, //duration//
	**Sound** //channel//, //frequency//, //duration//, //volume//
	**Tone** //channel//, //frequency//, //duration//
	**Noise** //channel//, //duration//, //volume//
	**Noise** //channel//, //frequency//, //duration//, //volume//
	**Note** //name//, //octave//, //duration//
	**Note** //channel//, //name//, //octave//, //duration//
	**Play** //music//
	**Play** //channel//, //music//
	**Play** //music1//, //music2//
	**Play** //music1//, //music2//, //music3//
	**Tempo** //bpm//
	//bpm// = **Tempo**()
	**Channel** //channel//
	//channel// = **Channel**()
	**Octave** //octave//
	//octave// = **Octave**()
	**Voice** //instrument//
	//instrument// = **Voice**()
	**Vol** //level//
	**Volume** //level//
	//level// = **Volume**()
	**Volume** //channel//, //level//
	//level// = **Volume**( //channel// )
	**Balance** //position//
	//position// = **Balance**()
	**Pan** //channel//, //position//
	//position// = **Pan**( //channel// )
	**Wave** //id//, //waveform//
	**Envelope** //id//, //attack//, //decay//, //sustain//, //release//
	**Instrument** //id//, //wave_id//, //envelope_id//
	**Instrument** //channel//, //instrument_id//
##
{{fbdoc item="desc"}}
	These commands synthesize sound directly through sfxlib.  ##Sound##, ##Tone##, ##Noise##, ##Note##, and ##Play## create voices.  ##Tempo##, ##Channel##, ##Octave##, and ##Voice## set defaults used by PLAY-string and generated-sound commands.  ##Volume##, ##Vol##, ##Balance##, and ##Pan## control mix levels and stereo placement.

	##Sound## accepts the high-impact classic form ##Sound frequency, duration## and the explicit channel form ##Sound channel, frequency, duration, volume##.  When both arguments are integers, duration is interpreted as the PC BASIC timer-tick value.

	##Wave## defines a waveform id.  The currently supported waveform values are:
		- ##0## sine
		- ##1## square
		- ##2## triangle
		- ##3## saw
		- ##4## noise

	##Envelope## defines an ADSR envelope using seconds for attack, decay, and release, and a ##0.0## to ##1.0## sustain level.  ##Instrument## can define an instrument from a waveform and envelope, or assign an instrument to a channel.

	The channel-oriented commands use sfxlib's channel table.  Channels are zero-based.

{{fbdoc item="ex"}}
	See ##examples/sfxlib/basics-01-generated-sound.bas##, ##examples/sfxlib/basics-02-play-strings.bas##, ##examples/sfxlib/basics-03-channels-mix.bas##, ##examples/sfxlib/basics-04-instruments.bas##, and ##examples/sfxlib/showcase.bas##.

{{fbdoc item="target"}}
	- On headless or diagnostic runs, ##SFXLIB_DRIVER=null## can be set before program startup to use the null output driver.

{{fbdoc item="diff"}}
	- New to ""FreeBASIC"".

{{fbdoc item="see"}}
	- ##[[KeyPgBeep|Beep]]##
	- ##[[KeyPgMusic|Music]]##
	- ##[[KeyPgSfx|Sfx]]##
	- ##[[CatPgSfx|Sound Library Reference]]##

{{fbdoc item="back" value="CatPgSfx|Sound Library Reference"}}
