Having Python talk to the Arduino Yun

So in this thing I’m building I want Python to dictate what’s happening and the Arduino side of things to just react to commands for i/o. In this example, there are two LEDs connected to digital pins 12 and 13 (with a 220 Ohm resistor).

IMG_6104

 

 

 

 

 

 

 

 

 

 

First the Arduino code:

// Arduino Yun listens to python script via Bridge library to turn digital pins on/off.
// H.Zimmerman, 9-12-2014.
// Arduino Yun.

#include <Bridge.h>
#include <stdio.h>

// Here we will hold the values coming from Python via Bridge.
char D12value[2];
char D13value[2];

void setup() {
  // Zero out the memory we're using for the Bridge.
  memset(D12value, 0, 2);
  memset(D13value, 0, 2);
  
  // Initialize digital pins 12 and 13 as output.
  pinMode(12, OUTPUT); 
  pinMode(13, OUTPUT); 

  // Start using the Bridge.
  Bridge.begin();
}

void loop() {
  // Write current value of D12 to the pin (basically turning it on or off).
  Bridge.get("D12", D12value, 2);
  int D12int = atoi(D12value);
  digitalWrite(12, D12int);
  
  // An arbitrary amount of delay to make the whole thing more reliable. YMMV
  delay(10);
  
  // Write current value of D13 to the pin (basically turning it on or off).
  Bridge.get("D13", D13value, 2);
  int D13int = atoi(D13value);
  digitalWrite(13, D13int);
  
  // An arbitrary amount of delay to make the whole thing more reliable. YMMV
  delay(10);  
}

Next the Python script that just tests the digital pins. In real life this will become something more simple that can be called by cron or whatever. In fact, that’s exactly what I’m doing, this being a LED clock for my daughter. /root/led12on.py is a simple script that can be inserted into the crontab (as well as /root/led12off.py, etc.), as long as you run chmod +x on them.

#!/usr/bin/python

# Test to (un)set pin 12 and 13 on the Arduino Yun.
# H.Zimmerman, 09-12-2014.
# henszimmerman@gmail.com

import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge')

from time import sleep

from bridgeclient import BridgeClient as bridgeclient
value = bridgeclient()

for idx in range(0, 100):
    value.put('D12','0')
    value.put('D13','1')
    sleep(0.1)
    value.put('D12','1')
    value.put('D13','0')
    sleep(0.1)

print("I hope you enjoyed the light show\n")

Using nano instead of vi on your Arduino Yun in SSH mode

Call me a n00b, but I prefer using nano over vi. This, too, when I use ssh to access my (incredible) Arduino Yun.

ArduinoYunFront_2_450px

 

 

 

 

 

 

 

 

 

 

 

However, on the very basic setup of Linino on the Yun, there is no nano to be found. Just vi. What to do, what to do?

- First, update the package manager (these are all ssh terminal commands that run on your Yun in ssh):

root@TheYun:~# opkg update
 

- Next, install nano:

root@TheYun:~# opkg install nano
 

- If you would now run nano as is, it would result in an error:

root@TheYun:~# nano
Error opening terminal: xterm-256color.
 

- So enter this command first:

root@TheYun:~# TERM=xterm-color
 

- Now nano can be your friendly neighbourhood default editor again! Yay! Happy nano’ing!

 

 

 

Creating stop motion video from single images in FCPX

I’m helping an artist to create a stop motion video from a whole lot of TIFF images. I had to figure out a quick workflow in Final Cut Pro X to create a movie out of these frames.

- Create a new empty project in the desired resolution (same as the still images).
- Import all the images (File – Import – Media…). There is no need to analyse them.
- Select all images in the file browser (Command A). They all turn yellow.
- Press D. Reject your intuition to drag them into the storyline, because it might take a while. Pressing “D” simply does an overwrite edit.
- In the timeline, again press Command A to select all the frames as they are now inserted into the timeline. As a default, they all last 2 seconds or something. This is not what we want.
- Press Control D. This sets the desired length of clips.
- Press 1 if every frame should be visible for 1 frame. You might want to use 2 to project every frame 2 frames. Up to you.
- Press Enter. The timeline now shrinks to the desired length.
- Export the video in your desired output format (File – Share… – Master File)

Screen Shot 2014-12-09 at 12.55.29

 

 

 

 

Screen Shot 2014-12-09 at 12.51.11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Recording 1280 x 720 jitter output with Max 7 and OSX

Recording HD (1280 x 720) video on my Macbook Pro running OSX Yosemite 10.10.1 takes some parameter fun to get it all working. Ideally I would like the generated .mov files be a) editable in Final Cut Pro X and Motion and b) viewable through OSX QuickView for easy evaluation. It appears that in my current setup prores4444 fails the latter. Even though output is generated, QuickView does not play it. Bummer. Prores422, easily good enough, works just fine. So that’s what I use:

Screen Shot 2014-12-07 at 22.07.07

Hooking it all together, here is the Cycledelic jitter patch adjusted for 1280 x 720 recording fun:

----------begin_max5_patcher----------
4649.3oc6ckrjiabD8bOeEXXLVVZb2z0JVbXovRxgu3H7EcTgbGfjfjPMH.L
.3L8Xa4+G+a3uLWKXkDfcQrSMcefMPgBEx5kYk0VlY8udycKVE7rS7Bs+f1O
pc2c+q2b2chj3IbW582s3f8yq8riEYawAm3X6cNKtW9rDmmSDo+wH2DGMDco
VXTPjSLAgzzAfr74e7fqumShnPPEIFbLIKUXZptaDEXvpe9ALJ68k4K4SgNR
hcwBseJ8QwIexSj5hrLGZmrduq+tGibVmHyO0BuDbuFwBx+GDav+GBsDn8S7
24Wdya3+buhffuyGYj2YXvO6lrj8ICh1nAQl.MCT80eXs0ez40+h2+r5O6a8
3A6jH2mWb+0iFFDd8WGJfAHDLDnQnVbxwsaqEA.pJAPnYu+1.+De6Cx512F4
Z6oB1bc3BljJWXIDVPEvRIhH18eJJHHboE6EvYT8d2Mab7KWODeAmnTnKE6X
EhqmyGbhhcCJm66VXGFVJ46J8Jb.+mCDEjw84I45KSBjmTjyGbOsXYkaDqdl
vpjGijHvyl5KJJlfMNQ9GcEuiLQFq+MYEXFzP.BgDCAxXBSAHRA1vjR1sNvS
RR+nlrcV4eJmQuf0O4roLwuHHzw20Ojo5vwOwNIsVj+3MNasO5k7XEN.mjp4
4asW6z3KWqLzcK1E4tIvmSDU3I7jy9brJEUTWnkqLhb3aGVyKyDfY3WCOLlU
IOFuxNhyxVIkMQYOLIHvq5ixeOOmsIoONz02+DTLIHr4GF4ta+Ed2UArGd3R
ks3IwOdzW9zGYp.RdL19CUQ6DaOuTcBUK9ms8cYsKcRbkr.DH+gN91rJ5930
QAddUpuxm7gZdxFlz9ZmO5tIYu3CUVXfkc2vLgnE4b4Mt6bhSplVh8t3pobl
tBVRGWk1Z9wDmCgdrZQ0LToizxMcKq8rR5WRK548qH0mosc0SZDs06siNsKl
F6lo4tZNq6FX4xp4FKWSGRM.nMn.V1.CCj5LzImp.N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mZ
Pyz1LLPaHbrt3UcLj6zW9UWZqEoe0YLG7qt3UM6VcXk8.5Qvs5jALMSoa0Y7
pa0UDyMjtJNDaJUKmtSF3WcqtWcqtWcqt9vs55cqYGunca6c4fgvHaM68893
NHtVHRZuRP7uB.H3fXAcoA5m4l+PrhGVDOw7DGH2RybBrob4wPo9T5SlWD8k
AmxQA9m.yFMUqPJ7aN2raTVW11qeh0Go1Erdzq1mY6jslmepi0E6HME1IRuQ
yb1YSz6FOcNSfqYAM0m05b1Mh5bzm.3W1Q6mW5bLlZUNon9rUkSTMpb5ln8D
3JhxPE8rUwRTcJV5FHOEdGG4yO0GnIW8AYx0dLplKcmfoNMGxo0JomO1oo4s
GIqpIhMuLEcnBTL81yTzw2dlhN91yTzwuZJ5cyDoUo0G4lyntw2f14H31yNG
Mt8LyQq4EIqRyOyaNCyD8pgY1RCyroSjo3jfvNdnLg6K68PGkFToDS1P5azR
C9nEUXNW7n6EsAHdVRM.uMNqWnb.kt2pvFPogYYJqpVnQqF63ui25T4prdeW
koxMz1BVaUVTlUmmnDANUwRJNb44Edg9xI444bCF5LkHmwOTkZLTjZPiF0.U
fZviB0PnJ.NjJiTb5omp9b14cB0mzCQE5w5EvmCtaBCb8ShKVzbJS52Rn3gP
jlBek6P5xyeCcKdNE2UPD8WsSwVFiDuWwVFvQgZvJoDy7537o7yzibFpz8Gp
dGVZ2kTJkmSwcC.m+DBug18fQi2iURIs03QO5yK8PXUzKdBHNn3iRzC4EZsV
eqCrLtlRk1vyI2I8dHpEPjSv.05PIEizwCswyLoQzLid.pJMNR7KEHGyQiZP
J0SFXFROWitCS49hYRGDMBnYVKvpgJBkBBMCKOUI5AOynG3nQOPcEGps93PN
TEIG53PNpzeKbzlhNDqH4LNyDABUjbFIQYUzD1RpQtxSm37WbB4Dm95DG95b
m8pYG85Tm7h8k+k27+cuhSgH
-----------end_max5_patcher-----------

Controlling a stepper motor with an Arduino

Here’s the scenario: I have a SM 42051 stepper motor from www.emisgmbh.de. It is supposed to drive the main plateau of my dad’s merry-go-round. Permanently hooking up the merry-go-round to a computer is not an option, so a standalone solution is called for. Bring on an Arduino! So how to continue? First the specs for the motor:

12 VDC
0.6 A
1.8 degrees
bipolar (4 wire)

The main bus of the merry-go-round is (how fortunate!) 12 VDC, so I can drive both the Arduino and the stepper motor from that. In this case, I bought an Arduino Leonardo without headers:

LeonardoNoHeadersFront_2

 

 

 

 

 

 

 

 

 

This makes it easier to solder in the wires and hide the Arduino away in the internals of the merry-go-round.

The motor needs an external power supply (as opposed to driving it from the Arduino). Although it functions at 5V, the Arduino can in no way deliver the current needed. My first experiments resulted in a shaking (not rotating) motor, so I quickly realised an external power supply was called for. Of course I have a DC power supply with a current limiter, so that’s just awesome. By the way, the Arduino Leonardo happily accepts 12 V DC input and regulates it internally.

IMG_6103

 

 

 

 

 

 

 

 

 

Next, the circuit. Rotating a bipolar stepper motor involves some Arduino instructions and the proper hardware. In this case, I used a Texas Instruments SN754410NE Quad half H-Bridge. Wiring such a thing to an Arduino is pretty straightforward. I’ve marked the colors of the stepper motor wires, which are a bit non conventional for the SM 42051 I think:

hbridge

 

 

 

 

 

 

 

 

 

Notice how the H-Bridge gets its own 5V input voltage from the Arduino Leonardo and the motor coils itself are driven by 12 V DC from the external power supply.

