$MIDISOUNDFONT: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 21: Line 21:


{{PageAvailability}}
{{PageAvailability}}
<!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no -->
<gallery widths="48px" heights="48px" mode="nolines">
<gallery widths="48px" heights="48px" mode="nolines">
File:Qb64.png|'''none'''
File:Qb64.png|'''none'''
Line 29: Line 30:
File:Osx.png|'''yes'''
File:Osx.png|'''yes'''
</gallery>
</gallery>
<!-- additional availability notes go below here -->





Revision as of 00:32, 5 February 2023

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"}


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


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