Bokaro P ni Naritai, vol. 4

(Images used for review purposes only.)

Ok, I now know what’s going on with the Vocaloid Producer packaging. For the first three volumes, the DVD was sealed inside a clear plastic cover sheet that also acted as filler packaging that had the same width and height dimensions as the paper magazine. Either this was too expensive an approach to maintain for the entire series, or the publishers figured it was bad for the environment. Regardless, starting with volume 4, the packaging holding the DVD clam shell in place is recycled/recyclable corrugated cardboard. So, yes, the series will continue to be taught via movie files on the DVDs, and include the highlight pickup artist videos and supplementary MMD model files. I should also mention that the DVDs have roughly 40 short voice samples each of Rana introducing herself, counting to 10, and repeating the Japanese alphabet. I’m not sure yet if the voice samples are going to be incorporated in a later lesson, or if they’re just there for filler.

The magazine has a short interview with Vocaloid musician Shoegazer; the introduction of a new supporting character, Jasmine; a discussion of how to read sheet music; and mentions of Monaca:Factory and the V Flower Vocaloid package. The printed tutorials again follow the movie files on the DVD.

For Vocaloid, the lesson this time involves using the Control Parameter window to vary Pitch, Dynamics and Velocity on an arbitrary basis to make Rana’s vocals sound more realistic throughout the song.

Last time, I said I wished the writers would get into the process of writing music from scratch, rather than having us manipulating pre-recorded music samples. Well, that’s what we get now in the Singer-Song Writer tutorial. The lesson uses an existing song file, but we’re taught how to change MIDI instruments (from a piano to finger bass), enter notes into the piano roll, and use the strip chart function for setting velocity on a note-by-note basis. The demo says that it’s possible to change velocity as if you have a slider control, but that function doesn’t seem to be available in the 32-bit version of the application. Or, at least, it doesn’t work the way the demo says it’s supposed to.

The MMD section consists of positioning Rana for a marching-dance style walk cycle. I’m still working on this part so I haven’t seen what the final results look like. Positioning is time-consuming, but the software does take  lot of the tediousness out of the process.

(MMD as used for giving Rana the walking cycle.)

As mentioned before, the tutorial videos are between 6 and 9 minutes long. However, I have to pause each one in order to read the Japanese captions, and then there’s the time needed for actually taking the described actions in the given application. As a result, I’m spending at least an hour per video to complete each lesson, three lessons per volume. This is just something to keep in mind if you decide to buy the disks.

I can read Japanese, but there are a lot of kanji that I don’t know and have to look up. Rather than spend a lot of time reading all the fine print, I skim over sentences or whole pages that don’t directly have information I deem important. Sometimes, this is a bad thing. One case in point surfaced when I started running Vocaloid this week to do the practice lesson. I got a message saying that the license activation is going to expire on the 28th. Given that the entire point of buying these volumes is to have running software, I began wondering if I’d done something wrong during the activation. The online English help pages didn’t help. Then I remembered that volume 3 included another sheet of serial numbers, so I hunted around for instructions on how to activate Vocaloid (go to the Start menu in Windows, open the Vocaloid folder and choose “Activate”). Eventually I figured it out, got the serial number entry screen to pop up, and entered the code from the third volume. This gave me a message saying that the first activation still had 2 days left to go, and if I clicked “Ok”, the next activation period would start as of right now. Meaning that even though you’ve paid for the first disk and have all three applications in your hands, unless you keep buying every odd-numbered volume (each volume comes out 2 weeks apart, so, 2 volumes a month, and activation is in 1-month chunks) the programs will expire and you’re screwed unless you drop $100 each for the commercial packages. I’m not really happy with that thought… Even if I decide that I don’t want a specific volume because it has nothing else useful for me, I still have to pay for it if it has the next set of serial numbers. Sigh. (Then again, I expect to get the full series just to send in the proof of purchase seals to get the commercial version activation codes. But still, it’s the principle of the thing.)

I want to be a Vocaloid Producer, vol. 4, 1,500 yen, plus tax.


Programming the Pocket Miku, Details, Part 5

Not all SysEx messages follow the exact same format. What they do share in common is that they start with “F0” (start of SysEx) and end with “F7” (end of SysEx).

The following information is taken from Polymoog’s NSX-39 MIDI Guide (in Japanese). The SysEx messages here are used to directly take advantage of the Pocket Miku hardware (specifically, changing lyrics strings, and using the Miku as a MIDI controller. The format is:

F0 – start of message
43 – Manufacturer ID (Yamaha)
790911 – Code to access the NSX-39 lyrics system
do d1 d1… – data
F7 – end of message

Or, in string format (remove the spaces before using in Java):

F0 43 79 09 11 do d1 d2 d3 d4 d5 … F7
Example: F0 43 79 09 11 01 F7  // Get Version

Contents of the data string are:

Request Version Data          d0=0x01 d1=N/A
Version Data Reply            d0=0x11 d1=NSX-39 version data
Lyrics Entry                  d0=0x0A d1=lyrics slot number   d2=character data
Request Command Slot Details  d0=0x0B d1=command slot number
Command Slot Reply            d0=0x1B d1=command
Change Command Slot           d0=0x0C d1=command slot number  d2=command
Command Direct Entry          d0=0x0D d1=command
Lyric Number Data Request     d0=0x0E d1=N/A
Lyric Number Data Reply       d0=0x1E d1=Slot number          d2=Slot data
Lyric Details Request         d0=0x0F d1=Slot number
Lyric Details Reply           d0=0x1F d1=character count      d2=character 1, etc.
Switch State                  d0=0x20 d1=000000ih             d2=0gfedcba
NSX-39 Status                 d0=0x21 d1=Status


Using SysEx to upload new lyrics to the NSX-39

There are 16 lyrics slots, numbered 0x00 to 0x0F, and slots 1-15 can hold up to 64 characters (15*64=960 characters total) each. (Slot 0 sends the lyrics to the USB port as MIDI OUT).) The data is written to Flash memory so the lyrics will be recalled on power On.

d0 = 0A
d1 = slot number (1-15)
d2-d65 = phoneme number data
Example: Writing “Konnichiwa Arigato” to the “A” button (slot 1) (Mistake in NSX-39 MIDI Guide on page 8.)

F0 43 79 09 11 0A 01 09 01 7B 40 36 77 00 70 0A 2D 02 F7

You don’t write to slot 0, since it’s used to transfer data to CPU RAM.
Slot 0 isn’t selectable from the NSX-39 front panel.

Slots 1-15 are stored to FLASH ROM. Writing to these slots can take several milliseconds, during which time the NSX-39 can not respond to MIDI messages.

During the write, the SysEx message status will read: F0 43 79 09 11 21 01 F7 (i.e. – Busy)
When writing is complete, it will change to: : F0 43 79 09 11 21 00 F7 (Not busy)

Slot 1-5: “A”, “I”, “U”, “E”, “O”
Slot 6-10: SHIFT+”A” – SHIFT+”O”
Slot 11-15: “VIBRATO”+”A” – “VIBRATO”+”O”

The phoneme list appears on page 10 of the MIDI Guide. You can have up to 64 characters per slot. The character numbers are 2-character pairs, and the data string is terminated with “F7”.
When the string is written to the NSX-39, the playback pointer will default to the first character in the list (position 0).


Using SysEx to Enter Commands

The Pocket Miku uses a 28-bit instruction format to customize the front panel buttons and keyboard operations.

d0 = 0D
d1-d4 = command (d1=bits 27-21, d2=b20-b14, d3=b13-b7, d4=b6-b0)

The full command table is on page 23 of Polymoog’s MIDI Guide.

Norma Model: 0A 08 00 00
Do Rei Mi Mode: 0A 08 01 00
Slot Select: 09 03 00 00 09 03 00 (slot number)
Slot select lets you change data for that slot.
Lyric Playback Location Select: 09 02 00 00 09 02 00 (location)
Changes the playback pointer to (location)
Note ON: 08 09 00 00 08 09 (Note #) (Velocity)
Note OFF: 08 08 00


Programming the Command Slots

The command slots are numbered 0-127, but only 0-119 are writable.
One slot can contain up to 255 characters.
Command slots are messages that are sent when a specific event occurs, such as pressing the SHIFT key or releasing VIBRATO+”A”. Each slot corresponds to one event.

d0 = 0C
d1 = Slot number
d2-d5 = 4-byte command

If an incorrect command is issued, the status message F0 43 79 09 11 21 02 F7 will indicate the error status (21 02 = error).

You can reset the command slot with F0 43 79 09 11 0C slot number F7

To clear the command slot: F0 43 79 09 11 0C slot number F7 0C 01 00 00 F7

The command slot table is on pages 28-30 of Polymoog’s MIDI guide.


Reading the Command Slots, Misc.

d0= 0B / 1B

To read a command slot, send F0 43 79 09 11 0B F7
The results will be returned on F0 43 79 09 11 1B …. F7

In a related fashion, getting version information (01), Lyric Number (0E) and Lyric Data (0F) have matching send/receive pairs (01/11), (0E/1E) and (0F/1F). In Java, to receive data from the NSX-39, you have to open up a transmitter, attach a sequencer to the transmitter, then read the track object to see if any data has arrived. It’s very convoluted.

The command slot table is on pages 28-30.


Reading the Switches

d0 = 20
d1 = 000000ih
d2 = 0gfedcba

bits 0-1 of d1 show the states of switches SW8 and SW9. bits 0-6 of d2 show switches SW1-SW7. When the user presses one of the front panel buttons, the associated bit will toggle between 1 and 0. This seems to be a read-only command.

SW1 = A
SW2 = I
SW3 = U
SW4 = E
SW5 = O
SW6 = Vibrato
SW7 = Shift
SW8 = Vol. Up
SW9 = Vol. Down

The following is transmitted by the NSX-39 when the “A” button is pressed.

F0 43 79 09 11 20 00 01 F7


System Status

The system status message indicates the current MIDI status of the NSX-39. This is automatically returned by the NSX-39, so to read it in Java, you need to open a Transmitter and read Sequencer Track data.

d0 = 21
d1 = status
(status: 00 = Not busy, 01 = Busy, 02 = Error)

Received error status:

F0 43 79 09 11 21 02 F7


Customizing the NSX-39 (Using the 0D command mode)

Certain operations can only be performed if the Pocket Miku is in NSX-1 Compatibility Mode, while other commands only work if Compatibility Mode is off. This mode can be switched using the SysEX command entry message (0D).

ON – 0A 06 01 00
OFF – 0A 06 00 00
MIDI Reset – 0A 07 00 00

Example, turning Compatibility Mode ON:

F0 43 79 09 11 0D 0A 06 01 00 F7

Example, turning Compatibility Mode OFF:

F0 43 79 09 11 0D 0A 06 00 00 0A 07 00 00 F7

If you want to use the NSX-39 stylus to control an external device without the unit making sounds itself, first switch to Normal mode:

F0 43 79 09 11 0D 0A 08 00 00 F7

Then, tell the NSX-39 to send the character data to Lyrics Slot 0:

F0 43 79 09 11 0A 00 mm F7

where “mm” is the Japanese phoneme character list you want to play, up to 64 characters. Now, when you touch the stylus to the carbon keyboard, the character data will go out to the external MIDI device.

While playing a lyrics string to an external device, you can decide to reposition the “current character pointer” to jump to a different point in the string. The commands are:

Set pointer: 09 05 00 00
Revoice: 08 01 00 00
Pointer increment: 09 01 00 00

Full string example:

F0 43 79 09 11 0D 09 05 00 00 08 01 00 00 09 01 00 00 F7

Adding a “click” sound when you press a button

The following is an example of the DIRECT_MIDI_3 command mode coupled with changing the instructions stored at a specific command slot. Command slots generally refer to push button status, such as switch 1 pressed, or SHIFT+ switch 2 released. In this mode, you send three 8-bit characters as four 7-bit characters with padded leading 0’s. For example, say you want to play the Open Triangle instrument from the Drum Kit sound bank when you press the SHIFT key. The normal three 8-bit string would be:

99 51 65

Where 99 = NOTE ON for channel 9
51 = note number for the Open Triangle
65 = The value to use for velocity

Removing bit 8 of each of the 3 bytes and padding with leading 0’s gives you the equivalent four 7-bit string of:

04 65 22 65

Then, to specify SHIFT pressed, use CS_SW_7D (11) from the table on page 28 in Polymoog’s MIDI guide as follows:

F0 43 79 09 11 0C 11 04 65 22 65 F7

To return the SHIFT key to normal, use:

F0 43 79 09 11 0C 11 00 F7

(0C = Change Command Slot)
(11 = Slot #11 : CS_SW_7D : SHIFT key pressed)


Backgammon, Part 11

The yahoo game has 4 clear behavior patterns in the start game:

1) Only move to new points if White can make a block without leaving a blot.
2) Hit opponent blots when possible.
3) Move to existing blocks if possible.
4) Move the stones out from White’s back field, leave blots if unavoidable.

In the mid-game:

1) If Red moves the stones on point-24 forward, put White’s stones behind them.
2) If Red has blots in his home field, it’s ok for White to leave blots, too.
3) Bring stones into White’s home field.
4) Cover blots if possible.
5) Leave at least 1 stone behind Red’s stones until switching to a running game.
6) If White has blots in his home field, don’t hit Red’s blots.

The key with pattern 5 is that White wants to jockey for the running game, while keeping open the chance of hitting Red’s blots if it looks like a good idea. So, as long as the computer has other stones available to move for rolls that come up 5’s and 6’s, it will leave the “back game anchor” in place. However, if there aren’t any other choices, White will use the 5 or 6 to bring the anchor forward and go to a running game.

In the end game:

1) Stones that are in the home field get moved closer to the tray first.
2) High rolls are used to bring the closest stones outside of the home field in home.
3) If bearing off, try to bear off at least one stone.
4) Bring stones in from point-6 if nothing else is available.

For pattern 3, if the computer has a stone on point-5 and nothing on 3, and rolls a 2-3, it will take the 5-point stone to the tray, rather than moving in two stones from point 6 (which is actually what you should do in a normal game).

These patterns do lead to some stupid choices occasionally. In order to hit a blot, it will sometimes leave an unprotected blot in it’s own home field where you can land on it. Or, if you put White on the bar while you’re bearing off, for a running game, White will often use one die to get back on the board, but instead of using the second die for running the same stone back home, it will move a stone in its home field closer to the tray. It’s this last goof that causes the computer to lose with a “gammon” (no stones borne off) or a “backgammon” (no stones borne off and one stone still in Red’s home field).

The computer does get “lucky” in about 3 games out of 10, and I have lost with a gammon because I was playing a back game and waiting for a blot to open up (which never happens). But, more often than not it misses clear chances for escaping from its back field when I’m preparing to build up a rolling wall. (I.e. – White has a blot on point-1, and I have blocks on points 2, 4, 5, 6, 8, 9. It rolls a 2-6, but instead of escaping, it jockeys its stones in the home field to be closer to the tray. In the next turn I block point-3 and then go on to win the game). About half of the games I win are ones where White stupidly uses a blot to put me on the bar, and then I hit the same blot to put it on the bar instead, while I have a full 6-point-wide wall on my side. With a better AI, my win rate might be closer to 4 of 10.

Then again, as I’ve complained before, the dice in the yahoo game aren’t random. Double 6’s come up way, way too often, and in the start game phase I keep seeing the same roll combinations game after game. There’s a lot of things that I think could have been done better. But, what do you expect to get for free?

To be continued.

Programming the Pocket Miku, Details, Part 4

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).


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.

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.

Backgammon, Part 10

(A balanced home field for Red. He can remove 1 stone for the turn for each 4, 5 or 6 on the dice. Otherwise he just moves the stones from point-4 in closer to the tray.)

Let’s look at a couple situations. First, let’s say that you played a back game, succeeded in creating a rolling wall, trapped your opponent on the bar, then worked at keeping an even number of stones on the points farthest from the tray. This is a very balanced home field. No matter what you roll, you can take a stone off that point and put it in the tray immediately. If you’re lucky, you’ll get a 6 in the first roll, like 6-3 or 6-1. After both stones from point-6 are gone (one to the tray, the other to a lower-numbered point), any 5’s and 6’s you roll can be used to take the stones off the 5-point. 4’s, 5’s and 6’s clean off the 4-point, and by this stage you’ve pretty much won the game. High doubles work pretty much the same way.

(Unbalanced board for Red. Very top heavy. White makes a break for the running game.)

Next, we get the above board. Here, Red was just trying to get his stones into his home field as fast as he could, meaning point-5 and point-6 are top-heavy, when White broke into a running game. Red is stuck with what he’s got and needs to make the best of the situation. The two general rules are:

1) Bear off as many stones as you can when you can.
2) Bring the farthest stones in when you can’t follow rule 1.

Say Red rolls a 1-4. He doesn’t have anything on the 4-point, so he moves a stone from 5 to 1, then to the tray. If he rolls 6-1, then take stones from both points to the tray. Roll double 4’s? Take 4 stones from the 6-point and put them on the 2 point. When you clear out the lower points, start moving stones from point-6 to the lower points.

The purpose of this approach is to capitalize on high-doubles. Granted, the chances of getting double 6’s is 2.5%, but after you clear off point-6, you’ll profit from double 5’s as well (letting you take 4 stones off per turn), at a 5% chance for double 5’s or 6’s. Move the stones off point-5 too, then you profit from any high doubles, plus any regular roll including a 4, 5 or 6.

In other words, the closer your “center-of-balance” is to the tray, the better your chances of taking 2 stones off per turn, and the more impact doubles will have. Naturally, your opponent will be using the same strategy, so the winner will be the one that gets more 6’s, 5’s and high doubles. You just want to be sure that you’re in a position to benefit from them if you get them. The odds are low, but if you play enough games you can turn things to your favor occasionally.

(Sometimes, how you play the dice doesn’t matter much.)

Having said that, what about this board? Red rolls a 1-2. Does it really matter how you move? At this point, not really. You could take off one stone from point-3, or take one from 2 and move point-4 to point-3. The really big impact from moving stones inward occurs with stones on points 4 through 6 because the average for a 6-sided die is 3.5. That is, if you have a stone on point-6, there’s only a 1/6th chance of getting a 6 to remove it in one turn. Any other number and you have to move the stone closer to the tray. With an average of 3.5, the stone will probably go from point-6 to point-2, and then go to the tray in the next roll (if it’s the only stone on the board, a roll of anything 2 and higher will make it go to the tray, which is a 5/6th’s chance).

Moving the stone on point-4 to point-3 does mean that dice rolls of 3 and better will take off 2 stones at a time (3-5, 4-6, etc.), and that’s a 66.6% chance. But, that means that you have nothing on point-1 or point-2, so rolling a 1 or a 2 forces you to move stones from 3 closer to the tray without bearing anything off (33.3% chance on each die). The guideline here is to prepare yourself so that if you get doubles you can bear all remaining stones off in one turn, while maximizing the number of stones you can take off in the next turn. In general practice, in the above board with a roll of 1-2, taking one stone from point-3 to the tray will let you finish the game in 3 more turns, and occasionally in 2 turns. Very rarely, it may take 4 turns. If you’re WAY ahead, or WAY behind your opponent, that extra one turn isn’t going to make a difference.

To be continued.

Bokaro P ni Naritai, vol. 3

(Images used for review purposes only.)

I want to be a Vocaloid Producer, vol. 3, 1,500 yen, plus tax.
One reason I expect that this series is going to stop coming with the DVD-ROMs is that their instructions for cutting the proof-of-purchase seals, for use in getting the full-version serial numbers at the end of the series run, states that the seals are on the inside of the hard cardboard cover sheets for volumes 1-3, and then on a different sheet for the remaining volumes (meaning that the packaging is going to change). Since the “training course” relies so heavily on movie files and editing the supplied demo songs, I’d expect that the files for the later volumes would have to be provided some other way to make up for the absence of the DVDs, or, that they’d all be zipped onto the third DVD. However, the DVD-ROM that came with this issue just has the regular demo files, plus copies with the edits already made so you can compare what you did against what you were supposed to do. That, and there’s a “pick-up artist song” by Hachiko-P, and the next MMD model, this time for “Satchan” (Speaker). Vol. 4 will hit Kyushu around the 23rd, so I’ll find out then what’s going on.

The movie files have been covering the usage of the different apps in small bits and pieces. For Vocaloid, we’re taught how to change the lengths of different vocal components and add new phonemes to make Rana sound more natural. Unfortunately, my version of Vocaloid Lite seems to be slightly different than what’s in the video, and I couldn’t insert one of the phonemes as demonstrated. And in fact, part of the starting demo file already had some of the edits in place before I opened it.

(Pick-up Artist interview with Hachiko-P.)

With Singer-Song Writer, we’re treated to more of the mixer functionality, specifically, adding reverb, and playing with compression and the maximizer-limiter. SSW is very powerful, yes, but so far all the work has been on modifying finished songs. I’d like to go into the process of composing music from scratch pretty soon.

The really impressive package, though, is Miku-Miku Dance. The lesson this time is to take the Rana model from volume 1 and change the pose to match the volume 3 cover. There’s a lot of twisting and pulling on specific joints, but the connections are designed so that the rest of the model stretches or bends in a fairly natural way in response. You don’t have to adjust every single joint individually, which simplifies the operations a lot. The video is 8 minutes long, but because I was pausing it to work on the model, the entire lesson took an hour. When you’re done, you’re instructed to import the bird-like speaker creature, Satchan, and fix its pose on your own. As kind of a cheat, rather than adjust Rana’s fingers to make a fist or curve them somewhat, we’re given “pose” files to import for both the right and left hands.

Again, the magazine mirrors the movies on how to use Vocaloid, SSW and MMD. Additionally, there’s the interview and introduction of Hachiko-P’s Vocaloid songs, some joking between Rana and Robo-Panda about what reverb is, and a couple pages dedicated to some of the other Vocaloid products. I’m looking forward to the next issue to see what else MMD can do.

A few days ago, I got to wondering if I could find English user manuals online, given that both Vocaloid and MMD are running on my PC in English. Turns out that Yamaha has been packaging the English PDF with Vocaloid Lite, and that’s found by going to the help menu. I haven’t located anything for SSW, but there’s a dedicated website called Learn MMD that has a number of tutorials for Miku-Miku Dance in English, which makes up for the lack of a manual for MMD on the DVD-ROM.

About Japanese phonemes:
The Japanese alphabet is comprised of consonant-vowel combinations, rather than the smaller components we see in English. That is, we have “ah”, “ee”, “ooh”, “eh”, “oh”, “kah”, “key”, “coo”, “keh”, “co”, “sah”, “she”, “sue”, “seh”, “sew”, etc. You can double up on some of the consonants to emphasize the “t” or “s” sounds, and you can lengthen the time you hold the vowels. Usually, a lengthened vowel (“to” compared with “tou”) is just one sound, rather than separating them into two individual sounds (“to” + “u”). This is relevant to Vocaloid because it doesn’t recognize certain sounds. You can extend a note, so that the vowel part sounds like it’s longer, but many times you need to enter “to” + “u” as two individual letters, as if they’re separate notes. On top of this, Vocaloid doesn’t recognize kanji, so all of the lyrics have to be entered in the phonetic alphabetic system called hiragana. Having a Japanese wordprocessor like NJ-Star, or the Japanese IME character entry software is important here.

Programming the Pocket Miku, Details, Part 3


System Exclusive messages are not part of the standard MIDI spec, and are specific to each given machine. That means that if you use SysEx messages in the sequencer in your song, they won’t have the same effect if you play the song on anything other than the Pocket Miku.

SysEx messages are like the other MIDI messages in Java, in that you use “setMessage()” to prep the data you want to send to the synth. But you use an object of the SysexMessage class to do it:


byte[] byteMsg        = new byte[nLengthInBytes];
SysexMessage sysexMessage = new SysexMessage();

for (int i = 0; i < nLengthInBytes; i++) {
byteMsg[i] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16);

sysexMessage.setMessage(byteMsg, byteMsg.length);
nsxRcvr.send(sysexMessage, -1);

byteMsg is a byte string, meaning that you have to convert the SysEx message from a regular character string to a byte array. I stole the byte conversion code from the jsresources page.

NSX-1 SysEx messages have several patterns, but the rules are that they all have to start with “F0” and end with “F7”. In between those two markers you will probably have a 3-byte address (Most-Significant Byte, Middle-Significant Byte and Least-Significant Byte), a SysEx “type” identifier, and one or two bytes of data. In some cases, data is variable length, as when you’re programming the eVocaloid “song” string in a lyrics slot.

Yamaha divides SysEx into: Universal Real Time Messages, Universal Non-Real Time Messages, XG messages and eVocaloid messages.

Universal Real Time Messages (URTM):

The first three messages duplicate some of the earlier parameter messages: changing master volume and master fine and coarse tuning.

After this, we get Reverb, Chorus, After-Touch and Control Change.

The format for Reverb is:

F0 7F 0N 04 05 01 01 01 01 01 PP VV … F7

F0 7F – Fixed.
0N – N is the channel number.
04 05 01 01 01 01 01 – Fixed.
PP – Parameter number (00 = Reverb Type, 01 = Reverb Time, etc.)
VV – Value (00 = Room S, 01 = Room M, etc., for Reverb Type)
VV – Value (0-127 = 0-11s, for Reverb Time)
F7 – Fixed.

The format for Chorus is:

F0 7F 0N 04 05 01 01 01 01 02 PP VV … F7

All that changes is the the last “01” becomes “02”. Plus, there’s a few more parameters available (Chorus Type, Mod Rate, Mod Depth, Feedback, etc.)

Channel Pressure (Aftertouch):

F0 7F 0N 09 01 0M PP RR … F7

0M – M = Channel number (0-15).
PP – Parameter number (00 = Pitch, 01 = Filter Cutoff, 02 = Amplitude, etc.)
VV – 00 to 7F, effect depends on the parameter selected.

Control Change:

F0 7F 0N 09 03 0M CC PP RR … F7

Key-Based Instrument Control:

F0 7F 0N 0A 01 0M KK CC VV … F7

To be honest, I haven’t done anything with Control Change or Key-Based Instrument Control because they look like too much work. While they both require a “CC” value (the controller number), the only place where controller numbers are defined is in the table for Key-Based Instrument Control (0x07 = Volume, 0x0A = Pan, 0x5B = Reverb, 0x5D = Chorus).
Universal Non-Real Time Messages

Now we get to the messages that really matter. The first and foremost is turning General MIDI On and Off.

As mentioned previously, several of the Control Change and NRPN messages only work with GM ON (such as Reverb and Drum Cutoff Frequency). You can turn GM on and off from the Pocket Miku front panel by pressing Volume Up and Down, and “U” simultaneously (you’ll hear a little “click” sound if you do it right. This is not convenient if you want to change modes in the middle of a song.

The better way is to send a SysEx message:

F0 7E 00 09 01 F7  // GM On

F0 7E 00 09 02 F7  // GM Off

Note that while the MIDI spec shows “F0 7F XN”, “X” is ignored, and I find that “N=0” works fine.

I haven’t bothered with Scale/Octave Tuning. It just seems easier to use the sequencer or keyboard to shift scales.


Backgammon, Part 9

(For Red, the green box is his back field, and the red box is his home field. It’s the reverse for White.)

Let’s look at the home and back fields a bit more. Your back field is the 6 points farthest from you (19-24 for Red, 1-6 for White), and your home field is the closest 6 (1-6 for Red, 19-24 for White). If you’re sent to the bar, your stone returns to the board in your back field, based on the dice you roll. You have little to no control over where that will be, beyond choosing which of the 2 numbers to use, if both of them represent unblocked points (if both points are blocked, you stay on the bar). So, if Red rolls a 3-5, he can pick between point-22 and point-20. Beyond that, you want to get out of the back field as early as possible for a running game, and hang back as long as you can while waiting for the opponent’s blots for a back game.

(Red starts working on making a wall around the home field, with blocks on points 6, 7 and 8. For the stones on point-1, White’s dice will be blocked for each die showing a 5 or 6, right now. )

For the home field, your strategy changes throughout the game. At the beginning, you want to make as many contiguous points for a wall as you can, to trap your opponent from starting a running game. That means blocking point-7 (to keep him from leaving on a 6-5 or 6-6 roll) and then bringing your other stones in to make blocks, trying to keep from overloading all the stones onto just points 6 and 7. You want the stones evenly distributed on your home field blocks to prepare for making the next new block, with at least 3 stones each (having only two stones on a block means that you’re going to leave a blot if you move one to make a different block, which increases the risk of getting hit and making you less flexible).

(White moved his back field stones forward, so Red will throw as many of his stones behind them as possible, if preparing for a running game.)

When you’re preparing for a running game, at first all you care about is getting your stones safely into the home field – it doesn’t matter where as long as you don’t leave blots. Then, if your opponent moves his stones forward from the 24-point, just start throwing blots behind him where he can’t reach them. It does mean that you can’t just randomly hit his blots, because he has a chance of landing on yours when he comes off the board, and that’s going to hurt your chances for the running game. If you do get hit, or if some of your stones are trapped in your back field by your opponent’s wall, then use your chances to move all your free stones to the very front of your home field in preparation for bearing them off. Try to get them all on points 1 through 3 (for Red). Then, if you can escape from your opponent’s wall, bring the remaining stones into your home field as fast as possible and start bearing off as soon as you can.

(Red played a running game but White has two of his stones trapped behind a wall. If Red gets past the wall early enough, he’ll be perfectly prepared to bear off 2 stones per turn, while White may only get 1 off per turn towards the end of the game.)

Bearing Off

There are three situations just before, and during the bearing off stage. In the first, you have a pure running game, and no opponent stones in your home field. The second is when there is at least one stone between you and the tray (or on the bar) as you’re getting ready to bear off. The third is bearing off with at least one stone between you and the tray, or on the bar.

(Situation 2: Red is getting ready to bear off, and White has 2 stones between Red and the tray.)

Let’s start with the second situation. If you have at least one of your opponent’s stones trapped between you and the tray, you’re in a strong position to win (or at least improving your situation). This is where you want to make a wall 6 or 7 points long to prevent your opponent from escaping. Keep three stones on different points where you can to have that extra ready to use as needed (if you have the above board, you can make new points with rolls 6-2, 6-3, 6-4, 4-3, 4-2 or 3-2) without leaving a vulnerable blot. Keep bringing up the stones at the back and add new points at the front for a rolling wall. Eventually, you may have points 1 through 6 blocked and one of the opponent’s stones on the bar (which is the ideal). From here, bring the extra stones as close to the 1-point as you can before you start bearing off.

(Red is at risk, having an odd number of stones on point-6, while White is trapped on the bar. A roll of 6-5, 5-6, 6-6, 6-4, 4-6, 6-3, 3-6, 6-2 or 2-6 (pretty much anything with a 6 in it and the other die is not a 1) is going to result in Red leaving a blot behind somewhere. If Red goes to the bar, White’s wall will prevent him from returning to the board.)

What you want to avoid is having odd-numbered stones at the points farthest away from the tray. That is, if you have 2 stones each on points 2 through 5, and 3 on point 6, what happens if you roll a 6 and anything that’s not a 1? You take one stone off the 6-point, and the second stone you remove will leave a blot somewhere, to give your opponent a 1/6th chance of sending you to the bar, which could cost you the game.

Always move extra stones closer to the 1-point, if you can, as you jockey for position, even if it means that you can’t bear stones off with every roll. The goal is to minimize the threat posed by getting 6’s or high doubles.

Now, if your opponent has a block in your home field as you’re getting ready to bear off, this makes it a little harder. You can’t land on that block, but you can try to make it work for you. If White has a block on point 1, just build up the rolling wall and try to keep it 6 points wide until you have most of your stones in the home field. Avoid odd numbers of stones on the 7-point at the end, just in case you get double 5’s (or whatever). This is risky, though, because if your last 2 stones are on point-7 and you roll only one 6 (1/6th chance), you’ll only be able to move one stone and the other will be left as a blot that the opponent can hit if he gets a 6 (or whatever) next time (1/6th chance).

(White has a block in Red’s home field as Red prepares to bear off. What Red wants to avoid is rolling a 6-4, because he’d have to move one stone from the 7-point, leaving a blot. He’d also have to move a stone in closer to the tray from the 6- or 5-point, leaving a second blot.)

If your opponent’s block is on any other point in your home field, bring up your rolling wall and just start throwing stones behind the block when you can, trying to keep from having an odd number of stones at the farthest end of the wall in case you get double 6’s (or maybe double 5’s) and end up leaving a blot that the opponent can reach.

(Running game. There’s nothing between Red and the tray. If and when White returns to the board from the bar, it will be BEHIND Red’s stones, where it won’t be a threat. Since Red already has 4 stones in the tray, his odds of winning are very high, as long as White doesn’t cheat by getting high doubles four turns in a row.)

Once you have all your stones in your home field, you want to keep jockeying them closer to the tray to avoid having odd numbers of stones on the points farthest from the tray. When you’re ready, use 6’s to bear off, and all other numbers to bring the blots closer to the tray. What you’re looking for here is to let one of your opponent’s stones escape from their back field, while leaving a blot where you can hit it. If possible, put your opponent on the bar, and block the point he had been on. Don’t leave blots yourself. Keep an even number of stones on your farthest blocks. This way, your opponent loses turns while stuck on the bar, and when they DO get back on the board, it will be safely behind your wall and you can turn this into a running game that you’ll probably win (unless he gets lots of high doubles one after the other, in which case you want to check him for using loaded dice. Or, if it’s the yahoo game, you can complain that the software cheats.)

In situation 2, after you bring your stones into your home field, you have situation 3. Then, once all of your opponent’s stones are past yours and you have a running game, situation 3 turns into situation 1. The only real difference between cases 2, 3 and 1 is that when case 3 turns into a running game, you’ll have more of your stones around points 1-3, and several stones in the tray. In case 1, you may have most of your stones on point-6, while your opponent has already started bearing off.

We can ignore what White is doing tactically. When Red starts bearing off, it’s just Red against the dice.

To be continued.


Programming the Pocket Miku, Details, Part2


RPN refers to Registered Parameter Number. NRPN is Non-Registered Parameter Number. “Registered” means that it’s part of the standard MIDI spec and will work the same on all synthesizers. “Non-Registered” parameters only work as intended for the given machine. That is, the NSX-1 NRPN messages are NSX-1 specific. Both sets of parameters take effect faster than if you program them using SysEx, and they duplicate some of the SysEx parameters.

Registered Parameter Numbers are:

Pitch Bend Sensitivity (changes the range of pitch bend)
Master Fine Tuning (changes the pitch of all notes a small amount)
Master Coarse Tuning (changes the pitch of all notes a lot)
RPN null (nothing)


The NSX-1 Non-Registered Parameter numbers duplicate many of the Control Change parameters. That is, Vibrato Rate, Vibrato Depth and Vibrato Delay work the same as Control Change Vibrato Rate, Time and Depth do. Note that NRPN includes identical parameters specific to the Drum Kit instruments, but on a per-note basis. When you’re using the drum kit (either the sound bank or GM channel 9), each keyboard key plays a different drum instrument. When you play a drum note, you need to specify that note number as part of the NRPN Drum parameter data if you want to change Drum Filter or Drum Pitch.


Say you’re pressing the keyboard key that corresponds to MIDI note number 60 while using the Drum Kit sound bank. If you want to change the Drum Low Pass Filter Cutoff Frequency in Java, you do the following:

myMsg1.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x63, nrpnMsb);
myMsg2.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x06, dataMsb);
myMsg3.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x62, nrpnLsb);
myMsg4.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x26, dataLsb);
nsxRcvr.send(myMsg1, -1);
nsxRcvr.send(myMsg2, -1);
nsxRcvr.send(myMsg3, -1);
nsxRcvr.send(myMsg4, -1);


0x63 is the Control Change number for setting the NRPN MSB byte, and “nrpnMsb” contains 0x14 for controlling the Drum Cutoff Frequency.
0x06 is the CC number for setting the NRPN data MSB byte, and “dataMsb” represents the cutoff frequency (0-127).
0x62 is the CC number for setting the NRPN LSB byte. “nrpnLsb” is the keyboard key number (60 in this example).
0x26 is the CC number for setting the NRPN data LSB byte. “dataLsb” has no effect and can be left at 0x00.

If you play more than one drum instrument, you need to change “nrpnLsb” to that note number every time you call Drum Low Pass Filter Cutoff Frequency.

NRPN parameters that are not available through Control Change include: Low Pass Filter Cutoff Frequency, Low Pass Filter Resonance, Drum Low Pass Filter Cutoff Frequency, Drum Low Pass Filter Resonance, and everything that starts with 0x70.


The 0x70 NRPN parameters only apply to eVocaloid (channel 0). Vibrato Type and Delay work the same as for General MIDI. Portamento Timing is a single parameter that ranges from 0x00 (fast) to 0x7F (slow). Seek isn’t included in the Perfect Guide so I don’t know what that does. White Noise adds a little hiss to the eVocaloid voice. Phoneme Connect Type has three modes: 0x00 = Fixed 50ms delay between phonemes; 0x01 = Minimum connect times; 0x02 = Note velocity changes time between phonemes. (Start of Phonetic Symbol, Phonetic Symbol and End of Phonetic Symbol aren’t included in the Perfect Guide.)

Note that anything not included in the Pocket Miku Perfect Guide is not otherwise documented, and seems to be deactivated in the Pocket Miku itself.

In the Control Section above, we have Reverb, Chorus and Variation parameters. For some reason, chorus and variation have very little impact on the note played, as far as I can tell. Reverb is the most noticeable of the three, and I can sense some change in chorus, but I have yet to figure out if variation is doing anything at all. This is relevant in that it plays a big part in the following SysEx tables.


Bokaro P ni Naritai, vol. 2

(Images used for review purposes only.)

I want to be a Vocaloid Producer, vol. 2, 1,500 yen, plus tax.
As far as I can understand the magazine, it looks like the first 3 issues will include DVD-ROMs, and the rest will just be the magazine itself. I’m not really sure how this will work, since the first DVD has the installers for Vocaloid, Singer Song-Writer, and Miku Miku Dance, and the second has three instructional videos plus demo and data files for lessons 2 and 3. Maybe the remaining magazines will point to a website for downloading the demo files for each future issue. We’ll see.

As mentioned in the previous blog entry, issue 1 of the magazine walks through how to install all three packages, and then gives a short overview of the Vocaloid app. The vol. 1 DVD-ROM contains a demo song for Vocaloid, the associated files for that song as created in Singer Song-Writer, and then the Rana model for MMD. The first half of each of the vol. 1 movie files illustrates the install steps, and the second half highlights some of the features of each app. MMD is particularly impressive, and is worth getting the first magazine just for this. You can play with Rana right out of the box.

(SSW mixer, which is pretty much the same as the Vocaloid mixer.)

The magazine for vol. 2 mirrors the DVD movies for how to use SSW and MMD. On the DVD-ROM, there’s another demo song for Vocaloid and SSW, and the second MMD model – this one for Rana’s sidekick, the robo-panda. The Vocaloid movie walks through more of the steps for turning lyrics into music by having you change the tempo, add some new text to an existing song, and add a new chorus track. In SSW, you change the tempo, import music riff files for individual sound tracks, and add an all-new track. Right now, SSW is being used more as a mixer for existing music, and not as a composer. Then, in MMD you import the Rana and Panda models, and motion files for the camera and Rana, apply Rana’s dance motion to the panda with a mirror flip, add an existing music file, and export everything to an AVI movie file.

The Rana dance file for MMD has 5,600 frames, and took something like 4 hours to render at 480×640 resolution (granted, my laptop isn’t blazing fast). The Rana model is very complex; coupled with the MMD software, the overall magazine series is worth the total price (assuming I can get the upgrade serial numbers at the end). One comment though about the MMD installer. There are 2 versions of the MMD package, and presumably the 64-bit version runs under Win 7 and 8, but you need to get the right version of Direct X from Microsoft. But, when I tried doing the install, the wizard gave an error saying that it was incompatible with my computer. So, I had to settle for the 32-bit version, which seems to be the same, functionally (and yes, I’m pretty sure I have 32-bit Windows, so I know I have no choice in running 32-bit MMD). Interestingly, Vocaloid gives you the option to pick languages during the installation, and MMD has a menu item for switching between Japanese and English. SSW is the only package of the three that is still running in Japanese on my PC, only because I haven’t found a way to change it. On the other hand, all of the names of the Rana and Robo Panda model parts (and even the copyright statements when you open the models) are in Japanese, and that all gets stripped out if MMD is in English mode (the joint and segment names all turn into “NULL”). If you want to know what the components of the model are that you’re trying to move, you need to be running in Japanese mode, which means that knowing how to read Japanese is going to be very useful. But, you can still flip to English mode to find out what the menu and button names mean.