ChordPro auto-accompaniment: Implementation notes

I’m prep’ing my ChordPro to Yamaha accompaniment program (cp2mid) for distribution. Please check out the demo. In the meantime, here are a few comments about the implementation.

Command line interface

cp2mid doesn’t have a fancy graphical user interface (GUI). A GUI is too much for a simple tool that translates an extended ChordPro file into a Standard MIDI File (Type 0).

I’m distributing both Java source code and a JAR file. The JAR file contains the compiled Java — the Java executable, if you will. “JAR” is an acronym for “Java Archive” and is produced by the Java archive program (jar), which is part of the Java development environment (JDK). JAR is a way to package up a compiled Java program, hiding all of the interior classes, etc. An end user doesn’t really need to know about JAR.

Given the JAR file, enter the following command line to run cp2mid:

    java -jar cp2mid.jar AFile.cho

“AFile.cho” is the name of an extended ChordPro file to be translated. You can hide the cp2mid.jar file within a Windows BAT file or shell file. Here is cp2mid.bat:

    java -jar cp2mid.jar %1

Nothing complicated, here.

cp2mid recognizes the “.cho” file name extension. It does not recognize any other extensions. If you snag a ChordPro file from the Web, you may need to change its extension to “.cho”. cp2mid replaces “.cho” with “.mid” in order to make the MIDI file name. Thus, “AFile.cho” is translated to “AFile.mid”.

During development and testing, you can run cp2mid starting with the compiled classes, e.g., cp2mid.class. Enter the command line:

    java cp2mid AFile.cho

to run cp2mid. The Java interpreter will look for “cp2mid.class” and the rest of the compiled classes needed by cp2mid. These compiled classes must be available in the same directory as cp2mid.class. “cp2mid”, by the way, is the main class in the application. You’ll need to specify the main class when creating a JAR file. Again, these steps are relevant only to developers.

Java classes

cp2mid has five Java classes:

  • cp2mid (cp2mid.java) Main class and driver
  • SongElement (SongElement.java) Basic element (parts) of a Song
  • Song (Song.java) Represents a ChordPro song in terms of SongElements
  • Song2mid (Song2mid.java) Translates the internal song representation to MIDI
  • MidiFile (MidiFile.java) Represents and manipulates a standard MIDI File (SMF)

The MidiFile class was used in an earlier prototype and still contains a bit of unused legacy code. This may change in future versions. The MidiFile class exploits the standard Java MIDI packages and classes. It creates a MIDI file and inserts MIDI messages (meta, SysEx and otherwise) into a MIDI file.

cp2mid is the boss. It calls on the other classes to do their jobs. Processing is broken into five phases:

  1. Check and manipulate file names.
  2. Read the ChordPro file into a String array, one line per array element.
  3. Translate each line into one or more SongElements.
  4. Translate the SongElements into MIDI.
  5. Write the internal MIDI representation to a Type 0 SMF.

The translation phases do the heavy lifting.

Song and song elements

A Song is a list of SongElements. A SongElement represents one of several ChordPro song constituents:

  • Directive
  • Chord
  • Lyric
  • Line
  • Annotation
  • Comment
  • Tab

All SongElements have the same data members. Each SongElement has a tag which identifies its type. The type determines the validity and interpretation of the other data members.

The Song class translates extended ChordPro to a list of SongElements. This is, effectively, the intermediate, internal representation of a ChordPro song.

ChordPro directives begin with ‘{‘ and end with ‘}’. Usually ChordPro directives control song formating. Extended ChordPro uses key, tempo, time signature, style code, start accompaniment and stop accompaniment directives to issue MIDI messages that will control the accompaniment engine when the MIDI file is played back.

ChordPro chords and lyrics are what it’s all about. Chords begin with ‘[‘ and end with ‘]’. Chords are extended by an optional beat count which specifies how long the chord is held. A lyric is text and may be multiple syllables long (i.e., anything up to the next chord, annotation, or end of line.)

A line element is a marker for important end-of-lines. Line elements affect lyric formating.

Normally, a ChordPro annotation is text added to a song when it is displayed. Annotations begin with ‘*[‘ and end with ‘]’. Certain predefined annotations, e.g., [*MA], [*FA], etc. change the accompaniment section during play-back.

Comments are just that. cp2mid saves the text, but doesn’t do anything with it.

A ChordPro song may contain guitar tablature (tab). Right now, cp2mid ignores tablature. This has not been tested. I’m not sure how to handle or translate tablature as yet.

Song to MIDI

The Song2mid class translates the internal intermediate song representation to MIDI messages and adds the MIDI messages to a MIDI sequence. The MidiFile class helper functions create specific types of messages. Base MIDI message and sequence classes belong to the standard Java MIDI package.

The Song2mid class walks the SongElement list from front to back. Based on element type, it dispatches to an element type-specific handler. The handler adds one or more MIDI messages to the sequence.

A separate blog post describes the MIDI messages.

I tried to encapsulate most of the “Yamaha-ness” in the Song2mid and MidiFile classes. ChordPro is very loose and forgiving when it comes to chord syntax. Song2mid recognizes only the 33 or so Yamaha chord types as defined in the Genos Data List PDF. If Song2mid doesn’t recognize a chord, it issues either a major or minor triad.

Example songs

I will distribute 15 example songs in extended ChordPro and MIDI format. Even if you don’t run cp2mid (or look at its implementation), please take a look at the extended ChordPro songs and try the MIDI files on your arranger. All sorts of fun and crazy things happen in real music (key changes, time signature changes, anticipation) and the examples demonstrate how to handle many exceptional situations. I chose certain songs as examples for testing because they are weird. 🙂

I tested the MIDI files on Genos and I’m curious about their behavior on other arranger keyboards. The MIDI files are similar to those generated by Yamaha ChordTracker. If your arranger plays ChordTracker MIDI files, it should play cp2mid MIDI files.

I don’t want to lead you on — it takes a fair bit of effort to take an Internet ChordPro file and whip it into shape. ChordPro as a formating tool is very lenient and forgiving. Accompaniment requires tighter semantics and precision like most “executable” computer stuff. It’s fun to whip a song into shape, but it requires work.

Copyright © 2022 Paul J. Drongowski

Roland Micro Cube GX speaker size

A quick project while booting Windows…

The speaker in the Roland Micro Cube GX is just OK and I think I can do better. Roland specs claim 5 inches (12cm), but folks have tried 5 inch replacement speakers and have found the speaker hole to be too small.

Remove four screws and the grill. Watch out for the sharp edges on the back of the metal grill! The speaker itself is attached by four additional screws. The diagonal distance from screw to screw is about 4 7/8″ inches (12.5cm), give or take. The screw to screw distance along the “square” sides is about 3 3/8″ (8.5cm). The cone diameter is 4 1/4″ (11cm).

I think Roland are being optimistic here. Turns out, there’s nothing in the way of a speaker size standard. Some vendors measure the diagonal distance between screws; some measure the outer frame diameter. Yikes, you get the picture.

The most important measurement here is the cutout diameter, AKA, the speaker hole.

Remove four more screws and gently pull the speaker out. The speaker wires are relatively short, so don’t get too aggressive. The speaker lugs use spade connectors: the red wire needs a 1/4″ lug and the black wire needs a 1/8″ lug. Keep this in mind when going to the hardware store.

The cutout diameter is 4″ (10.4cm). If you bought a 5″ speaker, I can see why it didn’t fit the cutout hole. Argh! Don’t worry about mounting depth in this case — there’s plenty of room. I think I’ll buy a speaker to fit the 4″ cutout and drill new speaker mounting holes, if necessary. Increasing the size of the cutout sounds like a bear.

BTW, the Roland part number is W120FP70-00C. The speaker impedance is 4 ohms.

Taking a quick look through Parts Express, here are some candidates:

I’m looking for cutout size, decent frequency response, and reasonable cost. Why put a $100 speaker in a $120 combo amp? I favor woven fiberglass over paper and suggested use in PA line arrays. Hole alignment doesn’t matter that much. I can always drill new pilot holes.

Just in case you need to know, all of the electronics are on a single printed circuit board just below the top panel. The controls are mounted directly on the PCB (low cost). There are leads from the PCB to the speaker and the battery compartment. Lead length is trimmed quite short and there isn’t much play during disassembly.

Copyright © 2022 Paul J. Drongowski

Hidden arranger smarts: file system SysEx

What to do with the ennui that sets in on New Years Day? Explore unexamined territory!

Yamaha Musicsoft Downloader is a valuable tool for Yamaha arranger keyboardists. Downloader lets you transfer MIDI song files, registrations file, text files, etc. between a Windows PC and a compatible Yamaha arranger keyboard. It even works with digital home pianos, too.

Most folks transfer their files using a USB jump drive. This isn’t a big deal when moving a few files maybe once or twice a day. When I’m developing a new style, however, I swap a drive quite frequently — dozens of times a day. All that physical swapping causes wear and tear on USB ports. I often use a short USB extender to reduce wear on the computer and/or instrument USB ports. I’d rather have a cheap cable fail than a USB port on a motherboard.

Downloader saves a lot of that wear and tear by copying data over a cable instead of a USB drive. Downloader supports both USB and good ole 5-pin MIDI transfers. Thus, folks who own older pre-USB keyboards can use Downloader, too.

Downloader has been around a while — one reason why it’s backward compatible. The user interface is a little bit dated, but it works and who cares? To move a file, you add the file to the holding area at the top of the screen, then move the file to its final destination by pressing one of the big arrow buttons. Classic.

Yamaha Musicsoft Downloader in action

The screenshot shows Downloader connected to Genos over 5-pin MIDI. The file “Downtown.mid” is in the temporary storage area. The lower left hand panel navigates instruments, drives and directories. The lower right hand panel selects files within a directory.

So, how does it do the actual transfer?

Because Downloader is old skool, it does it with MIDI. (Even over USB.) Downloader was written back in the day when MIDI was king and could do anything and everything. As another example, I give you the MIDI Sample Dump Standard (SDS) for representing and transferring samples to/from early-day samplers.

Downloader performs a dance with the target instrument. Like SDS, Downloader and the target instrument follow a set of rules — a protocol — for communication. To my knowledge, Yamaha has never published this protocol. It’s all done via MIDI System Exclusive (SysEx) messages although you won’t find these message types in the instrument’s reference manual or data list file. Nonetheless, your instrument is smarter than you think!

Of course, a lot depends upon the storage and capability of the target instrument. Entry-level instruments may be oblivious to Downloader or maybe just transfer back-up files. Mid- to higher-end arrangers are fully capable.

I decided to get a taste of this hidden protocol by monitoring the exchange of MIDI SysEx messages between Downloader and Genos. I split the MIDI stream and watched the dance as Downloader makes contact with Genos and acquires top-level directory information. After watching this process several times, I tried sending my own SysEx messages via MIDI-OX. (What a great tool!)

Here is a typical start-up sequence. It shows Genos’ response for each SysEx message that I sent.

F0 43 50 00 00 00 01 F7 
Genos responds: F0 43 50 00 00 00 02 01 01 F7
F0 43 50 00 00 02 01 F7
Genos responds: F0 43 50 00 00 02 02 33 00 01 00 00 01 00 01 00 00 1B
78 17 3F 01 00 00 00 00 00 00 01 7F 00 00 00 32 00 00
00 00 00 00 00 00 00 00 00 00 00 00 27 08 00 00 02 00
04 7F 7F 7F 7F F7
F0 43 50 00 00 01 01 F7
Genos responds: F0 43 50 00 00 01 02 00 F7
F0 7E 7F 06 01 F7 Identity request
Genos responds: F0 7E 7F 06 02 43 00 44 42 1C 0A 00 00 01 F7
F0 43 50 00 00 01 00 01 F7 Make connection (Genos is connected)
Genos responds: F0 43 50 00 00 01 02 01 F7

The first three out-bound messages test for a response. Downloader uses these messages as a connection check. The identity request message is a MIDI standard message for obtaining the identity of a musical device or instrument. Genos identifies itself as Yamaha (0x43) and model.

After getting the instrument identity, Downloader initiates the actual connection. When connected, the Genos display changes to a special background with the message: “Connected to the computer or smart device.” Genos is now listening for Downloader commands.

Thereafter, Downloader asks Genos for device, file and directory information. Here is the inquiry about top-level devices:

F0 43 50 00 05 0B 00 00 F7     Request drive 0 information 
Genos responds: F0 43 50 00 05 0B 01 42 00 00 05 00 55 53 45 52 F7
U S E R

Yamaha arranger people will recognize the USER drive where all user directories and files are kept. Genos returns the name for device 0: “USER”. If you have a USB jump drive attached, you will see:

F0 43 50 00 05 0B 00 01 F7     Request drive 1 information 
Genos responds: F0 43 50 00 05 0B 01 42 00 00 05 00 55 53 42 31 F7
U S B 1

Makes me think that Genos tells Downloader how many devices are available — maybe in response to the connection command?

Moving on, Downloader interrogates Genos about the directories and files at the next level down in the file hierarchy.

F0 43 50 00 05 04 00 3F 00 08 00 30 3A 5C 2A 2E 2A 00 F7    dir 0:\*.* 
? 0 : \ * . *
Genos responds: F0 43 50 00 05 04 01 10 31 39 38 30 20 31 20 31 20 30
1 9 8 0 1 1 0
20 30 20 30 03 01 00 00 00 03 00 2E 00 F7
0 0 .

You’ll notice that some command arguments and responses are ASCII characters, including the date and time stamps.

The number of subdirectories and files varies. So, Downloader and Genos go into a “loop” in which Downloader asks for the next entry (i.e., list item) and Genos responds with the entry’s information:

F0 43 50 00 05 05 00 F7        Request next dir list item 
Genos responds: F0 43 50 00 05 05 01 10 32 30 32 31 20 36 32 36 20 30
2 0 2 1 6 2 6 0
34 34 35 34 03 01 00 00 00 06 00 53 4F 4E 47 00 00 F7
4 4 5 4 S O N G

This loop continues until the list of available items is empty:

F0 43 50 00 05 05 00 F7        Request next dir list item 
Genos responds: F0 43 50 00 05 7F 01 01 01 42 00 00 F7 End of list

Genos responds with a unique message saying “no more” (0x7F).

Finally, it’s time to close the connection:

F0 43 50 00 00 01 00 00 F7     Disconnect command

Genos drops the connection and returns to normal operation, that is, it displays its usual main screen.

Sharp-eyed readers have noted the “ChordTracker” subdirectory in the “SONG” directory. ChordTracker created this subdirectory when I transfered an accompaniment from my iPad to Genos. How did ChordTracker create the subdirectory and perform the transfer? That’s new territory (more SysEx) to explore!

Well, that was one way to stave off the New Year’s blues. 🙂

Copyright © 2022 Paul J. Drongowski

Wired USB iPad rig

After investigating a wireless iPad-based rig for church gigs, I decided to take a 180 and try wired! The urge was inspired by a recent thread in the MusicPlayer Keyboard Forum about taming the rat’s nest of wires that engulf our keyboard set-ups.

My approach goes all-in with MIDI over USB. Both the Korg Microkey Air 49 and the Boss EV-1-WL wireless MIDI expression pedal have full-size USB-B device ports, so it made sense to start with them and build out.

I really detest the iPad 3.5mm audio jack on my 3rd generation iPad Air. That may sound like crazy-talk to people owning phones and iPads without a 3.5mm audio jack. However, the jack’s placement exposes an inserted 3.5mm plug to all sorts of physical and sonic abuse. Every time I pick up or move the iPad, the jarred plug causes all manner of crackles, pops and hum — at loud volume, no less.

Thus, an external USB audio interface is a necessity. I pulled out an old Behringer UCA222 2-in/2-out USB audio interface, which was my PC audio workhorse for many years. (Now replaced by a Yamaha AG-06 mixing console and audio interface). The UCA222 is not the best interface, but it’s inexpensive. Sweetwater is selling these for about $10USD and you can’t go wrong at that price.

Based on my success with UCA222, I put a Creative Labs Sound Blaster Play 3 external USB sound adapter on order ($20USD). The Play 3 is even smaller and will do 24-bit, 96kHz given driver and control panel support. The Play 3 is not spec’ed as IOS compatible, but folks are having success with Play 3 and iPad.

For extra credit, I would eventually like to control IK Multimedia B-3X with a Crumar D9U DIY drawbar controller. The D9U hasn’t seen much action lately and it would be good to get it into the mix. The D9U can do MIDI over USB through its micro USB port. That particular test must await another rainy (snowy?) day as I need to adapt the D9U Arduino sketch for B-3X.

Well, if you were counting, that’s four (4) MIDI devices. The Apple Lightning to USB 3 Camera Adapter has only one USB-A host port. Uh, oh. We need a hub. Fortunately, I have a few Sabrent HB-MCRM 4-port portable USB 2.0 hubs on hand. The Sabrent HB-MCRM is small, light and cheap (less than $10USD).

One could use an olde style Apple USB Camera Adapter, but why put yourself through the agony? Better to have the Lightning charge/power port than fight electrical current restrictions. BTW, I wish the Belkin RockStarâ„¢ had three ports: USB-A host, Lightning charge and 3.5mm audio.

It’s not rocket science, so plug it all in and success! Core MIDI merges the MIDI input streams together. Korg Module Pro and Crudebyte iSymphonic Orchestra respond to the Microkey Air and the Boss EV-1-WL expression pedal. I expect the D9U to function correctly, too, if I get its sketch right.

                                 S   <---->  Microkey Air 49
a
Apple b H <----> EV-1-WL expression pedal
iPad Air <----> USB <----> r u
Adapter e b <----> UCA222 audio
n
t <----> D9U drawbars

As to power, the EV-1-WL is not bus-powered. It needs either an external power adapter (9V 500mA center negative) or two AA batteries. The Korg Microkey Air and the Behringer UCA222 draw power from the Apple adapter through the Sabrent hub. (The Sabrent hub itself is not a powered hub, keeping things simple.)

A Lightning extension cable connects the Apple adapter to the iPad. This means only one cable to the iPad. The Lightning connector is reliably tight and eliminates the pops and crackles when moving the iPad. Most of the cabling sits on the floor out-of-sight.

As to audio connection, there are two options. Option 1 is running a long-ish unbalanced analog cable to the monitor. (The monitor is a Behringer B205D with a balanced XLR OUT to front-of-house.) Option 2 adds a USB extension cable between the hub and the audio interface (UCA222) for most of the distance with a short unbalanced cable from the interface to the monitor. Option 2 keeps things digital as long as possible, eliminating hum and other noise problems due to a long unbalanced cable run. Of course, there are limitations to USB extension (USB 2.0: 5M, USB 3.0: 3M).

Well, there you have it — an inexpensive, super-light, wired iPad rig. I haven’t found Bluetooth MIDI latency to be a problem, but wired latency should be less, if that is your concern. The USB approach seems to be less fiddly as to pairing, merging, etc.

If you’re curious about my wireless MIDI adventures, check out:

More blasts from the past about the Crumar D9U:

The Crumar D9U works pretty well with the Yamaha Reface YC, too.

Copyright © 2021 Paul J. Drongowski

ChordPro to MIDI accompaniment: Demo

Work continues on my Java program to translate ChordPro songs to Yamaha accompaniment (SMF). The code is fairly stable and mostly I’ve been writing example songs in ChordPro format for testing. The range and variety of musical craziness is amazing: weird chords (“Superstition”, “Michelle”), changing time signatures (“Two Of Us”), changing key signatures (“My Girl”), unusual time signature (“Everybody Wants To Rule The World”), and more.

Today, I want to give a taste of what to expect. I plan to distribute the Java executable as a “jar” file and will also make the source code available. To keep things simple, the program runs from a command line — no graphical user interface:

    java -jar cp2mid.jar ItsTooLate.cho

The program is named “cp2mid” and “cp2mid.jar” is the Java executable. We need to invoke java explicitly because it is an interpreted language and the executable consists of Java bytecodes.

The above command produces a Type 0 Standard MIDI File (SMF) named “ItsTooLate.mid”. This file must be sent to a Yamaha arranger like Genosâ„¢ by whatever means you have at your disposal, i.e., a USB flash drive or Yamaha Musicsoft Downloader.

Here is the first part of “ItsTooLate.cho”. The song begins with set-up directives including “{stylecode: }”, which selects the accompaniment style (“Cool8Beat”). You could leave out key, time, tempo, or stylecode and go with the current panel settings. This flexibility allows experiments with different tempos or different styles, including USER styles.

{t: It's Too Late }   
{key: Am}
{artist:Carole King}
{time: 4/4}
{tempo: 104}
# Style: Cool8Beat
{stylecode: 5635}

{start_accomp}
[Am7][*IA]

# Introduction (intro riff)
{start_of_instrumental}
[Am7][*MA] [D6] [Am7] [D6]
{end_of_instrumental}

{c: Verse 1}
[Am7] Stayed in bed all morning just to [D6] pass the time.
[Am7] There's something wrong here there can [D6] be no denying.
[Am7] One of us is changing
Or [Gm7] maybe we've just stopped [Fmaj7] trying. [Fmaj7][*FA]

{start_of_chorus}
And it's too [Bbmaj7][*MB] late baby now [Fmaj7] it's too late
Though we [Bbmaj7] really did try to [Fmaj7] make it.
[Bbmaj7] Something inside has [Fmaj7] died
And I can't hide [Dm7] and I just can't [Esus4:2][*FB] fake it. [E7#9:2]
{end_of_chorus}

The screenshot above shows the Genos song player with “ItsTooLate.mid” loaded and ready. Choose either the Lyrics or Score display (optional). Then hit play!

The next screenshot shows the Lyrics display. It should look familiar if you have played a Yamaha arranger. The arranger highlights the current lyric syllable or phrase in time with playback. Compare the screenshot with the ChordPro song and you’ll get an idea of what to expect for each ChordPro construct. A lyric phrase is not broken into syllables, but is associated with the chord preceding the phrase.

The following screenshot shows the Score display. It’s a different view of the same song. Lyrics appear below the staff and chords appear above. The time and key signature are displayed on the first page. Follow the bouncing ball during playback.

So, how does it sound? Listen to a quick demo (MP3) with me noodling on top.

That’s a taste of what’s ahead. I hope you will try cp2mid when it’s ready.

Copyright © 2021 Paul J. Drongowski

ChordPro auto-accompaniment: MIDI messages

I’ve made quite a bit of progress with my Java program that translates extended ChordPro songs into a Yamaha-compatible accompaniment MIDI file. This blog post describes the stuff inside the MIDI files produced by the program (cp2mid).

The MIDI file contains MIDI meta and SysEx (System Exclusive) messages which drive the Yamaha accompaniment engine. When the MIDI file is played back on a compatible Yamaha arranger keyboard (e.g., Genos), the keyboard generates an accompaniment as directed by the chord and section change messages in the MIDI file. It may sound odd to hear this, but the MIDI file doesn’t contain a single note ON or note OFF message! It’s all accomplished through control messages and the accompaniment is produced in real-time.

The MIDI file is a Type 0 Standard MIDI File. It starts with a bunch of set-up messages:

  F0 05 7E 7F 09 01 F7                           GM Reset 
F0 08 43 10 4C 00 00 7E 00 F7 XG System ON
FF 58 04 04 02 18 08 Time signature
FF 59 02 02 00 Key signature
FF 51 03 07 EF eb Tempo
F0 0D 43 73 01 51 05 00 03 04 00 00 2C 05 F7 Style code
F0 04 43 60 7A F7 Accompaniment Start

All of these message types are defined in the Yamaha Genosâ„¢ Data List PDF document. The messages beginning with “F0” are System Exclusive (SysEx) messages. Messages starting with “FF” are MIDI SMF meta messages. All messages are Yamaha proprietary (code “43”). The trick, of course, is filling in the correct values for the tempo, key, etc.

GM Reset and XG System ON initialize the tone generator. Time signature, key signature and tempo are SMF meta messages which control and arranger’s sequencing engine. The Style Code message selects one of the many built-in accompaniment styles. The Accompaniment Start message tells the accompaniment engine to get busy.

Once set-up is complete, the rest of the MIDI file consists of Chord, Lyric and Section Control messages. Again, these messages are all defined in the Genos Data List PDF document.

Here is a typical chord message:

    F0 08 43 7E 02 37 08 37 7F F7          Chord Bm/B

It tells the accompaniment engine to play a B minor chord (0x37 0x08) with a B bass note (0x37 0x7F). The neatest thing about the ChordPro conversion program? It makes it easy to play and hear difficult to finger chords like slash chords and unusual chord types like Cminmaj7-9.

Lyrics are inserted into the MIDI file using the SMF Lyric meta message:

    FF 05 len [Data]

For example, this Lyric meta message:

    FF 05 04 79 6F 75 20      0x79='y', 0x6F='o', 0x75='u', 0x20=' '

encodes the syllable text “you “.

No attempt is made to separate lyric text into syllables or to assign syllables to individual beats. When a lyric phrase is encountered in the ChordPro file, the phrase is inserted right after the preceding Chord message, i.e., it has the same MIDI timestamp as the preceding Chord message.

A Section Control message selects the current accompaniment section (pattern). The following message:

    F0 06 43 7E 00 09 7F F7               Section Control Main B: ON

selects the “MAIN B” section (0x09 0x7F). Because playback is fully automated, section changes are precise.

The penultimate message stops accompaniment:

    F0 04 43 60 7D F7                     Accompaniment Stop

The final SMF meta message ends the SMF sequencer track:

    FF 2F 00                              End Of Track (mandatory)

Overall, that’s a lot of power with just a few message types! Most of the Java code involves scanning the ChordPro input, book- and time-keeping. Java has a good MIDI library which makes coding easier.

As to time-keeping, all MIDI events (messages) have a timestamp. Messages issued from set-up directives before start_accomp occur in the first song measure. The start_accomp directive advances the MIDI clock to the first beat of the second measure. Thus, the first chord and lyric (if any) occurs at the beginning of the second measure. Thereafter, MIDI time advances in accord with each chord beat count (default: a full measure as determined by the current time signature).

Look here for more information about ChordPro format.

Copyright © 2021 Paul J. Drongowski

ChordPro for Yamaha accompaniment

Time to take the wrapping paper off my current development project.

It starts with ChordPro. ChordPro Format is perhaps the most popular notation for rock, pop, soul and folk tunes. A ChordPro format song contains lyrics and chords, usually formatted for easy display and reading. Strummers and plinkers everywhere use ChordPro songs as lead sheets.

It ends with Yamaha Genos, Tyros and PSR accompaniment. Genos — and other recent Yamaha arrangers — play MIDI files containing chords and lyrics. Genos displays either a running score or lyrics (plus chords) during playback.

What is missing is the bridge between ChordPro and Genos. My current project is the bridge. It translates an extended ChordPro file to a MIDI file which is compatible with Genos and other mid- to high-end Yamaha arranger keyboards. So far, I have a prototype up-and-running.

I emphasized the word “extended” because ChordPro format by itself is not sufficient for playback. The format does not have a precise notion of time. ChordPro relies on the musician to interpret the song on the fly. It assumes that the musician has heard the song before and knows when to change chords. As usual with computer stuff, playback needs more precise semantics. That’s where the extensions come into play.

Since there are a gazillion ChordPro songs on the Interwebs, I wanted to play back ChordPro files with as few modifications as possible. Thus, the first rule is “Each notated chord is held for one measure.” Of course, many songs change chords within a measure, too. (Even “Louie, Louie”!) Enter the first extension. A notated chord may have an optional beat count which specifies the number of beats to hold the chord, or more precisely, the number of time divisions (quarter notes or eigth notes) to hold the chord.

As I discovered during testing, existing ChordPro song files have a fair number of warts. Sometime the chord progressions are whack. The files often have random playing directions which ChordPro happily snarfs up as lyric text. ChordPro is very forgiving as it is primarily a formatting representation and tool. The initial goal — playing a ChordPro song with just a few additions — is unrealistic; expect to do some clean-ups.

Plain, unchanging accompaniment is pretty boring after a short while. Therefore, I added annotations for section changes, fills and breaks. Certain ChordPro directives are optional, but strongly recommended: key, tempo, and time signature. Tempo and time signature obviously guide playback speed and the interpretation of chord hold time. The key signature will set the arranger’s score display to the appropriate key.

Stylecode is an extension. It is a decimal number that selects the arranger accompaniment style, .e.g., 60sVintageRock, Oldies R&R, etc. A style name would be more convenient, but then I would need to develop a style name to code database for each arranger. Forget it; keep it simple. Besides, the PSR Tutorial site has such spreadsheets — just look up the style code yourself.

Start_accomp and stop_accomp are extensions, too. Start_accomp should (must) appear after all the basic playback settings are made. When the MIDI file is played back, the arranger will start or stop the accompaniment engine as directed. Start_accomp begins playback from the second measure; the first measure is reserved for set-up.

The translation program does not implement every and all ChordPro directive. It ignores formatting related directives and it doesn’t handle tablature (tab).

Let’s put all of this together and look at an example. Here is a snippet of “It’s Too Late” by Carole King.

{t: It's Too Late } 
{key: Am}
{artist:Carole King}
{time: 4/4}
{tempo: 104}
# Style: Cool8Beat
{stylecode: 5635}
{start_accomp}

[Am7][*IA]
# Introduction (intro riff)
[Am7][*MA] [D6] [Am7] [D6]

{c: Verse 1}
[Am7] Stayed in bed all morning just to [D6] pass the time.
[Am7] There's something wrong here there can [D6] be no denying.
[Am7] One of us is changing
Or [Gm7] maybe we've just stopped [Fmaj7] trying. [Fmaj7][*FA]

{start_of_chorus}
And it's too [Bbmaj7][*MB] late baby now [Fmaj7] it's too late
Though we [Bbmaj7] really did try to [Fmaj7] make it.
[Bbmaj7] Something inside has [Fmaj7] died
And I can't hide [Dm7] and I just can't [Esus4:2][*FB] fake it.[E7#9:2]
{end_of_chorus}

Lines beginning with ‘#’ are comments. Lines beginning with ‘{‘ are directives. Each directive must have a closing ‘}’ and consist of one line only. My translation tool supports the following simple directives:

  • title (or ‘t’): Song title
  • key: Song key
  • artist: Performing artist
  • composer: Song composer
  • copyright: Copyright information
  • comment (or ‘c’): Comment to be ignored
  • time: Time signature
  • tempo: Song tempo in BPM
  • stylecode: Yamaha style code (a decimal number)
  • start_accomp, stop_accomp: Starts and stops the accompaniment

As I mentioned, time, tempo and stylecode are optional, but necessary — unless you are willing to roll with the defaults. Start_accomp must be the final directive before the first chord and lyric in the song. Start_accomp generates the magic message needed to start accompaniment.

Chords look like regular ChordPro chords. Chord names are surrounded by square brackets, e.g., “[Am7]”. Nothing looks amiss until the end of the chorus, e.g., “[Esus4:2]” and “[E7#9:2]”. “:2” is a beat count. Each chord is held for two quarter notes — quarter notes because the number of divisions per bar (the “denominator”) of the time signature is four. It’s our job to make sure that the counts add up to a full measure in order to keep everything synchronized to measures.

The translation program (yet unnamed!) is very forgiving when it comes to chord spelling. However, it only recognizes and generates the 34 Yamaha chord types which are supported by Yamaha arrangers:

    Maj        7        min        minMaj      aug      dim 
Maj6 7sus4 min6 minMaj7 aug7 dim7
Maj7 7b5 min7 minMaj7-9
Maj7#11 7-9 min7b5
Maj9 7#11 min9
Maj7-9 7-13 min7-9
Maj6-9 7b9 min7-11
7aug 7aug
8
5
sus2
sus4

If the chord is not recognized, you will get a major or minor triad.

ChordPro allows annotations, that is, constructs beginning with “[*” and ending with “]”. Annotations ordinarily are playing instructions that are displayed in a pretty-printed ChordPro song. Annotations are extended with accompaniment section control commands:

  • Introduction: [*IA] [*IB] [*IC] [*ID]
  • Main section: [*MA] [*MB] [*MC] [*MD]
  • Fill in: [*FA] [*FB] [*FC] [*FD]
  • Break: [*BR]
  • Ending: [*EA] [*EB] [*EC] [*ED]

A section control command usually follows a chord and takes effect at the same time as the chord change.

ChordPro supports paired formatting directives like:

    {start_of_chorus} 
...
{end_of_chorus}

I am currently experimenting with these directives to control lyric and chord formatting. Yamaha’s lyric display allows line breaks and page breaks. Start of chorus (abbreviated “{soc}”) generates a page break. I added a new directive pair for handling long instrumental breaks, e.g.,

    {start_of_instrumental} 
[Cmaj7][*MC] [Fmaj7] [Fmaj7] [Am7] [Gm7] [Fmaj7]
[Dm7] [Esus4:2][*FC] [E7#9:2]
{end_of_instrumental}

Yamaha’s lyric display runs chords together when no lyric text is present. The new directive provides some separation between chords by generating filler lyric text (dashes, to be exact).

That’s the story. Testing continues. I will make the Java source code available as soon as possible. So far, so good. The concept works.

Copyright © 2021 Paul J. Drongowski

Review: The Beatles: Get Back

Well, I’m about half-way through Peter Jackson’s The Beatles: Get Back and I suppose that I should watch all of it before writing a “review.”

You’ll find plenty of fawning reviews on line — this isn’t one of them. As to actual film criticism, the The Guardian review gets it right. This is an over-stuffed Thanksgiving turkey. Yes, it tastes good, but it took too long to cook and has too many leftover bits.

So I won’t be accused of a hatchet job, I must first commend Jackson for boiling Michael Linsey-Hoggs film and mono Nagra sound into eight hours. Genuine kuddos are due because that must have been a herculean task. Audio quality is superb. Beautiful clean-up and machine learning-based extraction. George must be looking on Giles work with fatherly pride.

First, the bait and switch. Last December’s Sneak Peek was total fun. The preview lifted my spirits and gave me the impression that, at least, we could have a fun, light and tight film.

Wrong impression. The newly released film has some very good to great parts — sheer genius in a few cases. However, much of the film reminds me of every teenage (and adult!) garage rehearsal with much faffing about and no real work getting done. Sitting through these parts is reliving every wasted, unproductive, tedious second when you really wanted to be somewhere else.

Watching Get Back is like watching NFL RedZone. I love RedZone. I turn it on at 10am, catch the best bits of my favorite teams, read The New York Time, cook and eat lunch, have a mid-afternoon dessert and cup, and wrap everything with the touchdown montage. However, nobody — self included — actually watches every second of “seven hours of commercial-free football.” Nobody.

There are clearly bits that could have been cut without loss. A BBC radio program from the 1960s? Forget it. Re-litigating personal drama between the group members? Don’t “Let It Be,” let it go instead. Fifty years on, most people don’t really care or shouldn’t.

For the record, I did see the Let It Be documentary in 1970.

I’m still struck by the number of leeches and sycophants surrounding the late-stage Beatles. If you really want to know why they broke up, look to the absolute shafting they endured from Dick James, Allen Klein, Alexis Mardas, and the rest of the self-promoters and music industry white-collar criminals. Nothing attracts flies like a steaming pile of cash. Apple was a managerial and financial disaster.

For example, it’s embarrassing to watch Lindsay-Hogg force his vision of the final concert on the lads. Jackson could have easily spared the man’s dignity and left this out. Lindsay-Hogg comes off as a self-serving, upper-class English twit — an early parody of rock and roll pretensions and excesses to come a la Spinal Tap. As to dignity, why did Jackson humiliate long-gone Peter Sellers? Cutting room.

In contrast, I offer the genuine, warm affection and devotion shown my Mal Evans, stage manager and long-time companion to the band. Ringo is his authentic “all I ever wanted was a paying gig” self. Just blokes and punters like us. Even Ringo is bored with the faffing around. Why should Jackson force the boring stuff on us, too?

As to other quick edits, if a song didn’t make it to the Let It Be album, why bother? Save those songs for another day and another film. [Suggestions to follow.]

In the end, there are three and half movies here. Jackson in his head and heart must know this. I wish he had asserted his own clout and signed a few more deals based on a few more story lines.

When Ringo says “You see, I’d watch an hour of him, just playing piano,” there’s your first movie. McCartney was and is born to make music. Start with the Ringo quote and follow it with all of the solo Paul parts. That would be a fascinating portrait of McCartney as a songwriter at that stage of his career.

For the second film, take the most important rehearsal parts and show how the Beatles worked from inspiration to finished product. The scene where the song “Get Back” spontaneously emanates from Maca and his bass is brilliant. More please. Concentrate on just a few songs, if necessary, in order to keep running time reasonable.

Even George and Ringo knew that riff was the hook. Instantly. That’s the way true hits are born. Not that awful “Maxwell’s Silver Hammer” which the Beatles themselves detested.

Finally, give us the movie which the Sneak Peek promised. Sure, give a small taste of the songwriting and development. George, John and Paul were all at the top of their game in 1969. Maybe create a late-stage version of “A Hard Day’s Night” with people tugging the boys every which way. But, for heaven’s sake, make it a comedy. More Richard Lester, less Maysles and Zwerin.

We all need a good laugh right now. We also need irreverent and rebellious youth to thwart and overthrow today’s authoritarians. Once again, the world is in the grip of controlling neo-fascists who must be taken down.

I fully expect fan-edits to emerge.

Happy watching, but bring a book or two along.

[Update] Another recommended review: ‘The Beatles: Get Back’ Review: Peter Jackson Gets Lost In The Treasure Trove Of Fab Four Footage.

Copyright © 2021 Paul J. Drongowski

Black is back: Software sales

With hardware in short supply — even a liquor shortage! — 2021 could be the biggest year for software Black Friday.

Sales abound! Lately, I’ve focused on pulling together an Apple iPad rig:

If you read some of these articles and wanted to give these apps a try, now is your chance.

Here’s a quick list of soon-to-be-gone bargains{

I could easily go on and on, but these are products that I actively use. Keep your eyes peeled when browsing!

I immediately jumped on the IK Multimedia Hammond B-3X app at half price and encourage you to do the same. One needs to take a deep breath before spending $60USD on an iPad app. However, B-3X is normally $130. If ever you wanted it…

B-3X is a stunning recreation. Although Korg Module’s B-3 organ sounds are good, B-3X has it beat, providing an abundance of live controls and a superb Leslie effect. So far, I’ve encountered only one drawback — B-3X does not merge MIDI messages from two Bluetooth MIDI sources. At any time, B-3X responds only to the Korg Microkey Air keyboard alone or to the Boss EV-1-WL wireless MIDI expression pedal alone. My experiments will continue and I may need to upgrade from midimittr (free) to Audiobus ($9.99).

I’m still hunting for good pipe organ sounds. I started a 7-day trial of the Korg Module Organ and Clavinet collection. If you don’t want to spring for IK B-3X, the Organ and Clav collection is a good bet. Many of the B-3 and Clav sounds really nail “the classics,” e.g., Stevie’s auto-wah clav. The pipe organs leave me wanting. But, hey, at a $9.99 sale price…

As to pipe organs, don’t forget the free Strand Organ and Jeux d’orgues Mini iPad apps. Made with love.

Keep an eye on Toontrack. They run their best sales during the holidays. Patience pays off. When EZKeys MIDI expansion packs are ten bucks a pop, it’s EZ to build a songwriting library.

If new site content is a little skint, I’m deep into a music-related coding project. Hint: it involves ChordPro. Between playing, new iPad apps, coding and the holiday, there’s not much time for writing.

Happy Thanksgiving!

Copyright © 2021 Paul J. Drongowski

Wire Less: Part 3, Boss EV-1-WL wireless MIDI expression pedal

Halleluia, the slow boat from Malaysia arrived and it brought a Boss EV-1-WL wireless expression pedal. The EV-1-WL (henceforth, “EV”) is a compact expression pedal which sends MIDI Continuous Controller (CC) messages over Bluetooth BLE, USB and conventional serial MIDI.

Boss has quite a bit of information on-line, so I won’t repeat too many of the basics here. No doubt, you’re here looking for my value-added.

My first impressions were:

  • Man, this thing is small.
  • Man, this thing is light.
  • This thing is robust.

My point of reference is the Boss FV-500L (FV) which was my mainstay volume and expression pedal for many years. Since my switch away from Roland to Yamaha (2011), I’ve been using the Yamaha FC-7 with MODX and Genos at home and at gigs. The FV-500L is built like a tank — and weighs like a tank. The FC-7 has held up pretty well although it’s not as Sherman-esque as the FV.

Boss EV-1-WL (fore) and Boss FV-500L (back)

Since we’re comparin’, the EV and FV achieve roughly the same angle in the down position. Due to the placement of the pivot point, however, the FV has a wider sweep than the EV. Some people may not like the EV’s relatively short sweep. The FC-7 has the widest sweep of all.

Boss EV-1-WL (fore) and Yamaha FC-7 (back)

Practically, the EV feels comfortable when sitting or standing. The FV is a little less comfortable when standing. The FC-7 is least comfortable for standing play if you absolutely need to reduce pedal position to its minimum point. I’ve had some success with FC-7 angle adjustment although its adjustment plate always seems to work itself loose. After trying the EV, I’m good with its sweep and playing angle.

The EV is ready-to-go right out of the box, including two AA batteries. I’m trying to build a wireless iPad rig:

So, that is my test set-up. I followed the pairing directions to a T and the EV came up in the EV-1-WL configuration app and in Korg Module Pro. [More Bluetooth gymnastics below.]

I recommend the calibration procedure. It works. I checked out the result with MIDI-OX and the EV sends over the full CC value range (0 to 127).

If I have a beef, it’s the amount of force needed to engage the EV’s expression switch. I pressed and pressed with the EV on a carpeted floor and could not get the switch to engage. There are LEDs to indicate the switch state and they just were not coming on. I was able to engage the switch by putting the EV on a table and pressing very firmly with my hand. The app has a sensitivity adjustment and it works. Expect to use it.

I’m not really sure how I would use the expression switch when playing. And now here’s my second beef — the EV-1-WL sends only MIDI continuous controller (CC) messages. No pitch bend, no program change. Worse, it doesn’t cover the full range of CC messages, supporting only CC#1 to CC#31 and CC#64 to CC#95. Somewhat dubious omissions. I really want to send bank select (CC#0 and CC#32) and program change via two external foot switches. Bummer. I hope Roland/Boss add this capability.

So, what else doesn’t mother tell you? As usual, Boss are less than forthcoming about important details hoping to force you into one of their own accessories. Here’s a few helpful details:

  • Power adapter: Boss recommend the PSA-120S adapter: 9V DC, 500mA, tip/center negative. The 1SPOT works just fine.
  • Footswitch break-out cable: Control 1 (CTL1) is tip and Control 2 (CTL2) is ring.
  • 3.5mm MIDI break-out: The 3.5mm MIDI jack (plug) follows the “Korg convention”, which adheres to the current MIDI Association standard.

Serial MIDI works as advertised. I check out both serial MIDI operation and MIDI over USB using MIDI-OX and Windows 10. No special driver required. Please see my post about 3.5mm MIDI conventions.

Bluetooth MIDI

The olympics of the weird always commence with IOS and Bluetooth MIDI. I’m running on IOS 14.8.1.

Over several days of use, the EV consistently could not remember its pairing with my iPad. Turn it on and it flashes the blue LED slowly, suggesting that it awaits the iPad. Whether the iPad’s Bluetooth is initially enabled or disable, the EV just sits there and flashes slow blue. No connection.

The EV does not appear in the list of Bluetooth devices displayed in the IOS Bluetooth settings. The Korg Microkey Air is there, but the EV is AWOL. Right now, I’m not sure who is ghosting whom.

If an app has an explicit rendezvous feature, you can re-pair with the EV by pressing the EV’s pair button. The EV flashes fast blue when it is ready to pair. Standard operating procedure is to pair explicitly when sitting down to play. Korg Module Pro and the Roland/Boss EV-1-WL app will rendezvous with the EV when requested. Once the app connects, I leave the app running in the background even if I move on to SampleTank or iSymphonic. SampleTank does not not have the ability to explicitly rendezvous (initiate pairing) with the EV or any other Bluetooth MIDI device. I wish that all apps had this feature.

I’ve had spotty results with midimittr. midimittr will establish a Bluetooth session, slightly increasing latency. However, I’ve observed occasional bizzarre behavior with the EV through midimittr — huge leaps in volume indicating the presence of a true bottleneck somewhere in the MIDI message chain. Not good.

One other small snag. Be sure the EV is sending the correct CC message as needed by the receiving app. SampleTank IOS does not respond to CC#11 Expression. [Surprise!] I configured the EV for CC#7 Volume and all is well.

Overall, I’m satisfied with the EV-1-WL. The Bluetooth MIDI part is a little quirky and tetchy. I hope Roland/Boss get this ironed out. As Korg have (unfortunately) discovered, chasing Apple updates, etc. is a migraine headache, having had their own share of problems with the Microkey Air and IOS Bluetooth.

Copyright © 2021 Paul J. Drongowski