Phase correlation meter for Ableton Live

I stripped all the bullshit from my earlier correlation meter attempt, so here is a simple audio effect for Ableton Live that displays the phase correlation.

Screen Shot 2014-08-21 at 17.58.57

 

 

 

 

 

 

 

You can adjust the interval (just drag the number), but 200 samples seems to be a great starting point. You can download the effect here for free and dissect it if you have max-for-live. Combine it with a Utility plugin (Ableton Live -> Audio Effects -> Utility) to control your stereo image.

Flanger

Back in the old days I used to have a mono flanger guitar stomp box. Of course I put it on everything, so a lot of disgustingly mangled music was emanating from my teen angst bullshit room those days. Anyways, we skip further three decades and here’s my very basic but useful similar sounding stereo max-for-live flanger. Free to download, use and edit. It uses gen~ technology. It is fully automatable in Ableton Live.

Screen Shot 2014-08-21 at 11.36.23

 

 

 

 

 

 

I made it for this coursera course I’m taking. Here’s a video about it with a pre-version that looked more ugly and didn’t have live.dials yet:

 

Connecting Spectre to Max/msp

Spectre by Audiofile Engineering is one of the best metering options for OSX.

Screen Shot 2014-08-10 at 22.09.22

 

 

 

 

 

 

 

It’s got all kinds of meters (VU, BBC, LU, Nordic, K12, etc.) and look amazing:

Screen Shot 2014-08-10 at 22.10.25

 

 

 

 

 

 

So how do we get max/msp to talk to Spectre? Spectre uses AUNetSend by Apple. On the max side of things, you don’t even need to know where this Audio Unit file is. A vst~ object with AUNetSend as its only parameter works just fine:

Screen Shot 2014-08-10 at 22.12.43

 

 

 

 

The open message will open the Apple supplied dialog of AUNetSend, which you use to connect Spectre with max/msp. If you open it in max/msp, it will tell you it’s listening:

Screen Shot 2014-08-10 at 22.03.46

 

 

 

 

 

 

 

 

Just leave everything at its default. After you’ve started Spectre, go to Preferences – Audio:

Screen Shot 2014-08-10 at 22.03.58

 

 

 

 

 

 

 

 

 

Network should be [v] Enabled. Click on Configure…:

Screen Shot 2014-08-10 at 22.04.04

 

 

 

 

 

 

 

 

 

As you can see, Spectre is “Not Connected”. Select the AUNetSend in the Directory list (if it isn’t already) and click on Connect. Max will probably ask you if all this is allowed. Of course we click Allow:

Screen Shot 2014-08-10 at 22.03.36

 

 

 

 

 

 

Now Spectre and max/msp are connected! Yes!

Screen Shot 2014-08-10 at 22.04.13

 

 

 

 

 

 

 

 

All the audio you send to Spectre (via the vst~ object) will now be displayed by those gorgeous meters you selected.

Screen Shot 2014-08-10 at 22.05.16

 

 

 

 

 

 

 

 

 

 

Here’s the max patch just in case you want to fiddle around with it:

----------begin_max5_patcher----------
920.3ocyX1saaBCFF93jqBD6zrHv.Ax1Q8FnmLsiplhbBtItiXxrcRSaU609
7OXBrBTm1NqToDGrM1u9wu9iO5SiG4ur7Hh468Mua7FM5owiFopRVwnpqG4u
EdbUAjo5leA9.ZJGtzehtwCPJAtE0Yaj8awjBDWcmgUUdaIgyvOptiv3oAm5
6hBLAwVrCxWsASV27lDsVtmaFpnpZ0UweXGRuB78mn+baQIj668qWO1TDCQ3
PNtjHuGyralyETzJtdv.wgBw4EFEIKhDWARl3ABlFTOt3b0xtb4ceMxudjnB
bvQzEHBbYAp4pfAOfxW.4bJd4dN5zuXU.uh3RpVrGUdqoZS8MG9hRx59HeqN
x1TR4V0SCIAczFR.wJJuUnXIkUrRTxf2qJDDVVRJwLTM7aMH6IXNi+flJA51
ed73SEpued7jywLtFhIuzqcrUqsLjfN8VI84sXXAtKzKTyuN40lHmNVCOW+N
pnjLYQbl1dMqaCE3BvP0jcukkp29ZPXPGssUrcHa6qoAS6tcnZ6eVmshEtIr
XiPA2FmK62xE+wsbrBbNhNXDt1FpvdCVMnWIctxdLKUYYBhzQel2sYIaHyhI
FmInKHP7Wcb2RJtY.wv2ARHn6EhvHAN5nZM3uCS98K1+n.PyGEXC+pNFNDES
BzQsizAwyTm+5KDdZreCcU6tuhJ8XedXggJD5qj9hWbmvIwUvoJbDXt7zkWZ
zfrA3D1HEmfKwAhiyIcRmHWac.goVXcBcBd1sAxDFmAeZl6.SRrEfIvIfY0C
qJPWJbYtEwZhm+4xEzi4vUmSZNuchuyhjOjvKIw7cWqiYehahGXhy9.uq940
H9OPj7O91Y14lKmJENQIlvMUo9XQXzjDc.zzA22GJNQib5pj4WtVN6RtnDWI
LWjMye1iDC3DO4rHpsAt77+tPouiMjsHFCtF8pcjxcHx+wCUCh0vLU3k3T0S
mhTAgCy54zjcGlT2pu5EAa+FupoWVeaFwJ2SWYDa0tmWXs.xQLNlTm4zMlSD
M6yFbdNp0aZliYxDyxqeCnWsWcNpIvB0D3D0.rfMgNiM.KXSnyXSpMxA3L3X
sbbCcxrPMogWVxI3hRNxrIbkUN1F7HMOwtQOg1pGGc1JvV8.bhd9Gqw.5IxM
54hJvbjsv48HGc5Fvc6NfnrpwToDQxW2URU+eslntDSzWpxTR7RvGvl9mppA
REYGwEoFsmpSs4XlLwaw7773+ZaUQNN
-----------end_max5_patcher-----------

Easy rectangular cropping in Adobe Photoshop and The GIMP

You need to crop an image in Photoshop or GIMP but you need some precision with the rectangular selection, so you zoom in. This makes it cumbersome to make a select, because you need to drag-hold-scroll until the lower right corner is visible. Crazy! Here’s an easier way. First select a small rectangle upper-left:

Screen Shot 2014-07-31 at 15.27.58

 

 

 

 

 

 

 

 

 

 

 

Just make sure the upper left corner is right. The lower right is random. Now find your way to the lower right of your picture. No need to hold the mouse down. Again make a small rectangular selection where only the lower right is important:

Screen Shot 2014-07-31 at 15.28.27

 

 

 

 

 

 

 

 

 

And you guessed it: the Crop command now crops as if you had selected a larger rectangle! Works in both Photoshop and GIMP:

Screen Shot 2014-07-31 at 15.28.33

 

 

 

 

 

 

 

 

 

 

Screen Shot 2014-07-31 at 15.31.39

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Inserting an image into a PDF and/or converting multiple images to pdf

I needed to insert an image (a photo of a signature) into an existing PDF. There are tons of tools that cost something, crippled 2-page converters or online web services that will make you tear your hair out. So here’s how to do this for free. I must warn that it takes some command line and open source hacking around.

Step 1) Convert the pages in the PDF to separate TIFF files. I did this with the free GIMP program. It runs on just about any operating system, so that shouldn’t be a problem. GIMP gives you several options for importing the PDF pages. Be sure to adjust the resolution and Open pages as images. Unless of course you love layers and know exactly what you’re doing. If you go for a default resolution of 100 dpi, you might lose some quality. Don’t worry if you get gigantic TIFF files. They’ll be compressed back later.

Screen Shot 2014-07-28 at 15.24.09

 

 

 

 

 

 

 

 

 

Step 2) Within GIMP edit the page you want to insert something into. If you can’t work with GIMP, export all the pages to TIFF and edit them in your favorite image editing program. Either way, you should end up with a separate TIFF for every page in your PDF. Exporting to TIFF in GIMP is easy if you know how. File – Export As… and then Select File Type (TIFF Image). Check if your TIFFs are all beautiful. They should have increasing names, like page01.tif, page02.tif, etc.

Screen Shot 2014-07-28 at 15.29.15

 

 

 

 

 

 

 

 

 

 

Step 3) Move all the TIFFs to a single temporary directory which you can access from your command line. Now we can do this in OSX or Linux. I happen to have both on my Macbook Pro. If you don’t have at least one Linux distribution at your disposal, it is time to change this. In this day and age one meddling with computers should at least know some basic Linux. The command we need is convert and it is part of a wonderful open source program called imagemagick. To install imagemagick in OSX I highly recommend homebrew. First we run of course:

osx_prompt$ brew update

 

Then followed by:

osx_prompt$ brew install imagemagick

 

Of course osx_prompt$ is the name of your OSX Terminal prompt.

In Linux (Debian in my case) it is (as a super user):

root@debian:/home/your_name# apt-get install imagemagick

 

3) We now cd to the directory where all the TIFFs are and execute the command:

root@debian:/home/your_name# convert -compress LZW *.tif new.pdf

 

Or you may choose to run this as a normal Terminal, because your Desktop probably is not “root@debian” so you might find that your pdf is now not owned by you. Also in OSX you can now simply run:

osx_prompt$ convert -compress LZW *.tif new.pdf

 

There it is, a beautiful PDF to mail to the eagerly waiting other party! Two things to note:

- We do an LZW compress because else the PDF would be of a monster size. Especially for b&w page scans you can compress a lot using a simple LZW.
- If all your TIFFs end with .tiff, you can say convert -compress LZW *.tiff new.pdf of course.

Copy icons in OSX

Sometimes I just want to change a default icon (e.g. for a folder) in OSX. So where to do this? First you need a source image to copy. These days (OSX 10.9.4 when I write this) just about every image you can preview can be used, as well as other Application or Document icons. It wasn’t always so.

Say for instance we want to use the Blender icon for the folder it occupies in our Applications folder. The default is the boring blue folder:

Screen Shot 2014-07-13 at 14.00.50

 

 

 

 

 

 

I enter the Blender folder, select the actual Application and choose Command – I to get the Info window:

Screen Shot 2014-07-13 at 14.02.22

 

 

 

 

 

 

 

 

 

 

 

The trick is now to select the small upper icon and Command – C it:

Screen Shot 2014-07-13 at 14.03.27

 

 

 

 

 

 

You can then do the same for the Folder where all the Blender files live in…

Screen Shot 2014-07-13 at 14.04.27

 

 

 

 

 

 

….except this time Command – V the copied image into it:

Screen Shot 2014-07-13 at 14.05.50

 

 

 

 

 

 

 

Voila:

Screen Shot 2014-07-13 at 14.06.52

 

 

 

 

 

 

 

 

Controlling TouchOsc via Python and maxmsp

Controlling an OSC client via Python is super easy thanks to the python-osc module. You install it via pip:

 

thingthohmmmmmm:~ henszimmerman$ pip3 install python-osc
Downloading/unpacking python-osc
  Downloading python-osc-1.4.1.tar.gz
  Running setup.py (path:/private/var/folders/wz/7t75jnps3m5dvmrqd4kwpglh0000gn/T/pip_build_henszimmerman/python-osc/setup.py) egg_info for package python-osc
    
Installing collected packages: python-osc
  Running setup.py install for python-osc
    
Successfully installed python-osc
Cleaning up...

With that out of the way, it takes just a few lines of python to control the super great fun TouchOsc iPad app (in this case its monome128 template):

# Python3 on OSX controls OSC UDP iPad client TouchOSC
# with the monome128 template.
# H.Zimmerman, July 4, 2014.

from pythonosc import osc_message_builder
from pythonosc import udp_client

import random
import time

# Hardcoded IP of TouchOSC on my iPad and port 9000.
# TouchOSC has monome 128 template loaded.

client = udp_client.UDPClient('192.168.178.31', 9000)

# Turn on and off 100 times.
# We start with 1, else the TouchOSC LEDs are turned off first
# which suscipiciously looks like it isn't working.

for counter in range(1, 100):

    # Monome128 template has (duh) 128 buttons.

    for buttonIndex in range(128):
        # Build the OSC address of the pushbutton we want to control.
        buttonAdr = '/1/push' + str(buttonIndex)

        # Some console output for our nerdy debugging fun.
        print(buttonAdr)

        # Now construct an OSC message.
        msg = osc_message_builder.OscMessageBuilder(address=buttonAdr)
        msg.add_arg(int(counter % 2))

        # Send it to the iPad.
        client.send(msg.build())

        # Slow down, OSX, else it's over before we know it.
        time.sleep(.1)

I was already having a lot of fun controlling TouchOsc via UDP using max/msp.

Screen Shot 2014-07-04 at 21.34.24

 
 
 
 
 
 
 
 
 
 
 
 
 
 

In case you want this max patch for experimentation fun, here’s the code:

----------begin_max5_patcher----------
1653.3oc4a0saaaCF8ZmmBBgMf01DW9qnztYXXO.6hc4ZQgrEiiZkkDjjyRa
We2GEoUhaijEcMImRZBjULMk8QG+8c99gLe9hEAqJuSzD.9UveCVr3yWrXgZ
ntAVr+4KB1lb257jF0zBVWtcqnnM3R8q0JtqUMdSaYU+fE61lUjKZUWA5gAK
201OJb+nYopqtb06uhh6u9qKKZKR1JTuzuWmkje+qTuYk5xWBOXtMYeRMWD9
9gqRZWeSVwl2UKV2pu+XQQxWFfwpSD7Rl7Ix2Hva6tjubwEcOb4YRCU4Ie77
nAB2wz.jqtysBMrUzzjrQ7HZ.NHGfGjC5YF8PserRnAZP.3sCPOgFPOFSFgx
67ukLPQVlLPtiLn1jLXT3ibP9tIiBw+HQ3i3hZ4Ml.fBoxCl7HTdvkGQxiX.
hOrgSzfbUznb0kG4XPdDYUipX7RbG2wzBNPj9jkYRwFwcUfWWsq4le4MxeRe
0KV9xSP6gYL8MDkgsqeXnhpPXr5DJ7rXrbQ5Q4gpjZIdaE0uSTjrJWbnRrgt
iYRs+gnkPRv32kbl1AiC6u8ruYwU.qH2L18GypJNzH022TB+IYrHFwljAGQT
r.h5N42ceJShhnSfQHiwHqRJ1zoNzedTKFnUsXXZKFnRgfFeVtPikD25bQRM
PphzblYzF61T43jXc1KJxficgdRKX0IPBniZsLj4Ak6.en8LBl5BF4O+q+3J
cZLcgdeoMXmgYFpChvFoTZQPmXqrqnJY8G.YfqOARAerPPRckqyKSFVYgZU4
WDDxTbSj5T34wPiELpQzB9I2UP.0pIxRBoc5KgHlNJslddhwH1M7S7SeFgD6
fJnsCiLhtxlDoXK6DHjyqzFRjc0UzAiHDcsM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yqjwHzYFdLI4PhG0eLIXAk6W7LUxpjP+hmICt6Q6GnI5gj4EdH9CO
3XSKtvOIig4yp1rnRKdxut7W3cLad0KArQgK7n4rQ8RfMyvi+RGCiMIbpGwi
QgSoyK7f8WwW3YVuePFU9kGwiIgKP9K8GT3rJ7ExjvEH+4dgnyK5wD0YOZ7X
h3LxehyH375aKSBc4sDUMJPw2ahg5EqLop5VQcy92SERB1l7d8dxH7R0SyJz
OUs1rA0hay5mudBI0quIqUrtcWsdIVuKJL3htOmubw+AEYN1b
-----------end_max5_patcher-----------

Through the wonders of UDP networking, TouchOsc can easily be bombarded with osc messages from both max/msp and python. Here you can see a silly demonstration of just that:

A good use for Pro Tools’ relative grid option

One of those things in Pro Tools I ignored for years until it dawned on me how handy this could be.

rel

 

 

 

 

 

 

 

Scenario: In a post production timeline (so to be clear: this is not a song) where you work on a timecode grid with frames, some event needs sound effects. This effect happens to be a graphic that ticks away the seconds. You want a beep on every second. Now simply switching to grid mode will not necessarily align the events on the seconds. Place and align the first beep in slip mode, then switch to rel. grid with a seconds grid (see below). You can now alt-drag every next event to the next second. It’s super easy and fast!

rel grid

 

 

 

 

 

 

 

 

 

See the current position in hh:mm:ss in Ableton Live using max-for-live

Display the current position as regular time (HH:MM:SS). Handy if you want to use Live as regular sequencer and need to know the current position in your timeline. Also works as a floating window (many thanks to maxforlive.com user synnack for showing me how to do this!).

position

 

 

 

 

 

 

 

The max-for-live device I built for this purpose is of course hosted on maxforlive.com:

http://www.maxforlive.com/library/device/2376/position

But you can also download it here.