$UNSTABLE: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Added documentation of new $UNSTABLE metacommand)
 
(Added documentation of new $MIDISOUNDFONT metacommand)
Line 1: Line 1:
The [[$UNSTABLE]] metacommand is used to enable the use of features that have not yet been made a permanent part of the language. Features hidden behind this metacommand may have breaking changes or removed between releases.
The [[$MIDISOUNDFONT]] metacommand enables MIDI support for [[_SNDOPEN]].
 
MIDI functionality is current unstable, and requires [[$UNSTABLE]]:MIDI to be able to use.




{{PageSyntax}}
{{PageSyntax}}
:[[$UNSTABLE]]: {MIDI}
:[[$MIDISOUNDFONT]]: {DEFAULT|"{{Parameter|Filename}}"}




{{Parameters}}
{{Parameters}}
* The current unstable features are as follows:
* DEFAULT indicates that the soundfont provided by QB64-PE should be used to play MIDI files.
** '''MIDI''' allows usage of the [[$MIDISOUNDFONT]] metacommand
** The provided soundfont is about 1MB in size.
* {{Parameter|Filename}} can be used to provide your own soundfont for playing MIDI files.
** The specified soundfont file is compiled into your program and is not required at runtime.




{{PageDescription}}
{{PageDescription}}
* [[$UNSTABLE]] exists as a way to allow usage of new language features before they are finalized as part of the language.
* The use of this metacommand allows [[_SNDOPEN]] to open MIDI files.
* Any languages features hidden behind [[$UNSTABLE]] may be changed in breaking ways in the next version of QB64-PE.
* The selected soundfont is what is used to play all MIDI files.
* Language features that become a permanent part of the language will no longer require [[$UNSTABLE]] to be used.
* More than one [[$UNSTABLE]] can be used in a program.




Line 31: Line 33:
{{cl|_SNDPLAYFILE}} "example.mid"
{{cl|_SNDPLAYFILE}} "example.mid"
{{CodeEnd}}
{{CodeEnd}}
{{CodeStart}}
{{Cl|$UNSTABLE}}:MIDI
' Using a custom soundfont rather than the default
{{cl|$MIDISOUNDFONT}}: "soundfont.sf2"


{{cl|_SNDPLAYFILE}} "example.mid"
{{CodeEnd}}


{{PageSeeAlso}}
{{PageSeeAlso}}
* [[$MIDISOUNDFONT]]
* [[$UNSTABLE]]
* [[_SNDOPEN]]




{{PageNavigation}}
{{PageNavigation}}

Revision as of 14:52, 11 September 2022

The $MIDISOUNDFONT metacommand enables MIDI support for _SNDOPEN.

MIDI functionality is current unstable, and requires $UNSTABLE:MIDI to be able to use.


Syntax

$MIDISOUNDFONT: {DEFAULT|"Filename"}


Template:Parameters

  • DEFAULT indicates that the soundfont provided by QB64-PE should be used to play MIDI files.
    • The provided soundfont is about 1MB in size.
  • Filename can be used to provide your own soundfont for playing MIDI files.
    • The specified soundfont file is compiled into your program and is not required at runtime.


Description

  • The use of this metacommand allows _SNDOPEN to open MIDI files.
  • The selected soundfont is what is used to play all MIDI files.


Availability

  • QB64-PE v3.2 and up (QB64 Phoenix Edition)


Examples

$UNSTABLE:MIDI

' This line is only allowed when $UNSTABLE:MIDI is used
$MIDISOUNDFONT: Default

_SNDPLAYFILE "example.mid"
$UNSTABLE:MIDI

' Using a custom soundfont rather than the default
$MIDISOUNDFONT: "soundfont.sf2"

_SNDPLAYFILE "example.mid"

See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link