Gakken News, 04/28/14


A bit of Gakken news from the Otona no Kagaku site. Piapro, a website that offers information regarding the Japanese Vocaloid characters, has a Photoshop template available for download to allow you to create your own design for a seal that you can affix to the top of the Pocket Miku keyboard. Deadline for submitting finished work is May 7. 10 entries will be selected.

 

Advertisements

Making of Making Waves, Part 3


In a way, the 2’s sinewave reminds me of Pacman, so I had a “wocka wocka” sound in the back of my mind as the wave crosses the axis. Then I bought the Korg M01 emulator for the Gameboy DS, and I thought that this might be a decent application for demonstrating it. The 2’s wave would lay out the rhythm for the rest of the sinewaves, and I’d just bring in new instruments for each new wave. In fact, though, I built up the soundtrack backwards, adding all 8 instruments at one time, with the intent of muting the ones I wasn’t using when it came to time recording the tracks. I plugged the Gameboy into my video camera mike jack and recorded the output that way. I then stripped out the audio track using Audacity, trimmed the files to remove the dead spaces at the beginning and ending of each file, and removed the hiss that got introduced by the Gameboy along the way.

Unfortunately, it became clear real fast that using prime numbers for the timing of each instrument was going to be a mess.

I am fully aware that the track for the 19’s wave is unlistenable garbage. I apologize for that. Blame natural numbers, if you want.

I did have to tweak the song timing. The Init default for the M01 is 120 bps. I had to change it to 95 bps so that one scene equated to “4 units” on the x-axis of the Excel sheet graphs. That is, 1 M01 “scene” covers the 2’s wave crossing the x-axis twice, which requires a 95 bps for the M01. After this, things were pretty simple. I pretty much had to write the music note-by-note for each instrument since the weird timings of the x-axis crossings in most cases prevented me from using the copy-paste functions. After the sequencer interface, the thing in the M01 that I spent the most time using was the mixer, for changing the volume settings of the voices for each movie cycle.

Overall, while the movie itself is really primitive and ignorable, I do like having had the Korg M01 to use for the sound track. I plan on using it more in the future.

Gakken News, 4/23/14


Right after I wrote yesterday’s post, Gakken updated their Otona no Kagaku Facebook page with an announcement for a documentary they made of the designers that developed the Theo Jansen Mini-Beest kit. The film will come out on May 3rd.

Gakken News, 04/22/14


Nothing really happening on the Otona no Kagaku Facebook page, or the Designer’s blog, which is part of the problem. Right now, no news from the editors or engineers means bad news. Specifically, the page for the next kit, the Auto Writer, has been quietly revised to show the new potential release date to be in July. However, the date was given in 2 locations on that page, and the editors only changed one of them (the other still shows a May release). This is the second time the date has been pushed back on this kit. It would be nice to know if it’s because of marketing decisions and that they don’t want it to impact sales of other new kit releases (like the Pocket Miku), or if it’s because they still can’t make the kit work.

While I’m here, I’ll mention the Pocket Miku. Somehow, my PC has gotten infected with floating ads, which happened with the latest update of Adobe Flash Player. I installed AdBlocker, and that worked ok for a while, then there were new updates to Windows, and slowly the number of webpages with floating ads has been creeping to to close to 60%. If anyone knows how to get rid of them, please let me know.

Anyway, either because of the ads, AdBlocker, or some new Windows security feature, the webpage for updating the Pocket Miku keyboard is now getting blocked and I can’t unblock it. Part of the appeal of the Pocket Miku is that you can update the text strings it uses during playback. If the updater doesn’t work, then the Pocket Miku is just an overly-expensive Speak-and-Play.

 

Making of Making Waves, Part 2


As I was playing with the idea for the sinewave animation, I decided that what I’d do is have the 2’s sinewave run first, hit the main convergence point on the x-axis, and then fade it out. I’d follow with the next cycle having the 2’s and 3’s sinewaves running together, and fail. Repeat with 2’s, 3’s and 5’s, etc. Since each cycle has 250 frames, that’s 250 individual gif images that had to be copied into MovieMaker. With 8 cycles, that’s 2,000 total files for about 16 meg.

MovieMaker can’t cope with that many individual files. As the movie was playing, MM started marking certain files as “damaged”. The only way to “repair” them is to delete the entry in the movie and drag the file back in again. Since the files were being lost randomly every time I played the movie, trying to fix them would just mean other files would get lost when the movie played back the next time. The only option was to scale back, having separate movies for each cycle. That is, 8 movies.

Now, when you drag a block of files from one point to another in Windows, even though the names may have sequential numbering (file1, file2, file3…) Microsoft succeeds in getting the order wrong at the target application. So, every time I created a new movie and dragged over the files I wanted for the frames, I had to go through the movie and correct the frame order. Sigh. Not insurmountable, but still a pain.

Actually, I kind of brute-forced the creation of the animation frames in the script to show the sinewaves past the convergence point. Since the joke was that the majority of the sinewaves died at the convergence, the excess frames weren’t needed. That is, I’d made 8 cycles of 250 frames each, but only needed 1-225 for cycles 1-7. I only needed all 250 frames for the cycle at the 19’s sinewave (movie #8). After trimming the files and setting the frame time to 0.05s for each one, I tested the timing, built the opening title and closing credits cards in GIMP, and added the “dots of death” to the convergence point frames of each movie. MovieMaker still managed to lose frames in the smaller movies, though. When this happened, I had to close all other applications, including MM, make sure that all available memory was freed up, and then try again.

Anyway, the overall animation was starting to look pretty good. The next issue was “what to do about a sound track?”

To be cont.

Making of Making Waves, Part 1


The idea for having a bunch of sinewaves hitting an immovable point on the x-axis on a graph came to me a few months ago while I was playing with my prime number pictures. What I needed was to find the largest product that Excel could handle for the lowest set of primes so that each of the prime sinewaves would all converge on the one point, for the largest number of primes supportable. That is, if I just used 2 and 3, they’d converge at 6, and if I added 5 to the set, 2, 3 and 5 would converge at 30. It’s pretty clear that the convergence point gets big fast with each new prime. (7 => 210; 11 => 2310; 13 => 30,030; 17 => 510,510; 19 => 9,699,690). After 19, Excel treats the product as an exponent and the least significant digits get lost. This is a good stopping point anyway, because with more than 8 sinewaves, the screen gets too cluttered.

Just to get a feel for how this was going to look, I built up a spreadsheet, which needed 1,000 data points to make nice, clean lines. Having gotten this far, I figured I might as well try getting Excel to make the animation for me. And this is where things got stupid. (Surprised?)

The first issue is that Excel wants to automatically resize the chart based on the number of data points and the largest value in the data set. If the animation is going to start with 1 data point of a value of 0, the first chart is going to look wrong. I needed the same-sized chart for all frames. Trying to figure out how to do this via Excel help was a waste of time. Eventually, I found the information I needed online, and of course, now that I want to write about it, I can’t find that page, or the specific property in Excel anymore. For the chart height, it’s an obscure graph property. For chart width, I had to use a fake column and leave the cells empty. As long as the range for one column is 1,000 cells long, the chart will stay at 1,000 data points.


(What I wanted.)

The next part was to tell Excel to use a variable number of cells for the actual sinewave data. 1,000 times. This called for the use of Visual Basic. I don’t have VBA, but Windows comes with VBScript. In many cases, VBScript is adequate for automating processes in Excel, and in fact, many tutorials on how to use VBScript revolve around exactly that. Naturally, there’s no list of all controllable properties for Excel, and the Microsoft online documentation for the Excel object is a joke. Apparently, if you have VBA you can use the programming environment to display them, but the only alternative for people working in VBScript is to record whatever task as a macro and then examine the macro code created by Excel. Naturally, in certain later versions, Excel selectively chooses to not include various chart operations within the macro. With a lot of digging I found example code for changing the chart data ranges. I’d thought I’d had it made then.

The problem is that there’s two properties: Value and XValue. I wasn’t paying attention, and I only took the code for XValue.

What I really needed was:
wb.ActiveChart.SeriesCollection(1).Values = wb.Worksheets(“Sheet1”).Range(“c3:k1002”)

What I used was:
wb.ActiveChart.SeriesCollection(1).XValues = wb.Worksheets(“Sheet1”).Range(“c3:k1002”)


(What I got.)

Not the same thing. The resulting charts looked like garbage and I spent a day trying to figure out what was wrong. At about that point, I got swamped at work and had to put off playing with this idea for a couple months.

Recently, I had a few spare hours, and I decided to try to come back at this from a different angle, creating the graph from scratch. And that’s when I discovered just how under-documented the Excel object is online. No matter how I searched, I couldn’t find properties for setting a fixed height for the chart y-axis, etc. Additionally, I discovered that you can’t use Excel enumerators (xlNone, xlRight, etc.) from VBScript. You have to use the raw numbers, and that meant a lot more digging in the documentation to find those raw numbers.

Realizing that creating the kind of chart I wanted from scratch was too hard, I went back to my original idea of using an existing chart and trying to get the x-axis range to change correctly again. After another couple hours, I found one example on the net that had .Value and .XValue side-by-side, and that’s when I figured out the mistake I’d been making.

Once I could set the range for .Value via VBScript, everything else became easy. I generated 1,000 charts, with the range increasing 1 row at a time, and saved each one to a .gif file. I loaded the gifs into Microsoft movie maker and played it back. The play time was too long, so I adapted the VBScript to print out every fourth chart. With frame rates of 0.05s, this gave me a rough play time for one animation at 12 seconds. But, now MovieMaker started crashing.

””’
””’ VBScript code to make sinewave animation using Excel
””’ I love the way WordPress keeps code formatting…
””’

Set objExcel = CreateObject(“Excel.Application”)

objExcel.Application.DisplayAlerts = False
objExcel.Visible = True

Set wb = objExcel.Workbooks.Open(“c:\my projects\gakken\primeswave.xlsx”)
wb.Sheets(“Sheet1”).activate
wb.ActiveSheet.ChartObjects(1).Activate

wb.ActiveChart.SetSourceData wb.ActiveSheet.Range(“c3:k1002”)

‘ Start plotting only the 2’s wave; then 2 & 3; etc.
for chLines = 1 to 8

‘ Set the range for each sinewave to “c3:c3”, etc.
for chLCntr = 1 to 8

‘ chr(98) = “b”
chColRng = chr(98 + chLCntr) & “3:” & chr(98 + chLCntr) & “3”

wb.ActiveChart.SeriesCollection(chLCntr).Values = wb.Worksheets(“Sheet1”).Range(chColRng)
next

‘ Animate display of all 1000 data points per sinewave
for plotPnt = 1 to 250

‘ Start selecting cells with row 3, then plot every nth graph.
stepSize = 4
chVal = 2 + plotPnt * stepSize

‘ Plot each line from 1 up to chLines
for chLCntr = 1 to 8

if (chLCntr <= chLines) then
‘ Create range in format of c3:c68
chColRng = chr(98 + chLCntr) & “3:” & chr(98 + chLCntr) & chVal

‘ Set range for all sinewaves being plotted
wb.ActiveChart.SeriesCollection(chLCntr).Values = wb.Worksheets(“Sheet1”).Range(chColRng)
end if

next

‘ Build filename then save chart to file.
fn = “yngvi_” & chLines & “_” & right(“0000” & plotPnt, 4) & “.gif”
wb.ActiveChart.Export fn

next
next

objExcel.Quit

To be cont.

NSX-39, a first look


If you’re not familiar with Vocaloid, I suggest that you read the wiki article. It’s a very popular franchise in Japan, and in part that popularity revolves around the characters created to represent the various singing voices that the Vocaloid software can produce. As an example, Miku, one of the first, and one of the main “lead singers”, is consistently used in product tie-ins with FamiMart convenience stores.

As I’ve mentioned here recently, Gakken had announced the upcoming release for their NSX-39 Pocket Miku “singing synthesizer”, through their Otona no Kagaku line of kits. To an extent, the NSX-39 is kind of an extension of the SX-150 ribbon controller synthesizer. The concept is that rather than just having musical instrument voices like a piano or flute, you have the human voice singing specific sounds. The original Vocaloid software was written around the idea of music being created based on transcribing written lyrics. What the NSX-39 does is provide a USB port for downloading new lyrics to the kit, and then offering up to 10 operating modes for playing those sounds back as music. The user interface is a ribbon controller and stylus, with the ribbon split into 2 parts. One is a regular continuous ribbon as with the SX-150, while the other has distinct piano-style keys printed in it, resembling the keyboard printed on Miku’s stockings in the character art.

As can be seen in the below photo, the face panel has Vibrato, shift, A, E, I, O, U, and Volume Up and Down buttons. There are stereo headphone and USB jacks at the back, and an Off/Battery/USB switch. So, you can run the NSX off USB power if you don’t want to use up batteries (3 AAA’s). All of the face panel buttons do double duty if you use the shift key with them. The normal mode is to assign each of the keyboard keys to the Japanese versions of “do re mi fa so la ti do”. The A-O buttons switch the sounds to just that letter across the entire keyboard. Shift A-O activates a pre-programmed sentence that sequences every time you touch a note with the stylus. Shift-A gives you “Ko-ni-chi-wa-A-ri-ga-to” (Hello, thank you) playing one syllable per note press. Vibrato warbles the sound currently being played, and Shift-Vibrato returns the unit to Do-Re-Mi mode. Volume Up and Down changes speaker volume in 5 steps, while Shift-Volume Up/Down changes the keyboard up/down 1 octave. Vibrato-Volume Up/Down is pitch bend. Vibrato and A-O lets you switch to user presets.


(NSX-39 with Miku sticker applied.)

Pressing Volume Up and Down and A at the same time is “Panic” mode (defaults reset).¬† Up and Down and U switches between NSX-1 mode. Up and Down and O turns tuning on and off. Up+Down+Shift reinitializes the unit. At the moment, I can’t tell the difference between NSX-1 and NSX-39 modes, or Panic and Initialize.


(FamiMart version of Miku.)

The box contains the fully-assembled NSX-39, a 16-page user’s manual, 2 stickers you can put on the face plate (a picture of Miku, or the definitions of the different buttons in English) and an insert sheet advertising the real Vocaloid software system. The first 3 pages of the manual look at the history of electronic speech, from the Speak-and-Spell up to Vocaloid. The rest of the manual is split up into Operations; Using the online app or a sequencer; and Troubleshooting.

In general, the NSX-39 is a toy. It’s nice to play around with and make¬† sounds for a while, but it has the same appeal as the Korg Monotron, and about the same play lifespan. As-is. To expand its repertoire and keep it more interesting for a longer time, Gakken has added some nice features. First, if you go to the app page, you can access a second webpage that lets you type in new “sounds-as-words” into the interface and automatically store them in the NSX-39 (it has to be connected and turned on at the time) for later
playback. When you plug the unit into your computer (PC or Mac), the OS autodetects the NSX-39 and downloads the proper USB drivers for it. The app only runs under Google Chrome (which I hate) and only accepts Japanese character entry (what’s called Hiragana). This means that you can’t use the app for English entry, since the Vocaloid software isn’t tuned to English. If you can read and write Hiragana, it’s great.


(Miku loves FamiMart)

The second nice thing added by Gakken is MIDI support. You can run the NSX-39 from a PC-based sequencer through the USB port (if you have sequencer software), and you can even use it as a MIDI controller. I haven’t tried this out yet (the Pocket Miku just hit the stores in my region of Japan two days ago). But, I’m thinking that I’ll be able to interface it with my K-Gater Java app sometime by the end of April or beginning of May when my schedule frees up. If K-Gater works, I’ll try writing a Java-based sequencer to include the Kaossilator Pro. (To interface with my other gear, I’ll need to buy a PC-to-MIDI connector converter, which I don’t have yet.) The manual lists the supported MIDI operations, but it’s just in one small paragraph; it’s not in table format. So it may take some experimenting to get the codes to work right.

One thing about the USB connection is that you need Micro-B. Fortunately, when I bought my new Nikon CoolPix digital camera, it came with a Micro-B USB cable, so I already had that available when it came time to plugging the NSX-39 into my laptop.

Comments: The Pocket Miku is an interesting novelty item to add to your rig. If you use your laptop as a converter, you can drive the unit from a regular MIDI keyboard rather than having to use the ribbon cable. Or, you can use regular sequencer software and have it playing while you compose songs regularly through the computer. The three things I wish were different are: Firefox browser support for the app; support for English phonemes; and the ability to choose a voice other than Miku’s. Miku is supposed to sound like a 16-year-old girl, and she gets rather piercing when singing higher notes. I’d like to have a lower, male voice in order to get bass sounds. But, maybe that will be a sequel kit.

Pocket Miku Singing Keyboard
Released Apr. 3rd, 2014, 4,980 yen (w/o tax).
Ships fully assembled; not a kit.
Accompanied by a 16-page B5-sized user’s manual.
Requires 3 AAA batteries when not connected to a computer.
Requires a Micro-B USB cable to connect to a computer (PC or Mac).