Skip to content

Muenzuka-code/MIDI2149

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIDI2149

Arduino library for YM2149-based MIDI synthesizer. Support multi YM2149 and it should also work on AY3891x chips. It works with two YM2149 and Arduino UNO board. 中文

Dependencies

ardumidi by hairless-midiserial AY3891x

NOTICE The official version of ardumidi has bugs, check my PR. I fixed it here.

Usage

Install ardumidi and AY3891x to your Arduino IDE or add those files to your workspace. Install hairless-midiserial and LoopMIDI for playing MIDI.

Example code

#include "midi2149.h"

AY3891x psg1(A3, 8, 7, 6, 5, 4, 2, 3, A2, A1, A0);
AY3891x psg2(A3, 8, 7, 6, 5, 4, 2, 3, 11, 10, 9);
AY3891x psgs[2] = {psg1, psg2};

MIDI2149 midi(psgs);
void setup()
{
  Serial.begin(115200);
  midi.begin();
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG0_CHANNEL_A, 0);
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG0_CHANNEL_B, 0);
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG0_CHANNEL_C, 0);
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG1_CHANNEL_A, 1);
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG1_CHANNEL_B, 2);
  midi.bindPSGChannel2MIDIchannel(MIDI2149::PSG1_CHANNEL_C, 3);
}

void loop()
{
  midi.listen();
  delay(1);
}

Then enjoy.

About

Arduino library for YM2149 based MIDI synthesizer. Support multi YM2149.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published