Programming the Pocket Miku, Details, Part 4


XG
XG is something that Yamaha came up with, and refers to Yamaha EXtended General MIDI. This is actually the easiest way to change Reverb, Chorus and Variation, although most of these effects don’t do much that I can tell (Reverb is the most noticeable). To determine what each address changes, you need to refer to the subsequent XG Parameter Change Table.

First, look at the subtable for the XG system. Address 00 00 7E is “XG System ON”.
You need this one.

XG Parameter Changes
F0 43 1n 4C hh mm ll dd F7

F0 43 – Fixed.
1n – n = channel number (0-F). Doesn’t seem to matter which number you use.
4C – Fixed.
hh mm ll – High, middle, low address. You get this from the other tables.
dd – 1 or 2 bytes of data, determined by the address you pick.
F7 – Fixed.

Turn on the XG system:
F0 43 10 4C 00 00 7E 00 F7 // In java, no spaces!

Now, if you go to the XG Parameter Change Tables, look for the second one labeled “Effect 1”. This is for Reverb. The tables for Chorus and Variation will follow the same pattern. The first three columns give the address to write data to, and the first row is the master effect setting. For the first row, you specify which Reverb preset you want (Room 1, Room 2, Canyon) using 2 bytes. The subsequent rows access specific parameters (wet/dry, delay, filter cutoff feedback, etc.) The presets are given in the Reverb Block Effect Type table, and the Effect Parameter Lists tables describe which parameters are available for which preset (that is, if you use Room 1 you get one set of parameters, if you use White Room or Tunnel you get a different set).

Example:

Use Reverb Room 1:
F0 43 10 4C 02 01 00 02 16 F7

F0 43 – Fixed
10 – 1 + channel number
4C – Fixed.
02 01 00 – Program reverb block
02 16 – Use the Room 1 preset
F7 – End of message

Once you’ve selected the Reverb preset (Room 1), you can change Wet/Dry. Look in the table for “Hall1/2 … Room1/2 … Stage1/2…” Wet/Dry is parameter number 10. Go back to the XG table for Effect1. Parameter number 10 is at address “02 01 0B” and takes one byte of data.

Change Wet/Dry for Room 1 to 0x2D:
F0 43 10 4C 02 01 0B 2D F7  // In Java, no spaces!

As mentioned above, so far Reverb is the only effect that I can noticeably detect changing, and Wet/Dry and Feedback are the two parameters that have equally big impacts. I think I have an advantage, using Java over a commercial sequencer, in that I’ve put controls in the applet to let me interactively change parameters like Wet/Dry with a slider, so I can tell immediately what some parameter does without having to hand enter individual new values into a data entry field.

eVocaloid:
The last remaining XG system option is specifically for controlling the Pocket Miku. For this, we need to go to the Gakken document written by a guy calling himself Polymoog. The NSX-39 MIDI Guide can be found on the Otona no Kagaku website. Like the Pocket Miku Perfect Guide, this one is all in Japanese, but most of what’s in the Perfect Guide was lifted directly from Polymoog’s document.

Note that the Pocket Miku isn’t a Yamaha product, and everything specific to the Miku was created by Gakken. The following SysEx messages are Miku-specific and not described in the Yamaha documentation.

The eVocaloid has command slots that you can reprogram. You’re writing to Flash memory so that your changes will remain in effect after you turn the machine off, and you can use the Miku as a MIDI controller (sending to MIDI OUT).

I really wish there were more examples and more data tables. Some of the examples are for attaching a “keypress” sound to the buttons, checking whether the buttons are on or off, and changing the “lyrics” for what Miku sings. But the examples are kind of incomplete.

From the Yamaha MIDI spec:

Changing Phonetic symbols:

F0 43 79 00 50 1m dd … F7

F0 43 79 00 50 – Fixed.
1m – 0=replace, 1=append
dd – List of phonetic symbols (ASCII only, space is [SP], comma is [,])

That’s all we get from Yamaha, so you can see that it’s a bit lacking. Polymoog’s guide and the Perfect Guide are a little better, but not by too much.

Reprogramming one of the 15 voice slots:

F0 43 79 09 11 0A 01 0D0D0D43062973 F7

F0 – Start of SysEx string
43 79 09 11 – Reprogram Pocket Miku
0A – Enter lyrics mode
01 – Slot number (Button “A” on the front panel. See below.)
0D0D0D43062973 – Data values for the sounds “Ge ge ge no Kitaro”
F7 – End of SysEx string

(Slot number: 01-15. 1-5 = “A”-“O”; 6-10 = SHIFT+”A”-“O”; 11-15= VIBRATO+”A”-“O”)

The hex codes for the Japanese lyrics can be found on page 10 of Polymoog’s guide.

Other examples from the Perfect Guide/Polymoog’s document:

Return command slot to default:
F0 43 79 09 11 0C nn 00 F7 (“nn” = command slot number)
Assign triangle instrument voice to the Shift key:
F0 43 79 09 11 0C 11 04 652265 F7

(0C 11 = Program command slot 11)
(04 65 22 65 -> 65 06 65 converts to “play triangle”. 8-bit encoding converted to 7-bit.)

This last example is the trickiest to explain. The SysEx command “0C” needs to have the data bytes converted to 7-bits long each. Because bytes are normally 8 bits, you need to write out the data on a piece of paper, using only the lower 7 bits of each byte, and then rewrite them as 8-bit bytes. So, while the data string contains “04652265”, the original data was “99 51 65”. “0x99” = “MIDI Note ON for Channel 9”. “0x51” = “Open Triangle” from the Drum Kit instruments table. “0x65” = Note ON velocity of 101.
Reading button status (Button “A” is ON):
F0 43 79 09 11 20 00 01 F7

20 = Read buttons.
00 01 – 000000ih 0gfedcba

“A” = SW1, “O” = SW5, Vibrato = SW6, Shift = SW7, Vol Up = SW8, Vol Down = SW9

In the example, “00 01” means that the “A” button (AKA SW1) is turned on. “00 00” is “all buttons Off”. “00 04” would mean the SHIFT button is pressed.

“0304” should be interpreted as “Volume Up + Volume Down + U”, which is the same as “Turn on General MIDI”.

youtube video direct link.

Video of the Java app in action.

Advertisements
Previous Post
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: