All posts in category Synthesizer
Posted by chh01 on July 25, 2016
Most of what I’d done in the last blog entry was to summarize the translations of Polymoog’s MIDI guide, which brings me to page 16 of that guide. Most of what follows concerns manipulating the pointer to the phoneme character strings that Miku “sings” when you touch the stylus to the carbon keyboard. You can issue these commands either as a “command” (0D) or as an instruction string placed in one of the command slots (0C) to be implemented when a particular button action occurs (pressing “A”, or releasing SHIFT + “U”).
F0 43 79 09 11 0C … F7, or
F0 43 79 09 11 0D … F7
These character pointer operations include setting the pointer (MOJI_SET_KASHI = 09 05 00), incrementing the pointer (KASHI_POS_INC = 09 01 00 00), selecting the pointer position (0 to 63: KASHI_POS_SEL = 09 02 00 nn, where nn is 00 to 3F), selecting the lyrics slot (KASHI_SLOT_SEL = 09 03 00 0n, where n is 0 to F), and phoneme character entry (MOJI_SEL = 09 04 00 nn, where nn is 00 to 7F from the character table on page 10 of Polymoog’s MIDI guide). (Japanese translations appear below.)
Page 17 gets into some of the other commands from the command table on page 23, such as NOTEON, NOTEOFF, ADV_PB (pitch bend), VOL_UP, VOL_DOWN, etc. They work as you’d expect them to as regular MIDI messages.
F0 43 79 09 11 0D 0A 02 00 00 F7 – Like pressing the Volume Up key on the front panel.
VOL_SET: Set volume level (0-8)
VOL_UP: Increase volume one level
VOL_DOWN: Decrease volume one level
KEY_UP: With NOTEON or REVOICE,
KEY_DOWN: changes the keyboard up or down one octave.
TUNING_STOP: Lets you calibrate the carbon keyboard.
NSX1_GOKAN_OFF: Turns NSX-1 compatibility mode on and off.
MODE_DOREMI: Puts keyboard into Do-Rei-Mi mode.
MODE_NORMAL: Miku sings from the lyrics tables.
MIDI_RESET: (Panic) Resets the phoneme chip.
ROM_RESET: (Initialize) Returns the Flash ROM settings to the defaults .
Section 3-6 on page 20 discusses the concept of CACCO, which is the Japanese word for “brackets” or “parentheses”. This mode is used to assign a string of unrelated commands to a specific command slot as if they were within a pair of parentheses. Once CACCO_START is encountered, the NSX-39 will execute the subsequent commands until encountering CACCO_END.
The example is to assign certain commands to the SHIFT button when pressed (CS_SW7D = 11).
0C 02 00 00 – CACCO_START (command list start)
09 02 00 00 – KASHI_POS_SEL(0) (reset lyrics list character pointer to position 0)
0C 03 00 0A – CACCO_END (command list end)
0C 02 00 00 – CACCO_START (command list start)
09 05 00 00 – MOJI_SET_KASHI (set pointer to play current character)
08 01 00 00 – REVOICE (replay the character)
09 01 00 00 – KASHI_POS_INC (point to the next character in the lyrics list)
0C 03 00 05 – CACCO_END (command list end)
From these commands we can see that when you press the SHIFT key, Miku will sing the first character in the currently selected lyrics slot.
The full SysEx message would be (all one line, no comments):
F0 43 79 09 11 // Start of SysEx message (fixed)
0C 11 // Change Command Slot for CS_SW7D
0C 02 00 00 // As given above
09 02 00 00
0C 03 00 0A
0C 02 00 00
09 05 00 00
08 01 00 00
09 01 00 00
0C 03 00 05
F7 // End of SysEx message (fixed)
Section 3-7 (page 21) describes timing. You can specify a wait time (TIME_WAIT = 0D nn nn nn, where nn can be from 00 to 7F). A value of 500 is roughly 1 second. You can cancel wait time with TIME_CANCEL (0C 05 00 00), and specify a TIME_TAIL (0C 04 00 00), which lets the timing buffer clear out. The pattern would look like:
CACCO_START > A > B > TIME_TAIL > C > D > CACCO_END
The example on page 22 is to assign a string to VOL UP + VOL DOWN + “A” (panic reset). (All one line, no comments.)
F0 43 79 09 11 // Start of SysEx message (fixed)
0C 32 // Change the command slot for CS_SW89_1D (Up + Dn + A)
04 65 12 66 // Direct MIDI 3 command mode to play a music note (see below)
0C 02 00 00 // CACCO_START
0D 00 00 C4 // Wait 200 ms
0A 07 00 00 // MIDI_RESET
0C 04 00 00 // TIME_TAIL
0A 07 00 00 // MIDI_RESET resets even with Cancel
0C 03 00 0F // CACCO_END
F7 // End of SysEx message (fixed)
Note: The 04 65 12 66 portion is a repeat of the 7-bit direct MIDI format, which takes “99 49 66” (Note Number 49 from the Drum Kit sound bank ON with a velocity of 0x66) and converts it to “04 65 12 66”.
Everything else is tables. Page 23 shows the command table. Translations:
“kashi” is “song lyric” (used to refer to the current lyrics string).
“Gokan” is “compatibility mode”.
“cacco” is “parentheses”.
Pages 24 to 27 describe the operations of the Command Slots. These are addresses within the Flash ROM pointing to instructions to execute when specific events occur, such as pressing or releasing one of the front panel buttons, power up (kidou), turning audio on/off, or activating the USB port. The slots themselves are listed in the tables on pages 28 to 30. I think most of this is self-explanatory so I’m not going to translate the tables. If there are enough requests for it, though, I’ll reconsider.
Posted by chh01 on November 5, 2014
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”.
Video of the Java app in action.
Posted by chh01 on October 22, 2014
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.
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.
Posted by chh01 on October 16, 2014
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);
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.
Posted by chh01 on October 9, 2014
The Miku, AKA – the NSX-39, is based on the Yamaha NSX-1 chip, which is the heart of the Vocaloid products, and includes the eVocaloid system. It has a USB connector, so you can plug it into your PC or Mac, and run it using any sequencer software you like (the Perfect Guide book focuses mainly on Garage Band). Most of the examples in the Perfect Guide revolve around tweaking the sequencer to customize it for the Miku, or showing how to send SysEx messages within the body of a song. But, if you have Java, you can create your own applet to make the Miku do what you want as a regular synthesizer.
The starting point is the Yamaha MIDI spec doc. I wish it was more instructional, but it’s basically just a bunch of code tables. The first table in the Yamaha doc has the channel messages. Since the Yamaha MIDI spec is in English, there’s no point in repeating all the codes here. The important things to note are the Control Change and Mode Messages, which both use the “Bn” status byte (where “n” is the MIDI channel you want to control, 0-15. The Pocket Miku can play 16 instruments simultaneously, with channel 0 assigned to eVocalod and channel 9 is the internal General MIDI drum kit.)
The Vocaloid system apparently (I’m still trying to understand this, since the documentation is all in Japanese) divides speech phonemes up into “heads”, “bodies” and “tails”, combined with “joints” and “shots” (as mentioned in the product brief). These phoneme components can be mixed and matched as part of Yamaha’s “Real Acoustic Sound” (RAS). I mention this because the Yamaha MIDI doc shows which MIDI options apply to which operating mode, including GM (General MIDI), eVocaloid and RAS. But, the Pocket Miku Perfect Guide Book only shows the GM and eVocaloid modes. So far, I haven’t found any documentation on how to program the RAS mode and I’m thinking that Miku doesn’t support it.
The other reason for mentioning RAS is that in the MIDI doc, there are three sound banks, which you can select using Control Change: “Normal” (0x00), “Drum Kit” (0x7F) and “RAS” (0x08). The Perfect Guide only gives the “Normal” and “Drum Kit” banks. The “Normal” bank contains the standard 128 instrument voices that all MIDI devices support. The “Drum Kit” bank is actually the percussion voices available on channel 9 of the “Normal” bank.
To select sound banks in Java:
ShortMessage myMsg1 = new ShortMessage();
ShortMessage myMsg2 = new ShortMessage();
int channel = 1; // 0 to 15
myMsg1.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x00, msb); // MSB = 0x00 or 0x7F.
myMsg2.setMessage(ShortMessage.CONTROL_CHANGE + channel, 0x20, 0x00);
To select specific instrument voices within the selected bank:
myMsg1.setMessage(ShortMessage.PROGRAM_CHANGE + channel, n, 0); // n = 0x00 – 0x7F
As mentioned above, the NSX-39 supports all 16 MIDI channels, with numbering starting at 0 (the Perfect Guide starts numbering at 1). Channel 0 is for the eVocaloid; 9 is the Drum Kit.
To select the channel, look closer at the above code:
channel = 0; // For channel 0.
The other CC parameters may need a little description. Note that not all of them apply to General MIDI or eVocaloid. Also, you need to turn General MIDI ON (AKA: NSX-1 compatibility mode) to get things like Portamento to activate.
Modulation: Varies the note pitch.
Portamento Time: Time needed to sweep from one note to the next.
Panpot: Pans stereo sound between the left and right speakers.
Expression: Acts like a volume control.
Sustain (Damper): How long the note plays after Note Off.
Portamento: Steps to sweep from one note to the next.
Sostuneto: Switches “sustain note” on and off.
Soft Pedal: Switches “soften note” on and off.
Harmonic Control: Varies the amount of harmonics added to the note.
Release Time: Changes the ADSR release time.
Attack Time: Changes the ADSR attack time.
Decay Time: Changes the ADSR decay time.
Brightness: Adds higher frequencies to the note.
Vibrato Rate: Cycle rate for the vibrato effect.
Vibrato Depth: Size of pitch variation applied to the note.
Vibrato Delay: Time after the note starts that vibrato is applied.
General Purpose Control: RAS only, not included in the Perfect Guide.
Portamento Control: Key to apply portamento to.
Effect 1 Depth: Applies reverb (echo) to the note.
Effect 3 Depth: Applies a “chorus” effect to the note.
Effect 4 Depth: Applies a “variation” effect to the note.
RPN Increment: Increments the current RPN parameter.
RPN Decrement: Decrements the current RPN parameter.
NRPN LSB: Allows you to change NRPN parameters.
NRPN MSB: Allows you to change NRPN parameters.
RPN LSB: Allows you to change RPN parameters.
RPN MSB: Allows you to change RPN parameters.
Some of the above parameters only work for General MIDI, when General MIDI is turned on, and that’s something you do through SysEx (System Exclusive) messages, which I’ll get to later. I’ll cover RPN and NRPN messages next time.
Posted by chh01 on October 1, 2014
I’ve been wanting to write a post on this for a while, so I might as well do it and get it out of the way.
Google will occasionally run special images or animations on their main search page to commemorate specific people, events or dates. Two that they’ve done in the past that are appropriate to be mentioned here are for Les Paul, and the Moog Synthesizer. Click on the image to go to the google page, play with them and have fun. (Although, the page for the Les Paul link may have been taken down already.)
Posted by chh01 on May 5, 2014