Now for the Arduino side of things. Of course we use stepper.h for all our stepper motor needs. In this case a bipolar motor, so 4 pins from the Arduino are needed. Which ones is quite arbitrary, so I went for 8, 9, 10 and 11. Now for the extra bit of fun, I wanted to switch the motor on and off using digital circuitry. Of course it would work to just interrupt the DC voltage, but this is a bit severe and the Arduino has very little to do for a basic stepper circuit. Now how does one add a flag to a basic motor on/off circuit? This turned out to be slightly tricky. You can’t just watch for a switch being pressed during the loop() function, because Stepper.step() is a blocking function. So a hardware interrupt is called for. Using a single switch for on and off sounds sweet, but it is too quite tricky to create without it being intercepted more than once (a.k.a. debouncing). I was totally okay with two separate switches, on and off. So I assigned pins 2 and 3 of the Leonardo for the on and off switches. This is all described here, so I did the same using 10K resistors.

That leaves us with the code:

 

/* 

H. Zimmerman <henszimmerman@gmail.com>
17-11-2014

Motor: SM 42051
Arduino Leonardo
IC: SN 754410NE

*/

#include <Stepper.h>

const int stepsPerRevolution = 200; // SM 42051

volatile bool motorRunning = false;

// Initialize the stepper library on pins 8 through 11:

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);            

void setup() 
{
  // Watch for key presses on digital pins 2 and 3.
  
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  
  // Pin 13 for the built in LED.
  
  pinMode(13, OUTPUT);
  
  // Blink thrice for testing purposes.
  
  for(int idx = 0; idx < 3; ++idx)
  {
    delay(200);
    digitalWrite(13, HIGH);
    delay(200);
    digitalWrite(13, LOW);
  }
  
  // Set basic speed for the motor in RPM.
  
  myStepper.setSpeed(120);
  
  attachInterrupt(0, onPressed, RISING); // On digital pin 2 Uno.
  attachInterrupt(1, offPressed, RISING); // On digital pin 3 Uno.
}

void loop() 
{
  if(motorRunning)
  {
    digitalWrite(13, HIGH);
    myStepper.step(stepsPerRevolution);
  }
  else
  {
    digitalWrite(13, LOW);
  }
}

void onPressed()
{
  motorRunning = true;
}

void offPressed()
{
  motorRunning = false;
}

Recording video from Max on OSX

Really two issues here. One is the fact that jit.qt.grab does not behave well under max 6.1.8 and 6.1.9 running on OSX 10.9.5 (yes yes, I will upgrade to Yosemite soon). The other is which codec to use to record HD video that can be further edited in Final Cut Pro X, Motion or whatever you are using.

To start with the first issue; if you are using the patch from the jit.qt.grab help file, it will report jit.qt.grab: doesn’t understand “write”. The solution: take the output of jit.qt.grab and patch it into a jit.qt.record object:

 

Screen Shot 2014-10-29 at 14.48.08

The other issue is: which codec to choose from the myriad of available codecs if you want to edit your movies further? I have successfully used the one in the above picture, which is apple_intermediate_codec. So simply send your jit.qt.record a write 30. apple_intermediate_codec message (for 30 fps video) and when you’re done, send it a stop message.

Here is the help patcher for jit.qt.grab with an added jit.qt.record. You can try it with your built-in iSight camera or something like that.

