-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from DhrBaksteen/OPL3Duo_Raspberry_Pi
OPL3Duo for Raspberry Pi
- Loading branch information
Showing
24 changed files
with
1,762 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
if ! type "gpio" > /dev/null | ||
then | ||
echo "WiringPi was not found!" | ||
echo "Please run the build script to install the OPL2 library first." | ||
echo "" | ||
exit | ||
fi | ||
|
||
echo "" | ||
echo "Connect the OPL3 Duo! to your Raspberry Pi like this:" | ||
echo "" | ||
echo "+-----------+------+" | ||
echo "| OPL3 Duo! | GPIO |" | ||
echo "+-----------+------+" | ||
echo "| +3.3v |\033[1m 1 \033[0m|\t GPIO header connection:" | ||
echo "| GND |\033[1m 6 \033[0m|" | ||
echo "| A2 |\033[1m 22 \033[0m|\t \033[1;32m|\033[0m" | ||
echo "| A1 |\033[1m 18 \033[0m|\t ...\033[1m 5 3 1 \033[1;32m|\033[0m" | ||
echo "| A0 |\033[1m 16 \033[0m|\t -----------+ \033[1;32m|\033[0m" | ||
echo "| MOSI |\033[1m 19 \033[0m|\t \033[1;33m o o o o o \033[0m| \033[1;32m|\033[0m" | ||
echo "| SCK |\033[1m 23 \033[0m|\t \033[1;33m o o o o o o \033[0m| \033[1;32m|\033[0m" | ||
echo "| /WR |\033[1m 15 \033[0m|\t -------------+ \033[1;32m|\033[0m" | ||
echo "| /IC |\033[1m 13 \033[0m|\t ...\033[1m 6 4 2 \033[1;32m|\033[0m <-- Raspberry Pi" | ||
echo "+-----------+------+\t \033[1;32m------------------'\033[0m board edge" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* This is a demonstration sketch for the OPL3 Duo! It demonstrates how the TuneParser can be used with the OPL3 Duo! to | ||
* play music that is defined by simple strings of notes and other commands. The TuneParser can play up to 6 voices at | ||
* the same time. | ||
* | ||
* Code by Maarten Janssen, 2020-12-04 | ||
* WWW.CHEERFUL.NL | ||
* Most recent version of the library can be found at my GitHub: https://github.com/DhrBaksteen/ArduinoOPL2 | ||
*/ | ||
|
||
#include "TuneParser.h" | ||
#include <OPL3Duo.h> | ||
#include "midi_instruments_4op.h" | ||
|
||
const char voice1[] = "i96t150o5l8egredgrdcerc<b>er<ba>a<a>agdefefedr4.regredgrdcerc<b>er<ba>a<a>agdedcr4.c<g>cea>cr<ag>cr<gfarfearedgrdcfrc<bagab>cdfegredgrdcerc<b>er<ba>a<a>agdedcr4.cro3c2r2"; | ||
const char voice2[] = "i96o4l8crer<br>dr<ar>cr<grbrfr>cr<grbr>crer<gb>dgcrer<br>dr<ar>cr<grbrfr>cr<grbr>ceger4.rfrafergedrfdcrec<br>d<bar>c<agrgd<gr4.o4crer<br>dr<ar>cr<grbrfr>cr<grbr>cege"; | ||
const char voice3[] = "i2o3l8r4gr4.gr4.er4.err4fr4.gr4.gr4.grr4gr4.er4.er4.frr4gr4>ccr4ccr4<aarraar4ggr4ffr4.ro4gab>dr4.r<gr4.gr4.err4er4.fr4.g"; | ||
|
||
OPL3Duo opl3; | ||
TuneParser tuneParser(&opl3); | ||
Tune tune; | ||
|
||
|
||
int main(int argc, char **argv) { | ||
tuneParser.begin(); | ||
tuneParser.play(voice1, voice2, voice3); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.