a740g / MIDI-Player-64

A MIDI player & library for QB64-PE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MIDI PLAYER 64

This is a QB64-PE MIDI player and library based on:

  • TinySoundFont (a software synthesizer using SoundFont2)
  • TinyMidiLoader (a minimalistic SMF parser)
  • Opal (an OPL3 emulator that is part of the Reality Adlib Tracker public domain player code)
  • ymfmidi (a MIDI player based on the OPL3 emulation core from ymfm)

Screenshot 1 Screenshot 2 Screenshot 3

FEATURES

  • Easy plug-&-play API optimized for demos & games
  • Cross-platform (works on Windows, Linux & macOS)
  • Everything is statically linked (no shared library dependency)
  • Demo player that shows how to use the library
  • SoundFont and FM Synthesis support

USAGE

  • Clone the repository to a directory of your choice
  • Open Terminal and change to the directory using an appropriate OS command
  • Run git submodule update --init --recursive to initialize, fetch and checkout git submodules
  • Open MIDIPlayer64.bas in the QB64-PE IDE and press F5 to compile and run
  • To use the library in your project add the Toolbox64 repository as a Git submodule

API

Function MIDI_Initialize%% (useOPL3 As Byte)
Function MIDI_IsInitialized%%
Sub MIDI_Finalize
Function MIDI_LoadTuneFromFile%% (fileName As String)
Function MIDI_LoadTuneFromMemory%% (buffer As String)
Function MIDI_IsTuneLoaded%%
Sub MIDI_Play
Sub MIDI_Stop
Function MIDI_IsPlaying%%
Sub MIDI_Loop (ByVal isLooping As Byte)
Function MIDI_IsLooping%%
Sub MIDI_Pause (state As Byte)
Function MIDI_IsPaused%%
Function MIDI_GetVolume!
Sub MIDI_SetVolume (ByVal volume As Single)
Function MIDI_GetTotalTime#
Function MIDI_GetCurrentTime#
Function MIDI_GetActiveVoices~&
Function MIDI_IsFMSynthesis%%
Sub MIDI_Update

NOTES

  • This requires the latest version of QB64-PE
  • Mixing this with QB64-PE's $MIDISOUNDFONT will not work
  • When you clone a repository that contains submodules, the submodules are not automatically cloned by default
  • You will need to use the git submodule update --init --recursive to initialize, fetch and checkout git submodules

ASSETS

Icon by Maximilian Novikov

About

A MIDI player & library for QB64-PE

License:MIT License


Languages

Language:BASIC 100.0%