Showing posts with label MIDI. Show all posts
Showing posts with label MIDI. Show all posts

Saturday, February 7, 2015

MIDI Madness on an iPad


As I post often, my music is mostly created with MIDI tracks from either soft synths, MIDI controllers or sequenced MIDI patterns. MIDI makes it easy for me to correct any errors or mistakes. MIDI lets me swap in and out different samples, synths or instruments without having to rerecord anything. Its the best thing going in modern music in my opinion!

On the desktop, I use Logic X and normally create many MIDI tracks that I eventually bounce down into finished songs (or long sequences of annoying noise depending on your point of view). On the iPad as I write often, I want the same easy experience I have on Logic X with MIDI and sadly, that is not yet possible.

Many DAWs on the iPad support MIDI and some also support Virtual MIDI to control other apps running at the same time but none of them do so as seamlessly as VSTs or AUs on the desktop. The "gold standard" and closest candidate for me is Cubasis.

I've posted a few times about using MIDI with Cubasis with InterApp Audio and Virtual MIDI but to be honest, doing this is very crash-prone and I've been experimenting quite a bit with simplifying the process. I recently found a pretty good workflow for working with MIDI and I'll step through one method that works pretty well for me.

Recently I posted the piece below using Cubasis, Korg Module Synthology piano and Noatikl:




This piece required getting 3 iOS apps to "play nice" together - Cubasis, Noatikl and Korg Module. I decided to minimize my variables by only using InterApp Audio when necessary and only a few sounds. This is a piano piece and I want the left and right hands to sound "real" and produce a credible piano solo. Virtual MIDI by itself is a challenge, so I defer using IAA and bouncing until I get the basic sounds working and then recorded.




The composition tool for me (as is often the case) is Noatikl. Rather than go into its details, I'll describe what I used it to accomplish (see my tutorial if you want to dig deeper into Noatikl).

I loaded up Korg Module with one of the Synthology piano samples. Unfortunately Korg Module does not let you specify what MIDI channels it listens to but it does support Virtual MIDI in Omni mode (meaning that all MIDI being fed will trigger notes). On this piece, I'll use that to my advantage.

With Korg Module loaded (and background audio enabled from its setup menus), I next load Intermorphic's Noatikl which I will use to "program" the music for this piece. I want to define 2 "voices" in Noatikl which will emit MIDI notes and events. One voice will the the "left hand" of the piano, the other will be the "right hand".

At first the main order of business is to create something that sounds good - so I picked a Lydian scale and 7/4 time (to be weird) in Noatikl and programmed a chord pattern derived from a classic 2-5-1 sequence (2nd note of scale, 5th note, a few others, then back to 1st note). By giving Noatikl an octave range and a rhythm pattern to follow, it plays those notes across a few octaves in order. Now for the "magic", I ask Noatikl to generate diatonic chords for those notes using 3rds for some chords and 4th for others. For the chords I program the voice to randomly use between 3 and 5 notes (or "fingers').

For the "right hand" I program a simple pattern of eighth notes in the scale, ask it to "auto harmonize" with the other voice, and ask it to run the patter 50% of the time and then a random sequence of quarter, eighth and half notes also harmonized the other 50% of the time. A bit of tweaking and parameter setting in Noatikl and I have a piece that sound pretty good to me. The velocities are lightly randomized, the chord timings are slightly delayed to give a human feel and voila, the sound is  ready to be recorded (which is the hard part!).

The sound from Noatikl over virtual MIDI into Korg Module is good but not perfect! At times, the maximum polyphony is exceeded and I hear a distinct "plunk" sound. This is probably a short-coming of Korg Module that I've read documented elsewhere where lots of sustaining notes are playing at once (I did tweak Noatikl to use the sustain pedal and release it on each bar). This will have to be corrected after recording.

To record the piece, I want to use Cubasis. This is where things get tricky with Virtual MIDI as to who drives what. Korg Module is already "listening" to all MIDI channels coming out of Noatikl and I don't want Cubasis feeding it as well. So in Cubasis, I create 2 MIDI tracks, and set the instrument to "None". I just want the MIDI notes recorded. For the MIDI source, I select each Noatikl track number and MIDI channel. So track one is listening to MIDI track 1 in Noatikl and track 2 is listening to track 2 in Noatikl. I make sure that both tracks have MIDI output as None - remember, Korg Module is already playing the MIDI from Noatikl - don't want to feed it twice!




So in theory, we hit "record" in Cubasis, start Noatikl playing the tune and away it goes. Bad news though - when Cubasis first gets MIDI notes from Noatikl, it crashes and restarts (ah the wonder of iPads!). So as a work-around, we start Noatikl playing first, open Cubasis (crash/restart), and then press record - it will pick up with what is currently playing.

We let this go to the end of the song, press stop and we should have good MIDI notes in two tracks in Cubasis. If this worked out OK, we are done with Noatikl. To save memory, I close Noatikl, go back to the two tracks in Cubasis and set their output to "Virtual MIDI". Now Cubasis will "drive" Korg Module.

Playing it back at this point sounds good with a few "plunks" here and there. There are two culprits. One I mentioned is the Korg Module polyphony limit and a few others seem to be MIDI generation bugs either in Noatikl or Cubasis. The "bugs" in MIDI sound like "plunks" too and are visible in the MIDI notes as extremely short notes. I find these and either delete them or lengthen them in the Cubasis editor.

The second "plunks" are harder. You have to listen for them, find the measure and delete a few concurrent notes until they sound right. MIDI makes the editing so much easier than working with Audio files!

Now that it all sounds ok, it comes time to "bounce the tracks". I don't use the MIDI/Inter App Audio in Cubasis since I need to record two tracks at once and IAA only allows one instance of an instrument at a time. The easier way is to create an IAA Audio track in Cubasis, set it to listen to Korg Module, arm it to record, disarm the 2 MIDI channels and play the piece. Cubasis will route the MIDI through Korg Module and record the resulting audio into the Audio track.




Having done this, I then mute the two MIDI tracks and export the track to Soundcloud. If this sounds like more work than a desktop DAW, well, it is! But I've found this workflow to be a bit better than what I've done in past tracks requiring multiple passes. Hope this helps someone!

Wednesday, October 16, 2013

Bringing it all together





I haven't posted for awhile but have been busy with many new synths on the iPad and a few new songs on Logic X. One thing I've been looking for is better ways to integrate my iPad with my desktop and the two products above are recent additions to my MIDI gear list. 

THe iConnectMIDI2 solves the problem with wireless latency between the iPad and my iMac as well as providing a clean audio interface that bypasses the noisy headphone jack on the iPad. This device provides bi-directional audio over USB as well and MIDI over USB between the iPad and my iMac running Logic Pro X. The device connects to the iPad via the 30 pin connector and if you add a power supply to it (sadly an extra purchase), it will also charge the iPad while connected.

They don't have the "new' iPad connector cable as of yet so if you have a newer iPad, you will have to use the 30 pin adapter but this is a fantastic addition to my music gear. With this connector, I can use my iPad as a MIDI device or I can send audio from my iPad synths directly into Logic. Even better, I can use my keyboards attached to my iMac with my iPad without rewiring things.

Another great addition to my gear is the incredible QuNexus keyboard from Keith McMillan Instruments. This diminutive keyboard is extremely durable (there are videos dropping it, running over it with a car, etc. etc) and provides great touch sensitivity, polyphonic aftertouch, tilt modulation settable for all keys or individual keys and is tiny to boot and powered by USB (even on the iPad). 

I can't tell you how cool this sounds compared to my old Akai MPK Mini. You do have to use it a bit differently than a traditional keyboard but you can map any modulation to almost any parameter. It works very well with Logic X and also with the iPad. By using this with the iConnectMIDI2, I can connect it to my iMac and when the iPad is connected to the iConnectMIDI2, I can use it with either device without unhooking. This is perfect for me! 

On added bonus, I left my Akai MPK Mini hooked up as well and can use both concurrently. I can set my Akai to a lower octave and the QuNexus to a higher one which gives me 50 keys instead of the scant 25 keys that each keyboard provides. 

I'll be using these quite a bit in future songs and it is great to finally have a clean noise-free interface for my iPad.


Saturday, July 27, 2013

Noatikl for iPad pt. 5

In the last tutorial, we finished off our drum parts which were all hooked up to MIDI channel 10. This tutorial is going to add a nice acoustic guitar to our song. As the picture above shows, we have Sampletank playing its guitar part on MIDI channel 1 using samples for a nylon string acoustic.

In Noatikl, we are going to add a new voice by press ing the + button in the design window, selecting fixed pattern voice and pressing the Add button on the upper right hand of the screen.

 

Press OK to merge it into the current song file and rename it to Guitar. By default, it should be connected to MIDI channel 1. If it isn't, just drag for the voice to the MIDI channel.

 

For the guitar, we will use several patterns but we also want the guitar to play its own thing 25% of the time. As before, we will create some patterns and set the percent use to 75%. So far, we have used only rhythmic patterns such as <100 R -60 30 30 -60 60>. For the guitar part, we will use another pattern type in Noatikl where we specify both the rhythm and the note interval. The note interval is a relative number within the scale we specified and means that the 2nd, 3rd, 4th etc. note of the scale will be played.

Instead of the "R" in the pattern, we will use "B" and we will specify both note length and note interval. Our first pattern is:

<100 B 60 5 60 8 60 12 60 2>

100 is the relative weight or probability, "B" means both rhythm and notes, and the next numbers are pairs that specify duration and pitch. This pattern plays a quarter note 5th, a quarter note 8th (meaning first note of scale but one octave up), a quarter note 12th (octave up 5th), and then a quarter note 2nd.

We are going to adjust the root pitch to be 33 (this is I think A#) in the pitch slider in the basics screen for the voice.

 

Notice that the use patch is turned off for this voice. We are not using General MIDI codes here. We are using a sampled instrument. The patch name shows guitar but it is not relevant (I selected the patch just for documentation purposes).

While we are here, I'm going to set the note rest % to 10 to give the patterns some variation. 10% of the notes will be replaced with silence giving us a little syncopation.

 

If we play at this point, you should hear a boring one note guitar sound as well as your drums. Let's add two more patterns with same 100 weight (makes each of them equally likely) so our pattern looks like:

 

Let's make some chords now. We want the chords to be strummed and to be either 3,4 or 5 strings. Go to the Chords screen and specify 3 for the chord depth (meaning 3 strings will sound) and 2 for the depth range (this will vary the number up to 3+2 strings).

The default strategy says Chordal harmony but we will change it to Interval within Scale Rule to use sounds closer together as a real guitar would sound. In the Shift/Interval field put 2 so we get 3rds or 5ths. I also put the Shift Interval range at 2 to provide some variety. Experiment with these! The Delay on the chard is set to zero with a range of 4. This means each note of the chord may have a few ms delay which makes them sound 'strummed'. Again, experiment. If you play now, you'll hear some nice rhythms and chord progressions.

 

Lastly, remember that we put 75% on the use pattern percentage, so we need a rhythm rule to use for the other 25%. Set it to Slow:

Voila! We now have drum and guitar playing together. Next parts will cover a flute and some vocals.

 

Wednesday, July 17, 2013

Noatikl for iPad pt. 3

In the last tutorial, we got as far as attaching Noatikl to Sampletank via virtual MIDI and actually getting our kick drum working. To do that, we created a fixed pattern voice and provided a pattern for the kick drum which has two lines. In this post, we'll go into explaining the pattern a bit more in depth. See links on right for other tutorial parts.

If you listen carefully to the kick drum pattern, you may notice a few things:

  • Obviously there is some variation in the rhythm since two patterns are used
  • The volume of each kick varies somewhat

Let's start with the first pattern: <50 R 60 -180>

All patterns in Noatikl appear between <> brackets (which is a pain to type on an iPad!). There are several types of patterns supported by Noatikl - this pattern is a rhythmic pattern as indicated by the "R". For a drum part, the note pitch isn't usually important since you just strike the instrument. Each beat in Noatikl is represented by 60. For a rhythmic pattern, positive numbers are notes, and negative numbers are rests. The initial number (50) is used as a weighing factor determining the probability that the pattern gets played assuming you have more than one pattern.

For the kick drum, our other pattern is : <50 R 60 -90 30 -60>. Following the logic above, you can see that this pattern will play a kick on beat 1 and the 2nd half of beat 3. The total of the numbers is 240 or 4*60 which is 4:4 time. Intermorphic has more documentation on patterns here.

Using what we already know, we are now going to add a sort of high hat part to the drums. We could add a new voice from the design page by clicking + and selecting another voice type, but to save time, we will copy and past pe our kick sound. Tap on the kick and press the copy button to put it in the clipboard. Tap kick again and press paste. This gives us another voice connected to MIDI channel 10.

Tap the new voice, press edit and rename it to "hh".

We need to select another patch to get our desired sound. Bring up the voice edit screen for the hh and experiment with different patches (use the patches starting with "D" for drum sounds. I found that for the drum kit we selected in Sampletank, patch D047 sounds good even though it isn't labeled as a high hat.

 

When you have a pattern defined, I like to hit play and then audition different patches to pick one I like. For our pattern, press the pattern button on the left of the voice edit window and enter the following 2 patterns:

 

The first pattern plays a series of 8th and 16th notes and the second pattern is silence! Th 75/25 numbers mean that 75% of the time, the notes will play. 25% of the time the hh will not play. This provides some variety but we want to hear a bit more syncopation. We could create a number of alternate patterns, but there is another way to provide variation.

In the Voice edit screen, select the Basics button on the left and move the slider for "Notes rest %" to 10. This will randomly replace notes with rests 10% of the time which makes the hh tapping more interesting.

 

We're starting to get a beat going. Next we want to add a snare sound between the kicks. We could create another pattern on alternate beats but this time we are going to use a different voice type. The voices we have so far are "Fixed Pattern" voices. For the snare we are going to use a Following voice. Basically, we want the snare to follow the kick drum one beat behind the rhythm.

To create the snare, let's copy the hh and paste it like before and edit the name to "snare". While on the Basics edit screen, we will change the voice type to "Follows" and we will select patch D045 - I happen to prefer its sound to the snare patches.

Next, we need to select the Follow button on the left and tell the voice which voice it should follow. We will also change the Units selection to Beats (60th of a) and will set the delay slider to 60 to give a one beat delay. We will also change the Percent to 80% so the snare only plays 80% of the time for more variety. Note- setting the delay to 60 is difficult! Get a number on the slider that is close and then press the + or - button to get the value.

This is closer and closer to a full kit! Next post, we will finally finish off the drums. Often, the drums in Noatikl take me the longest to set up.

 

Friday, July 12, 2013

Noatikl for the iPad - tutorial 1

I'm going to go step by step in creating a Noatikl piece that uses Virtual MIDI to drive other apps on the iPad in this example. Noatikl has a nice built-in modular synth called Partikl that you can use if you want to craft your own sounds with oscillators, drum synths etc., but Virtual MIDI lets you use any of your favorite synth apps provided that they support MIDI (most major synths seem to).
If you want all the details on Noatikl or its built-in synth, Partikl, check out the documentation at Intermorphic's website here.
To start our song, hit the menu button in the upper left corner of Noatikl.


This brings up the menu to load an existing piece or create a new one:

Press the plus button on the upper right to create a new piece. This brings up the template menu.


Assuming you are creating a Western style piece with traditional scales, select the "Scale Rules" template for your new piece. This will pre-load the internal rules for scales, rhythms etc. it does help if you have some musical training!
Next we should set up some defaults for our pieces such as tempo, scale and how we want to generate the sounds. For that you should press the piece button at the bottom of the screen to show the piece options.

This screen can be intimidating but we are only going to change a couple defaults. We will make the tempo 120 BPM and then scroll down to scale and select Pentatonic.

I also put my name in author and put a note in reminding me of the synth I am using for the sound. The grey bars in the rules show which notes or intervals will be used and the height of the bars indicates the probability for any given event. Confused? The noatikl manual goes into more detail. Note that the Pentatonic scale rule has five bars of equal height. A Pentatonic scale has five notes and we made them all equally likely to be played. Pentatonic scales almost always harmonize easily and sound good. You can always come back here later, change the scale type and immediately hear the effect on your song!
Now we should press the design button and set a few more options by pressing the gear button on the upper right of the screen.
We are going to turn off the Partikl switch since we will not be using Noatikl's built-in synth. We will turn on Virtual MIDI and MIDI clock options so these are sent to the Virtual MIDI ports.
Alright so far? Let's add a voice in Noatikl. Go to the design screen and press the + button. This time select from the Noatikl seed section a fixed pattern voice.
This voice is going to be our kick drum! In the design window, drag from the new voice and you'll see 16 'target' MIDI destinations. Drag to MIDI channel 10. Tap lightly on the voice, select edit and tap on 'Voice 1' and rename it to Kick.
At this point we have a nice song that makes no noise at all! In the next post, we will configure the target MIDI application that will be playing the notes.

Friday, March 29, 2013

Flying by Wire

My father-in-law is a pilot and some years ago told me about the transition on airplanes from traditional "mechanical" style of flying to the newer "fly by wire". Basically, the old electric, servo-motor, pneumatic type controls were replaced by embedded computers (I'm oversimplifying). What this meant was that instead of sending electric impulses that directly controlled motors, flaps, etc, binary messages were sent to embedded controllers that would in turn, control the motors, flaps etc.

This would allow for "manipulation" of the pilot's action where the embedded device had a "better idea" (he was not a fan!). So a violent movement on the controls might be changed to a less violent movement that would prevent the plane from stalling - or at least that is the general idea. So instead of relying on Sam the mechanic who has a nice greasy shirt, cool pin-up calendars and a beard, you are relying on Simon the programmer who plays fantasy games and always smells a little like cheese. Quite a transition!

The reason I bring that up is I do quite a bit of music making with traditional sounding tracks (saxophone, trumpet, bass, guitar) and yet I don't even have a microphone in my studio. Instead of passing analog waveforms electronically into my music, I tend to send binary messages that the computer then takes up and uses to create noise. Seems to be a very good analogy.

In the case of MIDI keyboards, this is pretty common. Whatever you are doing on the keyboard is being encoded into numeric messages that are passed via MIDI cables, or USB cables into a computer that then passes the events into software that is creating sounds, applying effects and ultimately making noise.

A good friend of mine, Marty, uses a much more complicated method of soundmaking. He starts with a manual exciter which creates oscillating vibrations, these go through an echo chamber made of shaped wood which modulates the waveforms projecting them out of a round hole into an irregularly shaped rectangular space filled with other shapes that affect the waveforms. Some of the randomly bouncing waveforms are "captured" by a membrane that vibrates in time with the excitations in the room, produces an electronic signal that is ultimately transformed from analog to digital format and stored in a file. Because I find this entire process mind-boggling, I tend to stick to the simple MIDI method myself.


In the case of trumpets or saxes, I like to use a wind controller which is "played" like a traditional instrument with keys to finger, a mouthpiece to blow into and, of course, a USB cable coming out the other end. The fingerings change internal note numbers, the breath controls a pressure monitor that also sends numeric impulses continually via MIDI. A few other sensors allow me to send modulations as well such as a thumb control to "bend" the note or create a "growl" sound (these are configurable). All in all, this is much simpler to me than analog!

Like the airplane, the receiving computer can "manipulate" the raw data I send it. It can use any program it has to create the sound. So, with the same inputs, it can produce saxophone sounds, trumpet sounds or entirely electronic or digital synth sounds. The possibilities are endless using just one input device. As time continues and software develops, even "analog" sounds can be modeled effectively to where even if not perfect, they are hard to distinguish from physical instruments.

I suppose I'm just rambling, but technology always fascinates me and usually delights me! Maybe I should grab a beer with Simon the cheesy computer guy.