New version of Scorecerer for iPad has MIDI support

July 21st, 2011 Comments off

We have just submitted a new release of Scorecerer iPad to the App Store. Version 5 has support for CoreMIDI and has three new functions
1) Selecting a song can send a program change to your DAW or live rig manager
2) Scorecerer iPad can open a song automatically upon receipt of a program change

Typically, you would use either 1 or 2 depending on whether you want Scorecerer to be the master or the slave in a live environment.

3) Scorecerer iPad can respond to MIDI CC events and change to the next or previous page of a song. This lets you use buttons on a keyboard or a pedal attached to a keyboard to change the page.

I’ve been using these features with my band for a while now and they are very effective.

Hopefully, Apple will approve the new update quickly.

Categories: Uncategorized Tags:

Replace Apple MainStage with a custom Max/MSP implementation (Part 1)

July 20th, 2011 Comments off

I have a large live keyboard rig with  7 keyboards (including a wireless MIDI keytar), several pedalboards with MIDI,  as well as an Eigenharp and various other control surfaces. I also have several synth modules in a rack that also contains two MOTU 8-port MIDI interfaces and a MOTU 828mkIII/8Pre combo that is fed by an SSL X-Patch so that I have complete control over how audio is routed from place to place.

Historically I have used Apple MainStage to control my rig but even though I considered it to be brilliant in conception, it was never (and sadly still is not) 100% reliable. I have never gotten through a single rehearsal (never mind performance) without several glitches such as plugins randomly stopping as well as occasional stuck notes. Although I stopped using audio plugins and added a Muse Research Receptor to handle such things, even MIDI routing fails to work reliably. The Receptor was also surprisingly flakey as well, and subject to many reboots as well as occasional failure to respond to MIDI.

After considering the available alternatives, including switching to a Windows box as there are a couple of interesting alternatives there, last weekend I decided instead to bite the bullet and just develop my own MIDI routing environment. The main criteria was that it had to implement the MainStage indirection mechanism where you can define devices (keyboards, knobs, pedals and so forth) which respond to incoming MIDI but which can then control  other devices that want different MIDI values without having to be focused on knowing the actual MIDI data all the time (a key highlight differentiator that separated MainStage from other systems with similar functionality) and it had to be very easy to add new “patches” representing new songs.

I’ve been familiar with the Max programming environment almost since it was originally developed by Miller Puckette and it has become an extremely powerful tool after been further developed by David Zicarelli. Indeed, it is now integrated into Ableton Live and people are building all sorts of amazing devices with it.

While a full explanation of MIDI and Max is beyond the scope of this blog, there are numerous articles and a few books available if you want to get into the deep details. One excellent book I found recently is “Electronic Music and Sound Design: Theory and Practice with Max/MSP – Vol 1” by Cipriani and Giri. Highly recommended.

One unexpected but extremely gratifying consequence of the switch away from MainStage is that with the exception of a known problem with the G-Force VSM plugin, my Receptor has also been glitch free. I have not seen a single instance of failure since the change.

Defining MIDI input devices

Normally I’m a big fan of top-down development but it turns out that in the Max environment, you mostly have to develop bottom up as it’s not really practical to create placeholders. The first goal here is to define a Max patch that represents a generic MIDI input device and then leverage that to build higher level patches to represent specific instruments.

Midi-Input-Device

This is an example of a generic input device patcher. The inlet at the top is used to define the actual MIDI source (see below). The midiin object receives MIDI data from a source and passes it into a midiparse object where it is separated into different kinds of events. For example, note on/off events come out through the first outlet. The other connected outlets (left to right) send Aftertouch, Pitchbend, CC events and Program Changes respectively. You can also access polytouch and the MIDI channel but I didn’t need those for now so left them unconnected. Note that the values that actually come out through these ports const of a list of values that does NOT include the first MIDI status byte.

Yamaha-AN1x-C1

Here’s where the fun starts. Having saved the above as a named patch, it becomes available to be reused over and over again as an object in its own right. Here is a new patch that defines my Yamaha AN1x keyboard, which I only use as a controller.

