Follow us: social_twitter_button_blue_16social_facebook_button_blue_16

Musings

Reflections, thoughts and rants on various topics, mostly related to software development.

Well, it has been a few months since I wrote the previous articles on my development of a custom alternative to Apple MainStage. After using it for a few months, I started to figure out what else I really needed and as of today, I am comfortable that I have created an update worthy of being called version 2 (or I suppose I should call it version 2012!)

It's going to take a while to finish this article and I've decided to make it visible along the way, otherwise I can't say how long it will be before I finish it. Of course, having it visible before it's finished will most likely act as a catalyst to get it finished ASAP.

The key new features of this version are


Using Max with the Eigenharp Alpha

Posted by: dhj in Music Technology

Tagged in: OSC , Open Sound Control , MIDI , Max MSP , Eigenharp , EigenD

dhj

Aptril 26th, 2012

A new website has been created that focuses specifically on using Max with the Eigenharp. Please visit http://max4eigenharp.com for more details as well as for the Max patchers to support the Eigenharp.



The earlier articles are

Part 1

Part 2

 


To make it easier for our customers to extract images out of PDF files without using our cloud-based PDF conversion process, I decided to investigate the use of the Python Image Library to build a utility program.

After downloading the source code, I tried to build it and soon ran into errors such as the following:

lipo: can't open input file: /var/folders/.........(No such file or directory)
error: command 'gcc' failed with exit status 1

or


In part 1 of this article, I introduced some of the basic Max patchers I created such as generic MIDI input and output devices and then instrument-specific versions. After a few days of testing, I ran into some bizarre behavior where Scorecerer would not change pages via MIDI remote control, but only for some songs.

I finally tracked the problem down and it turned out that there was a 'double-bug', one in Scorecerer and one in my Max implementation. These conspired to cause the problem. What was happening was that when I pressed the button on my MPK61 to go to the next page in Scorecerer, Scorecerer didn't respond at all but the (highly recommended) MIDI Monitor app I was running reported that two copies of the CC event were being sent to Scorecerer. I'll get back to the reason two copies were being sent in a moment as that caused me to change the original design of the MIDI device patches.

The reason Scorecerer didn't respond at all (as opposed to changing the page twice, which is what should have happened) is because I was (stupidly) using the length of the incoming packet to decide whether I was getting a CC event (3 bytes) or a ProgramChange event (2 bytes). However, in this particular case, the packet length was 6 (two CC events) and so was just being ignored. I fixed this by switching on the actual Status byte but I'm glad I found this issue as if it had been reproduced by customers but not by us, it would have been very difficult to track down.


New version of Scorecerer for iPad has MIDI support

Posted by: dhj in Software Development

Tagged in: Untagged 

dhj
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.

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 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







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

Posted by: dhj in Musings

Tagged in: Untagged 

dhj

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.


How I use Scorecerer

Posted by: dhj in Musings

Tagged in: Untagged 

dhj

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.


I have been bitten for years whenever I have used precompiled headers with C++ platforms. It doesn't matter what platform I'm using, they just never quite seem to work properly and reliably. From time to time you just get bizarre error messages that just don't make any sense. So as a matter of course I just leave that option turned off and suffer the extra compilation time.

Recently, I've been working with Xcode 4 which we use for our Scorecerer iPad development. Precompiled headers are enabled by default and one of the first things I did was turn that option off and forgot about it.

However, one of my partners who also just switched to Xcode 4 did not turn off that option and guess what --- he just got bitten. In his case, he built an update of the product with changes that I checked into our version control system. The code compiled and built perfectly but the Xcode IDE still displayed a bunch of those red error marker icons in various places and suggested that some classes and some variables were missing. Cleaning the project and rebuilding made no difference.


Using the Eigenharp Alpha to play the Lament from Riverdance.

Posted by: dhj in Musings

Tagged in: Untagged 

dhj

I recently started learning to play the Eigenharp Alpha. It's an amazingly expressive electronic controller. The keys are sensitive, apparently to within one micron, in all three directions (in-out, up-down, left-right) and it also has ribbon controllers and a breath controller. Unfortunately, the accompanying software for the Eigenharp is very awkward to use and not well documented. The good news is that it's not too hard to just get MIDI out of it and so external software can be used to do the processing.

Here's a video of me playing the Lament (from Riverdance) using Max/MSP to produce background chords (triggered by my right hand) and then both chords and the solo (played with my left hand) are being handled by Apple MainStage. The string and choir sounds are being produced by Omnisphere and the Uillean Pipes solo sound is coming from Kontakt 4.

Of course, I scanned the sheet music into my Macintosh with Scorecerer and published it to my iPad. Unfortunately, I still haven't found a decent stand for the iPad and although I suppose I could just use a regular music stand, I just balanced the iPad on my leg! I suppose you could argue that that's another advantage of using the iPad instead of paper, which would just flop around.


For years, I have been a skeptic about the open source movement. While I have certainly been happy to benefit from all the free stuff available (to witness, my linux server running lots of good stuff in the background), it has been rare that an open source solution has been better for me than a commerical product.

The argument for free is, in my opinion, very shaky. Yeah, there are lots of poor college students (nothing personal, I was one once too!) who are happy to to get stuff for free and then spend their time hacking on it to make it work for them.

