Java note mapper (v0.1)

Here’s a little bit of Java code to brighten your day.

Two weeks ago, I described the additional hi-hat notes in the Yamaha Genos™ Revo drum kits. The hi-hat sounds replace noises like sequence click, etc. in the lowest numbered notes of the MIDI scale. Thus, a Genos factory style wheezes, zings and clicks when it is played on a legacy PSR or Tyros arranger workstation.

Quite a few people would like to try the new Genos styles, but the hi-hat notes pose a major barrier to conversion (i.e., porting a Genos style to legacy PSR/Tyros). Jørgen Sørensen’s Revo Drum Cleaner suppresses these sounds, but does not remap the Genos hi-hat notes to General MIDI (GM) standard notes.

That’s where note remapper comes in. Note remapper is an experimenter’s kit, not a finished tool. Jørgen (and Michael Bedesem) have written many rather nice tools for the PSR/Tyros arranger workstations. Note remapper gets the job done from the command line, so don’t expect a graphical user interface (GUI) or even a nice installer! It’s an experimenter’s kit.

However, what you do get is source code. Here is the ZIP file containing source, precompiled Java classses (executables), map files and examples.

What else can you do with note mapper? Well, note mapper operates on any Standard MIDI File (SMF). Thus, it’s not just a PSR/Tyros utility. Maybe you want to write a Java program of your own. The source code will give you a good starting point. Copy and modify to your heart’s content.

If you are into converting PSR/Tyros styles, take notice (pun) that note mapper changes both the MIDI note number and velocity according to maps in the files keymap.txt and velmap.txt, respectively. Therefore, you can also map to and from Mega Voices.

Interested? Then please read on. The following text is taken from the README files.

Description

This Java program maps the notes in a standard MIDI file according to a key (note number) map and a velocity map. Use it to map the Yamaha Revo hi-hat/drum sounds. Or, use it to map to and from Mega Voice. It’s all up to you and how you design your key and velocity maps.

The note mapper is launched from the command line (no GUI). There are two command line options:

   -v  Verbose flag
   -w  Write default keymap.txt, velmap.txt and hhmap.txt files

The -w option gives the user a quick start by writing a few default map files. Both -v and -w are optional.

The rest of the command line consists of an (optional) MIDI channel number and the name of the MIDI file to be mapped. The channel number must be an integer in the range [1:16]. Only notes in the specified channel are mapped. The default channel is 10 (the GM/XG drum channel).

The note mapper writes a new file named mapped.mid. It’s up to the user to rename or save this file. If the file in not renamed or saved, it will be overwritten when note mapper is run again.

The note mapper assumes there are two files, keymap.txt and velmap.txt, in the working directory where the note mapper is launched. The note mapper reports an error if it cannot read these two files. The default key and velocity maps preserve the input; the input notes are sent to the output without change.

A map file consists of 128 positive integers in the range [0:127]. Each integer defines how its corresponding note or velocity value is mapped to a new value. Essentially, each integer in the file is loaded into a 128 byte map array indexed by either the incoming MIDI note number or the incoming MIDI velocity value.

The hhmap.txt maps the Revo hi-hat note numbers to General MIDI hi-hat note numbers.

    Revo notes        GM notes
    -------------     ----------------
    13 14 15 16   --> 42 Hi-Hat Closed
    21            --> 44 Hi-Hat Pedal
    17 18 19 20   --> 46 Hi-Hat Open
    22            --> 55 Splash Cymbal

The Examples directory contains two example Genos styles. Be sure to read the READ_THIS.TXT file in that directory, too!

Example command lines

Map the notes for channel 10 in the MIDI file named “Mr.Soul_factory.T552.mid”.

    java MapNotes 10 Mr.Soul_factory.T552.mid

Write the default keymap.txt, velmap.txt and hhmap.txt files before mapping:

    java MapNotes -w 10 Mr.Soul_factory.T552.mid

The default keymap.txt and velmap.txt files do not change/map notes, i.e.,
they are the “identity mapping.”

How to use note mapper to change a style

To use the note mapper on a style, you must split the style into its MIDI and non-MIDI parts using Jørgen Sørensen’s Split/Splice tool. Note mapper, like most commercial MIDI tools, does not recognize or retain non-MIDI data. Thus, you need to run the style through Split/Splice to save the non-MIDI information.

After splitting the style, run the style through the note mapper. The note mapper writes a file named “mapped.txt”. Splice mapped.txt with the non-MIDI data produced in the preceding step. Splicing the mapped MIDI data with the non-MIDI data produces a complete style file (MIDI+CASM+OTS).

Transfer the style file to your PSR/Tyros and revoice the style parts, test the style, edit the OTS, and so forth.

If you don’t like how the mapped file sounds, then you can reuse the non-MIDI data and do another map/splice, assuming that you didn’t modify the OTS.

Compiling

The distribution comes with source code (*.java files) and precompiled class files (*.class files).

You can, of course, modify the source code and recompile. You need the Java development kit which includes the Java compiler, package definitions, and so forth. To recompile, just enter:

    javac MapNotes.java
    javac NoteMapper.java

I have included source for a quick and dirty MIDI file dumper:

    javac QuickDumper.java
    javac QuickDump.java

You may prefer to dump MIDI files using one of the much better tools written by Jørgen Sørensen or Michael Bedesem. See:

The Examples directory

The Examples directory contains two example styles: Mr.Soul and SoulSupreme. Each style has several files, so here’s a little guide.

    Mr.Soul_factory.T552.prs    Original Genos factory style
    Mr.Soul_factory.T552.mid    Original Genos MIDI part
    Mr.Soul_factory.T552.nmi    Original Genos non-MIDI part
    Mr.Soul_mapped.T552.mid     MIDI with mapped hi-hats
    Mr.Soul_mapped.T552.sty     New style file with mapped hi-hats

The *.class files are the Java executable files. Example command line:

    java MapNotes 10 Mr.Soul_factory.T552.mid

The note mapper produces a file named “mapped.mid” which you may rename to something else, e.g., Mr.Soul_mapped.T552.mid.

keymap.txt and velmap.txt are the key (note number) and velocity map files needed by note mapper. hhmap.txt is my initial hi-hat note map.

Workflow

The overall workflow is:

               Mr.Soul_factory.T552.prs
                          |
                          |
                          V
              Jørgen's Split/Slice (split)
              |                          |
              |                          |
              V                          V
  Mr.Soul_factory.T552.mid   Mr.Soul_factory.T552.nmi
              |                          |
              |                          |
              V                          |
         Note mapper                     |
              |                          |
              V                          |
      Rename mapped.mid                  |
              |                          |
              V                          |
  Mr.Soul_mapped.T552.mid                |
              |                          |
              |                          |
              V                          V
             Jørgen's Split/Slice  (splice)
                          |
                          |
                          V
               Mr.Soul_mapped.T552.sty

Copyright (c) 2017 Paul J. Drongowski

Mega Voice in PSR/Tyros styles

Yes, this site still answers questions and doesn’t just publish rumors and FUD. 🙂

Recently, a member of the PSR Tutorial Forum needed help using a Megavoice in a custom Tyros style. My answer seemed to be useful to a broader audience, so I decided to post my answer here. The information applies to PSR arrangers, too, because the Tyros and PSR share the same SFF1 and SFF2 (SFF GE) style formats.

Megavoice guitars are very different than regular guitar voices.

Regular voices are the usual MIDI voice: 128 velocity levels and only one basic sound. For example, nylon guitar is just the pitched, melodic sound of the notes either louder or softer depending on note velocity.

Megavoice guitars (and other Megavoices) are different. Please look at the Megavoice Map starting on page 16 of the Tyros Data List PDF.

Let’s take a look at the Mega NylonGuitar voice. For MIDI notes B5 and below, the MIDI velocity is broken into eight (8) ranges:

    1- 20 Open soft
   21- 40 Open med
   41- 60 Open hard
   61- 75 Dead
   76- 90 Mute
   91-105 Hammer
  106-120 Slide
  121-127 Harmonics

Each range plays a different kind of sound. So, the MIDI velocity determines which guitar sound. Then, the velocity within that limited range determines how loud it will be.

Example 1: MIDI note A4, velocity 38 makes an Open Med guitar sound which is loud.

Example 2: MIDI note A4, velocity 2 makes an Open Med guitar sound which is quiet.

Example 3: MIDI note A4, velocity 110, makes a Slide guitar sound.

Now, let’s look at the last two columns in the Megavoice map, again, Mega NylonGuitar voice. For MIDI notes between C6 and B7, the Tyros plays a Strum noise. The velocity in this case determines the Strum noise loudness over the full range 1-127.

For MIDI notes above C8, the Tyros plays a Fret noise. The velocity determines the fret noise volume and is full range 1-127.

Example 4: MIDI note D8, velocity 127 plays a very loud fret noise.

The Megavoice mapping makes it more difficult to program (sequence) guitar parts than regular voices. The user needs to make sure that the MIDI note is in the desired range (B5 and under, above C6, etc.) and that the MIDI velocity controls what you want.

Yamaha’s proprietary CASM has a few settings to control Mega Voices. The bad news — you can’t change some of these settings.

When I program Megavoice into a style, I use two parts for each Megavoice:

    Part 1: Pitched notes -- all note B5 and below
            NTR: ROOT TRANS or GUITAR
            NTT: MELODY or CHORD
    Part 2: Noise notes -- all notes above C6
            NTR: ROOT FIXED
            NTT: BYPASS

You want the pitched notes to transpose. You don’t want the noise notes to transpose. (Please think of the noise notes like drum notes/sounds.)

I wrote a three part series of articles about capturing Motif/MOX arpeggios and converting them to PSR/Tyros styles:

If you don’t care about Motif/MOX, then skip part one. Parts two and three are more generally useful and describe the conversion of a MIDI file to a style. Part three concentrates on Megavoice conversion.

Copyright © 2017 Paul J. Drongowski

FreePlay style deconstructed

Yamaha FreePlay styles for PSR and Tyros are terrific for music without rhythm instruments and strong rubato (variation in tempo to achieve a musical or emotional effect).

I’m customizing a few FreePlay styles with the intention of using them for liturgical music. In the first pass, I’m changing the OTS voice settings and I’m making a registration that calls up my go-to voices for traditional and contemporary church music.

Of course, my curiosity took over and I had to take a look inside of a FreePlay style or two using a DAW and Michael B’s StyleDump program. I have attached a text file with my working notes. The notes may be too much detail for most readers, so here is a quick summary of what I found. I’ve looked at only two styles so far: EtherealHymn (taken from the CVP-609) and OrganPlay1 (taken from the Church Organ expansion pack).

First off, how does it sound and feel to play a FreePlay style? The accompaniment is triggered and guided by the left hand as usual. (I haven’t tried FreePlay with AI fingering, etc. yet.) The accompaniment plays a gentle pad-like chord and a simple bass. The simplicity provides a blank canvas on which you can embellish to your heart’s content.

You might guess that the MAIN and FILL IN sections are quite simple and you would be right. The MAIN sections in the OrganPlay1 and EtherealHymn styles hold notes for 8 and 32 measures, respectively. The chord source in each case is CMaj7. The BASS track holds a single note (e.g., C2) through the entire section. The chord or pad tracks hold the rest of the notes that make up the CMaj7 chord: E, G and B. Harmony-wise, that’s it!

The FILL IN sections are similar and hold notes for just one measure because FILL IN sections are only one MIDI bar long.

Without a rhythm track, those looooooooong notes have a timeless quality. A musician would rarily — if ever — hold a chord that long. Thus, MAIN sections typically do not re-trigger.

Yamaha’s genuine contribution lies in the INTRO/ENDING sections and the fun MIDI stuff that happens during the MAIN sections. The INTRO and ENDING sections have more “orchestration” and consist of style appropriate introductory and ending phrases. For my own purposes, I will probably stick to the simple INTRO A and ENDING A sections as it’s generally hard to match up more complicated musical phrases with the main theme itself.

The “MIDI stuff” must have been fun to program. The EtherealHymn style has string and choir tracks. The string track has MIDI expression data (Control Change 11 or “CC11”) that repeatedly ramps up for two measures and down for two measures. The ramp pattern creates alternating string swells up and swells down. Other control change patterns are rather unusual and I’ll leave that for you to explore with a DAW! (All you need to do is to change the “.STY” or “.FPS” extension to “.MID” and import the renamed file into a DAW.)

One could create a basic FreePlay style from scratch. The MIDI notes in the MAIN and FILL IN sections are dirt simple. The fun part would be selecting instrument voices and effects with dynamic elements that give life to the accompaniment. Then there is the creative aspect of driving the voices and effects with MIDI controller data. For INTRO and ENDING sections, a little Bach or Mozart would do.

Hmmm, sounds like a fun wintertime project!