-
Notifications
You must be signed in to change notification settings - Fork 39
API Reference Definitions
Maarten Janssen edited this page Apr 28, 2021
·
1 revision
- Arguments that are limited to a certain range are given as
[minValue, maxValue]
- Arguments that are one of a limited set are given as
{option1, option2 ... optionN}
- Channel arguments will show
MAX_CHANNEL
as the maximum channel number that can be used. This number will be different depending on the board you're using (9 for OPL3 Audio Board and 36 for OPL3 Duo). ThereforMAX_CHANNELS
should be read asgetNumChannels() - 1
.
#define OPL2_NUM_CHANNELS 9
#define NUM_OCTAVES 7
Pins used by OPL2 Audio Board in default constructor.
#define PIN_LATCH 10
#define PIN_ADDR 9
#define PIN_RESET 8
Operator definitions for functions using the op
argument.
#define OPERATOR1 0
#define OPERATOR2 1
#define MODULATOR 0
#define CARRIER 1
Used by getSynthMode()
and setSynthMode()
functions
#define SYNTH_MODE_FM 0
#define SYNTH_MODE_AM 1
Defines note numbers that can be used with playNote()
.
#define NUM_NOTES 12
#define NOTE_C 0
#define NOTE_CS 1
#define NOTE_D 2
#define NOTE_DS 3
#define NOTE_E 4
#define NOTE_F 5
#define NOTE_FS 6
#define NOTE_G 7
#define NOTE_GS 8
#define NOTE_A 9
#define NOTE_AS 10
#define NOTE_B 11
Drum sound definitions for playDrum()
.
#define NUM_DRUM_SOUNDS 5
#define DRUM_BASS 0
#define DRUM_SNARE 1
#define DRUM_TOM 2
#define DRUM_CYMBAL 3
#define DRUM_HI_HAT 4
Instrument type definitions used by instrument structures to distinguish between melodic instruments and various drum instruments.
#define INSTRUMENT_TYPE_MELODIC 0
#define INSTRUMENT_TYPE_BASS 6
#define INSTRUMENT_TYPE_SNARE 7
#define INSTRUMENT_TYPE_TOM 8
#define INSTRUMENT_TYPE_CYMBAL 9
#define INSTRUMENT_TYPE_HI_HAT 10
Used by loadInstrument()
to either load from PROGMEM or SRAM.
#define INSTRUMENT_DATA_PROGMEM true
#define INSTRUMENT_DATA_SRAM false
These definitions are in addition to the ones given above.
#define OPL3DUO_NUM_2OP_CHANNELS 36
#define OPL3DUO_NUM_4OP_CHANNELS 12
Synthesis modes used by get4OPSynthMode()
and set4OPSynthMode
.
#define SYNTH_MODE_FM_FM 0
#define SYNTH_MODE_FM_AM 1
#define SYNTH_MODE_AM_FM 2
#define SYNTH_MODE_AM_AM 3
- OPL2 Audio Board assembly guide
- Connecting the OPL2 Audio Board
- Connecting the OPL3 Duo!
- Troubleshooting
- Definitions
- Constructors and initialization
- Utility functions and helpers
- Instrument functions
- Register getters and setters
- OPL3Duo extensions
- Low level access
- Running OPL2 Audio Board example code on your OPL3 Duo!
- In-depth OPL2 and OPL3 programming guide
- Making a sound
- Working with instruments
- Using the OPL3BankEditor
- DosBox configuration (MIDI only)
- DosBox-X configuration
- Nuke.YKT's serial OPL2/OPL3 protocol
- Bonus project: Touch sensor piano