When this patch is loaded, a message is sent automatically to the MIDI-Input-Device to tell it that it should listen to the MIDI port called AN1x Controller. Other than CC events, other events are just mirrored to outlets that will be routed to output devices later. The interesting piece of this patch is of course the handling of CC events. The AN1x has 8 knobs that (in my configuration) transmit CC messages from 41 to 48 respectively. There is also a sustain pedal connected that generates CC 64 messages, a modwheel that generates CC 1 messages and an expression pedal that produces CC 7 messages. For that last, it’s very important to understand that the fact that CC 7 typically represents volume is not relevant.

The input to the route object receives a message that consists of two numbers representing any CC number and its associated value coming from the MIDI-Input-Device. The output of the route object consists of just the value of the CC message but the outlet through which it appears depends on which CC event was received. For example, the values of CC41 events appear at the first outlet. The values of CC42 events appear at the second outlet. The value of CC7 messages appear at the second last outlet. Values for CC events that are not specified in the list of numbers after the object name appear at the last outlet and we don’t care about them.

The outputs go to send objects. A send object allows a message to be sent to some other object, called a receive object (duh) without using a physical connection. The receive objects don’t have to be in the same patcher. Send objects take a single parameter that you can think of as a radio frequency. Any receive object whose parameter is set to the same name (frequency) will respond to transmitted messages.

MIDI Output Devices

Now let’s switch over to defining target devices such as synthesizers that respond to MIDI.

Midi-Output-Device

This patcher is essentially the opposite of the MIDI-Input-Device. It is a generic MIDI output device that accepts incoming individual MIDI events of different kinds (notes, pitchbend, CC, etc) and formats them into a single stream through the midiformat object that can be sent to an external device. Now lets implement a single channel of a real MIDI output device using this patcher.

Receptor-Rx1

This patcher represents channel 1 of my Muse Research Receptor, which is essentially a Linux box that can run Windows VSTs with high quality audio output. I have similar patchers defined for the Receptor for different MIDI channels. The first few inputs are usual, notes, pitchbend, aftertouch and so forth. The last one is of course the one of interest. Each of these blocks can receive a single stream of values. Looking at the second one (for example), what happens is that the pack object combines the value 7 along with whatever value is received and sends that tuplet into the CC port of MIDI-Output-Device, thereby generating MIDI CC 7 events to channel 1 of the Receptor. Now remember that we defined some knobs in the AN1x (earlier above) that produce a single stream of values as a knob is turned. Those knobs pass those values into those send objects that have names.

Creating our first song patch.

Here’s where the fun starts. Having created the items above, we can now create a Max patcher that represents a MainStage patch. Here is a trivial (yet working) example of a complete patch.

The first connection from the AN1x to the Receptor passes incoming notes played on the AN1x into the Receptor on channel 1. The second connection enables pitchbend messages to be sent as well.  The third connection causes the Receptor to change its volume as knob5 on the AN1x is turned.

 

In part 2, I will address functionality such as automatically sending program change information to multiple devices when a song patch is open. We will also explore some user interface features that allow you to create front panels that provide much the same information as MainStage.

For example, here is a picture of the display I created that shows the view of a Yamaha AN1x, a Prophet ’08, and an Akai MPK61 controller after opening a Max songpatch called Red Rain.

Categories: Uncategorized Tags:

‘Else’ is not the counterpart of ‘If’

July 9th, 2011 Comments off

I can’t stand it anymore. I honestly don’t understand why some developers (particularly those coming from the C world) continue to vertically line up else underneath if

Nobody would ever write *

switch (expression) {
   case true:
      DoSomething;
      break;

case false:
   DoSomethingElse; 
   break;
}

So write

if (expression)
   then DoSomething;
   else DoSomethingElse;

If you’re writing in C or C++, use

#define then 

so you can use the keyword anyway. If your language doesn’t allow macros, then just indent as if there was a then keyword there anyway.

if (expression)
        DoSomething;
   else DoSomethingElse;

That last might look a little odd by itself but once you need multiple statements inside the then and/or else, it makes total sense again.

if (expression)
       {
            DoLotsOfThings;
       }
   else
       {
          DoLotsOfOtherThings;
       }

 

 

* By the way, I would normally indent everything under the switch as well but I’m ignoring that here to avoid an orthogonal issue about block structures. In case you’re wondering:

switch (expression)
   {
      case true:
         DoSomething;
         break;

      case false:
         DoSomethingElse;
         break; 
   }
Categories: Software Development Tags:

Upgrading my live keyboard rig – the good, the bad, and the ugly

July 2nd, 2011 Comments off

I use a pretty sophisticated live keyboard rig with my band, No Sleep Tonite, and have just finished a major overhaul whose goal was to reduce significantly the setup/teardown time from about 2 hours down to about 10 minutes.

For those of you interested in music technology, my live rig consists of six keyboards including a Korg Oasys, Roland VK88, Minimoog XL, Prophet ’08, Yamaha AN1x (used only as a controller) and an Akai MPK61 controller. I also have a Roland AX-1 keytar which I use occasionally with a wireless MIDI setup, and more recently, I’ve started playing the Eigenharp (but that’s a whole ‘nother story). Of course I also use Scorecerer on an iPad (shameless plug) to view my sheet music, notes and setlists. There are also about 9 footpedals in the rig, for audio volume and MIDI CC control used for volume, expression, sustain and so forth.

Everything is managed through Apple MainStage although I use very few AU plugins with it and instead added a Muse Research Receptor for that. MainStage is mostly responsible for MIDI control (it sends out all program changes) along with routing, layering and splits. It also enables knobs, sliders and buttons on several of my boards to control parameters of any sound in real-time as needed.

Until the overhaul, the VK-88 audio was hardwired into a Line-6 M13 effects processor and the Minimoog audio was hardwired into a Boss RE-20 Space Echo. All the audio outputs were sent to an A&H 20 channel mixer and a two-channel mix goes to FOH. Connecting everything up was always a headache with a maze of cables. The plan was to build harnesses to carry power, audio (in and out), MIDI (in and out) from a new rack to each device (including pedals/effects, which would be mounted on pedalboards).

Mike Vegas, a rather amazing and experienced musician/engineering craftsman took a look at my rig and made a couple of fascinating suggestions the most important of which was to eliminate the A&H mixer (and a 12U rack) and replacing it with a MOTU 828MkIII/8Pre in conjunction with an SSL X-Patch. All audio devices and my effects units would be connected directly to the X-Patch. The outputs from the X-Patch would go into the 828/8Pre combo and finally a stereo feed would go from the 828 to FOH. A couple of MOTU 128s were to be used to handle all MIDI connections.

So a few weeks ago, and with more than a little trepidation, I disconnected everything and sent my rig to Mike’s workshop. Last Thursday evening, Mike called to say everything was ready for me to test so off I went. Note that Mike had tested all the physical connections but my laptop was needed to be able to actually configure everything.

Since the Receptor and the X-Patch both use Ethernet, Mike also installed a wireless  router inside the rack so that there is a private subnet for the system. The Mac, Receptor and X-Patch are connected with cable and the iPad can connect over wifi. Wifi on the Mac itself is disabled during “play time” as it’s not clear how well wifi works with all the other real-time stuff is going on. However, because I still want the Mac to be able to access the internet over wifi and most wifi routers are configured to use 192.168.1.x, I setup the router to use a different subset, 192.168.3.x and that, it turns out, is what led to the first “show stopper” problem.

I downloaded the X-Patch remote configuration app and ran it. It immediately detected the X-Patch, displayed its firmware and let me select it. The next step was to configure networking. I noticed that it was set to DHCP by default so figured I was done, as the router was configured to hand out DHCP addresses. So then I went to the channel configuration section where I’m supposed to enter the names of all the devices connected to the X-Patch. I entered the name of the first device into the first box and then clicked on the next box to enter the second name. As soon as I did that, the name I had typed into the first box disappeared.

To cut a long story short, it turned out that nothing I entered anywhere would stick. I wondered whether, in spite of the app indicating that the X-Patch was online, they were not actually communicating. So next, I checked the active DHCP leases on the router and noticed that only my Mac and my iPad were showing up (the Receptor was not turned on). So the X-Patch DHCP client was apparently not working. So I went back into the X-Patch app and clicked on “Static IP” and defined an address, subnet and gateway on the .3 network. After doing that, the app told me that I should power-cycle the X-Patch and then restart the app again.

I did that and…..nothing! Stuff I typed in was still disappearing as soon as I switched to another field. When I went back to the networking section, it was set back to DHCP and the static IP information I had previously defined was gone.

I was now the proud owner of a keyboard rig which made absolutely no sounds. John Cage would have been proud! Went home that night pretty discouraged. Although I did manage to get hold of someone at SSL the next morning but their only real suggestion was that the router was probably faulty. I found that hard to believe since other devices connected via that router were working just fine.

When I went back to the workshop, I had one idea which I thought I would try. I disconnected my Mac from the external network (which was on the .1 subnet) and then reconfigured the internet router so that it would use the .1 subnet instead of .3 and lo and behold, the X-Patch application worked perfectly. Great feelings of relief followed by some annoyance as to why so much time got wasted on that issue. I’d have figured the problem out in 5 minues if the X-Patch application simply said it couldn’t connect to the unit. Not sure what one does if they’re experienced with network troubleshooting.

So the fundamental problem was that even though it looked like the X-Patch application was connecting to the hardware (it said the hardware was “online”), it really wasn’t connected and the only way to make it work was to reconfigure the router to suit the X-Patch. I have no idea why it couldn’t pick up a DHCP connection in the first place unless the X-Patch comes from the factory with a static IP address as the default and since the application couldn’t connect, it wouldn’t even tell me that.

By the way, now that I have it working, it’s quite a wonderful device. There’s a very tiny audible click when I switch patches, but nothing to be concerned about and it’s delightful to be able to use effects pedals on different instruments at different times and not be committed to a single permanent routing.

Categories: Uncategorized Tags:

How I use Scorecerer

June 12th, 2011 Comments off

There are a lot of different ways in which Scorecerer can be used. One key differentiator is its ability to facilitate the import of your own paper sheet music into digital form.

Most of the other products on the market are giving away sheet music viewers on the iPad but the goal there is to get you to buy and download your songs.

However, if you’re like me, over the years, you have probably amassed a significant collection of individual songs, song books, collections, fakebooks, and perhaps your own chord charts and lead sheets. You may have added your own pencilled in fingerings, accents, or other comments (“play loud here”) all of which you would like to keep around, something not possible if you just repurchase the song online, even if you could find a suitable version.

Scorecerer’s ability to quickly straighten your scanned in music sheets makes it very efficient for you to quickly import your songs without the need to use an image editor like photoshop on each page to correct crooked pages before importing them. Once your pages have been scanned into your computer, just drop them into Scorecerer.

Now that Scorecerer for iPad has built-in annotation features (hey, Apple, please hurry up and approve this update soon), it has become incredibly easy to use it during band rehearsals. When the band leader makes a suggestion (or gives a directive), I can quickly tap on the screen to handwrite the necessary comments. As an arrangement evolves over time, it’s very easy to add/modify/remove those annotations as needed.

One downside of sheet music, particularly for popular songs, is that you often can’t find an arrangement that accurately captures what’s going on. I have found that the sheet music version of many songs often doesn’t accurately capture what is actually being played. Often you can only get a simplified piano/lead sheet arrangement of the song and most of the time the instrumential portion of a song is not included at all.

However, many songs are also available in MIDI format. In most cases, these songs have been transcribed very carefully to match (as much as possible) the actual performed original song. This is particularly true of MIDI songs that you can purchase from companies that specialize in creating MIDI files to be used as backing tracks.

In these cases, I will often buy a MIDI songfile instead of the sheet music. Using my DAW (I use Logic Studio but any DAW that supports a notation view can be used, as well as the well known standalone notation editors), I import the MIDI file, choose the track (or tracks) in which I am interested, view them through the notation view and then print that notation view as a PDF. The ability to print to a PDF is built-in to all Macintoshes and there are several free PDF drivers available for Windows users as well.

Once I’ve created the PDF file, I can drop it into Scorecerer where it will be converted and can be published to the iPad like any other song that I scanned in.

In this manner, I’m able to use both my own sheet music as well as music scores purchased online.

Categories: Uncategorized Tags: