Posts Tagged ‘chiptune’

Arduino MIDI Synth Demo Preview (square + noise) [download]

Tuesday, October 30th, 2018

Up to 15 notes at once on an Arduino using no timers! Well, the quality drops a lot as the number of playing notes increases, but still!

[Watch in HD]

This is a demo of a MIDI synth I’m developing for the Arduino. Its sound is currently very basic – it has no concept of different instruments, can only produce square waves and noise, and each MIDI channel can only be at one of 3 different volume levels. It has no fixed sample rate, and is always producing a new sample as quickly as possible, which is slower when more notes play at once (in practise, the sample rate ranges from about 20 KHz down to about 6 KHz).

It supports pitch-bends, modulation, monophonic/polyphonic MIDI channel mode, and some percussive notes. It also recognises some sysex messages, including GM/GS/XG “reset” messages and GS/XG messages to set a MIDI channel’s percussion mode.

To use the code yourself (hardware info):

If you want the Arduino to accept MIDI data from “real” MIDI hardware (through a MIDI socket), you’ll need to build a circuit with an optocoupler and connect that to the Arduino’s serial RX port, and change #define UseRealMIDIPort False to #define UseRealMIDIPort True (this affects the baud rate used). Due to laziness, while testing, I used a program called “Hairless MIDI<->Serial Bridge” and the virtual MIDI cable driver “MIDI Yoke” to send MIDI data straight over the Arduino’s USB serial connection, instead of building the proper circuit.
The code controls one “port” on the Arduino (a group of 8 pins determined by the specific Arduino board model), which connects to an 8-bit DAC (a simple R2R resistor ladder) to give an 8-bit audio output. I’m using port C on the Arduino Mega, because that neatly corresponds to digital pins 37 (LSB) to 30 (MSB), but it may work on other Arduino boards as long as there is a port where all 8 bits are mapped to digital pins, with minimal changes to the code. The output port (PORTAudio and DDRAudio) would need changing to one consisting of 8 usable pins, and the maximum number of playing notes at once (NumSoundChans) could either be reduced (will save CPU time and memory) or, in the case of the Arduino Due, increased.

You can download the code for the current version here (13.2 KB). You will also need the Fast Division library (info). Note that the code includes most of the above hardware info in the form of comments. =)

P.S. The MIDI in the video is being played on MIDITester. I did not make the MIDI, and I don’t know who did. Please, people, at least credit yourself in the metadata ;_;

Testing different wave tables for Arduino MIDI synth

Monday, October 29th, 2018

I’m working on an Arduino MIDI synth, and just tonight, I tried to add support for complex wave shapes (previously, it was only square waves and noise). Since I’ve now got enough working to be able to listen to these tiny (8-sample) lookup tables for different waveforms, I thought I’d make this video to show what they sound like. =)

(Also, I finally found a good use for block Unicode characters!)

[Watch in HD]

[Touhou] Remilia’s Theme, Chiptune-Style (+ Random Intro)

Wednesday, May 14th, 2008

Turns a bit “Master Spark” at the end.
Remilia’s theme starts at 0:30 seconds and is called “Septette for a Dead Princess” (「亡き皇女の為のセプテット」), from Touhou 06 “Embodiment of Scarlet Devil”, rearranged a little and whatnot. It has some little intro at the begining to show off the different sounds. That’s all this was originally going to be, then I decided to take it further. =D

This is a step up from the usual ‘bleeper’-style stuff I make. It sounds like some ancient games console’s music.

This is the latest (not quite yet released) version of my Bleeper Music Maker. Well, 4 of them, running together! One does percussion (noise), one does the melody of Remi’s theme (triangle), and the other 2 share the same file but one’s playing Note 1 (bass, square) and the other one’s playing Note 2 (some weird harmonizing melodies I made up).

On this new version (revision 130) (I’ll probably release it today or tomorrow), you can change the sound FMOD creates from being only square. Also there’s a new mod, “Synchronized Play”, which makes it start playing at a certain time. Set them all up to start at the same time and you can easily get them all to play in sync with each other. =D Oh, and FMOD doesn’t make annoying clicking noises when going from note to note anymore if you set Note/Silence Ratio to 100% (still does when going from note to silence or vice versa, though ><).

MP3 download is here.
(2.43 MB, 1 min 31 secs)
(Sorry about the slow download speed…)

Ancient 8-Bit-style FM MIDI Synth plays Touhou 08 (IN) MIDIs

Tuesday, March 4th, 2008

The soundcard in this old computer has a very electronic-sounding, “8-Bit style” MIDI synth on it, which sounds really cool if you’re a chip-tune fan. I show it off by playing some MIDIs from “Touhou 08: Imperishable Night” (and a couple of others) using it, through my mini hi-fi. The percussion is especially electronic-sounding. =D

As I’ve said in the video, I’ve already made MP3s of all the Imperishable Night MIDIs using this synth. You can find them here:

http://somethingunreal.homeip.net/hosted_audio/AncientMIDISynth.html

The soundcard is an old Creative Sound Blaster type, by the way. It’s capable of having a maximum of 16 notes playing at any one time. However, there’s something strange about it – if there are 16 notes starting at the same time, not all will be played. It’s like it can only cope with about 4 notes starting at the exact same time. I gave a little more info about the computer at the start of the video. ;)

P.S. Don’t ask me what happened at 05:55. =P