But time is a precious commodity, and the fact that the initial cost of a product may be free is often just a red herring. Yes, Photoshop CS5 will cost you a few hundred dollars. However, if your plan is to make a living as a graphic artist (say), then that initial cost is completely irrelevant. You care far more about the quantity (and quality) of support and infrastructure that is available. Just go into any book store and count the number of Photoshop books there.


Ouch --- again, bogus assumptions from forum posts

Posted by: dhj in Software Development

Tagged in: Untagged 

dhj

A week ago or so, I was working on some backend code for a new application we're developing. For various reasons, I was using a language called PHP which happens to be very convenient for website development, particularly if you're also leveraging a database like MySQL. You can cobble stuff together pretty quickly without too much trouble.

Now, I'm no expert with PHP and basically I just know enough to be dangerous. But I know what I need to say and so my learning process for this kind of thing is to search the web or refer to a book or two to find out how to say it with PHP.

Although it would not be my first choice for large projects, you can definitely get the job done quickly. Unfortunately, the very features that let you cobble stuff together quickly can return the favor and bite you in the ass without even breathing heavily.


While there have been a few devices around to display music notation, the problem was that it took far too long for me to actually get my sheet music into those devices. As a technologist and a serious amateur musician, I always wanted to use one of those devices and so many years ago with great excitement I bought a MusicPad tablet. However, I found that the process of pulling in my sheet music was painfully slow and I had to use external image processing software such as Photoshop to clean up the scanned images and so forth. Consequently, it took about 5-10 minutes to import each page of sheet music. No way could I afford to spend that amount of time.

So I ended up not really using the tablet for anything serious.

Years later, along came the Kindle DX from Amazon. This thing had the ability to display images and PDF files and I thought, if only I had an easy way to get my sheet music into it efficiently, this could be really cool. So along with my partners, we created Deskew Technologies, LLC. By the way, the word "deskew" (pronounced dee-skew) means to straighten. Amazingly, the domain deskew.com was not taken so we grabbed it.


iPad sync problem solved

Posted by: dhj in Software Development

Tagged in: Untagged 

dhj

Well, we just took delivery of a couple of iPads today so now we can figure out exactly why syncing of Scorecerer files from our desktop program to the iPad worked fine in the simulator but (apparently) fails with the real thing.

Glad to know we're not the only ones who had grief. Today's NY Times had an article about this problem.

We'll get this fixed ASAP and we appreciate the interest we've received in Scorecerer.


Workflow and Scorecerer - it's about time.

Posted by: dhj in Software

Tagged in: Untagged 

dhj

Anyone who has attended an introductory economics course has probably heard the question "What is the only thing left for a millionaire to economize" and the answer is of course "Time".

We all have a finite amount of time in which to live our lives and so it's a shame to have to waste time on stuff we shouldn't have to do. Further, if you work for a living, then it makes economic sense to pay for products or services that cost less than what it would cost you to do the work yourself. In general this is true for anything where the experience itself is not beneficial or of interest. (For example, don't bother paying somebody else to exercise for you!)

The above is the philosophy that has driven much of my work, essentially building applications and tools that saved users time.


Why Bother?

Posted by: dhj in Musings

Tagged in: Progress , learning , condescension

dhj

Every now and then, while perusing, or perhaps responding to a question on a forum, I'll see a response from another user to the originator of the question that is of the form

1) "Why bother?"

2) "There's no need for that"


Programming rules of thumb (Rule 1)

Posted by: dhj in Software Development

Tagged in: Untagged 

dhj

The main difference between a law and a rule of thumb is that the latter can have exceptions. Such exceptions are hopefully very rare although some of them might be very domain specific as we will see later.

Number of lines in a function

Ideally there shouldn't be more than 12 to 15 lines in a function (or method or procedure). If you occasionally find you need 20 lines, that's probably OK but if you start having 50 or 100 lines in  your function, your level of abstraction is probably too low. My experience is that this problem is more likely if you write code bottom up rather than top down because the abstraction level will be too low. So suppose you have to write a program read a list of numbers from a file, sum them, and write the result to another file. There is no reason why you wouldn't write the first (non-working version) of this as follows, simply assuming the existence of auxilliary functions:

main()
{
LoadFile();
SumNumbers();
SaveResult();
}

Create three empty dummy functions (procedures) and compile your first version. No errors? Excellent. Now go visit each of those dummy functions and fill them in, assume the existence of any other needed functions, create those as new dummy functions, get a clean compile and repeat! (Fast compilers make a huge difference)





On the ambiguity of "upload" and "download"

Posted by: dhj in Musings

Tagged in: Words , Musings , Ambiguity

dhj

A few days ago, I finally got a cable that would allow me to connect my universal remote control to my computer so that I could tweak the settings that had been programmed into my control by the people who installed our home theatre system. Those people had actually done a very sophisticated job to make this particular remote work very well with a lot of devices hooked up to the screen.

 So I connected the remote, launched the programming app, and clicked on the "download" button. Within a few seconds, my remote control was completely overwritten with default settings from a demo configuration file.

This happened on Christmas Eve so of course nobody was around to come by and fix it so I was left to try and figure out the programming application by myself (no manual and not a particularly intuitive user interface) to get things working again.