----------begin_max5_patcher----------
5352.3oc6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TcwD20
FNOphCxif3.VrhoUk7mdAjOF1I4Qz.UUgdpW5TriQmJjBVyc0NsdoSQOBreQ
RILWJa8xqW5SgGg9jhQCjUEIQiHfyLhPrrzDFANuIURws2NzTfVPsCw0ff0s
dLPftrtK6n+e3nF4wvhuTyBzqqmmm7CHxig+ARtNHrJwxpKmgGcHLCK75JJu
s18kbo7X3OgPAydppd.2KcJ0QnSoCAVwpZ.cuzo5hSIR+sPoxt3OgxeKTprK
yA9Zr6GU5g9.bNUxNZDi5EiXhnCgHw0kyitxOcJnHipCMR73vol7+UseDvX7
TVYmYffHZe6UWU8fra9Rp1XOLDq2a2z9wnWwOFNbv.Ett7FUFJAICIUpZ5Ww
s0t+82vlzHrcf.r8bbkgUEppEQmK.zvv0nO9V+JzvTyX0a+X0q1E2JSumQYA
4J2RuhGpB3TAC29pm.8J9goWInFnWoLV2lO58pcICxX6atDorbf1SzQgF35n
10qiaBf4PGpY0Zt25S9aM53cwrOOzezSWl3Myeo7.ybTxmsq3AwCiDASpkVK
cARvjGt2.uklYFdfRnznE9F1AV27Qfkk0oTT0eiHcYJfL+MwBVWl8Fye4OBq
KN8xD9idNJAxslk0OCjf3GBVjqO2p5lgMQf0KEdR40vmi0MeL5SrCggiarxN
0rBeUepgM6iYepSFC8mpN5QIUvLXRJoNHo7oaGaDub4GRxKpHKauYv732513
QpgO1UHMbe0NynA3tkc8u2VBLFDmOZZZYxnxU4tcKyGs0BI387ue7+Af2H1T
A
-----------end_max5_patcher-----------

Hyperacusis – 31 day challenge

Unfortunately I have somehow turned myself into someone who suffers from hyperacusis. This has been going on for more than a decade, and last year I was checked by the hospital and indeed diagnosed as someone with hyperacusis. They also said there was little they could do for me.

I totally blame my own way of living for this condition. Either it’s the bad sleeping habits, or the bad eating habits, or the bad exercising habits or the fact that I listen to sound all day. Or (most probably) a combination of these. Whatever it is, it is most probably my own fault. But that’s not important. My 31 day challenge is to see if I can make it better, even a small bit. This is pretty difficult to quantify, but I think I will be able to tell if things have improved, worsened or remained as they were.

On http://www.hyperacusis.net/ we read that there are several known substances that may play and adverse role in hyperacusis (and/or tinitus; those two are very much related). One of these is caffeine. Now I used to be a coffee junk for several decades, but I’ve pretty much switched to decaf and tea a few years ago. However, that still means I have a daily dose of caffeine intake. At mayoclinic.org we read that decaf can have as much as 12 mg of caffeine, while black tea can have as much as 70 mg of caffeine. Even green tea can still contain as much as 45 mg of caffeine.

Another thing that has helped many people suffering from either hyperacusis or tinitus is listening to pink noise. A pink noise generator was of course easily built in max msp. Here’s how my pink noise generator looks:

Screen Shot 2014-09-02 at 10.29.33

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can download this pink noise generator as an OSX app for free here. Hyperacusis.net suggests listening to pink noise at a low level.

So here’s my personal challenge: I will drink only fluids that contain absolutely no caffeine for the next 31 days. I will also listen to my pink noise generator as much as possible. Then it is of course impossible to tell which of these two was the most beneficial in alleviating the hyperacusis condition (if at all!), but if I report some form of progress, this might be helpful for others suffering from the same or a similar condition. I will report back after 31 days, that is october 4, 2014. I think there will be some physiological response in my body from total caffeine withdrawal. Today was lost (had some tea and decaf already), so my start date is tomorrow, september 3, 2014.

hz37edit

I sometimes find it quite amazing that people are still using my edit software, hz37edit. It has made it onto several released records, which is quite nice to know. You can still download it here, a free Windows installer. It still works in Windows 8.1.

 

1469565369_4129a58dc0_o

 

If it doesn’t make sense, here’s a track I edited with my own software:


 

 

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: