Author: scruss

  • … that our fries were still there

    Following on from this, here’s another anthem performed by the Five Guys and the Arduino Micro Cup Orchestra:

    Converted from a midi file found at American and Patriotic Midi Music (unsurprising caution: autoplay midi music therein) to RTTL using MIDI to RTTL.

    If you just want the source, here it is:

    star-spang:d=4,o=5,b=80:2p,8f.,16d,a#4,d,f,2a#,8d.6,16c6,a#,d,e,2f,8f,8f,d.6,8c6,a#,2a,8g,8a,a#,a#,f,d,a#4,8f.,16d,a#4,d,f,2a#,8d.6,16c6,a#,d,e,2f,8f,8f,d.6,8c6,a#,2a,8g,8a,a#,a#,f,d,a#4,8d6,8d6,d6,d#6,f6,2f6,8d#6,8d6,c6,d6,d#6,2d#6,d#6,d.6,8c6,a#,2a,8g,8a,a#,d,e,2f,f,a#,a#,8a#,8a,g,g,g,c6,8d#6,8d6,8c6,8a#,a#,a,8f,8f,a#.,8c6,8d6,8d#6,2f6,8a#,8c6,d.6,8d#6,c6,1a#
  • abstract lot fabric

    Well, I liked it …

  • emusic canada changes its pricing

    What with the sad loss of Wild East Compact Sounds this summer, my sources of music are now limited. eMusic, bless ’em, have been my source of indie stuff since about 2003. They were cheap, had a fixed price per download, and carried a raft of indie stuff and no major label tat.

    Not much longer; got this in my inbox:

    So, yeah, the full announcement: major label content, minimum 49¢/track, and variable pricing. Exactly all the reasons I wouldn’t want to use them. Good call, eMusic, for a battered-about subscriber since 2003.

    I was initially confused by the pricing. I pay 36¢/track, so I couldn’t see how their promise that “your monthly payments will not change and you will still be able to download the same number of tracks available today, if not more, depending upon your current plan“. Then I see their new menu:

    So basically they’re crediting me with a fake $4.48 a month (oh wait; “30 days”, not a month; they so want you to forget to download stuff by making the cycle date change) so I can still get my 35 downloads. Since they hint that there will now be variable pricing, I’ll bet the new stuff will be >49¢, so I really won’t be able to download as many per month after all.

    They’re saying that the new pricing will allow them to do a bunch of fun stuff:

    We’re also committed to making eMusic a better member experience. We recently rolled out improvements to Browse and Search pages. And we’re hard at work on a host of new features and enhancements including a music locker, which should allow you to stream your music collection from any desktop or mobile device. In addition, improvements to eMusic’s social features, to better connect you with our editors, other members, artists, labels and your friends, are also in the works. We’ve sketched out an ambitious slate, and it will take a little while to get there. We hope you’ll continue on the journey with us.

    I don’t want all that social fluff. The MP3s work just fine on any mobile device, so streaming them just adds more crud. I want fixed price downloads, not some half-assed music locker. Where, oh where is Frank Hecker and swindleeeee when you need them?

  • … we stand in line for thee

    A little bit of silliness for Thanksgiving:

    This took almost no time to put together. The “speaker” is a Tim Hortons cup with a cheap piezo glued to the base. What makes the Arduino sing is the Tone Library running its RTTTL demo sketch, with the anthem itself pasted in from a rather old Nokia Ringtones library.

    Update: Here’s the code, such as it is. It’s just the Tone/examples/RTTTL code with the tune data pasted in. I’d been programming Arduino for about a year, so that was a semi-major achievement for me:

    It’s nice to revisit old code and find it was written by a friend, Brett Hagman of Rogue Robotics.

  • late bloomer

    I guess I must’ve dropped a sunflower seed earlier in the summer. So now we have a sunflower blooming in the back garden in October. Not many bees around.

  • Arduino Uno USB invisible to OS X

    as posted on the forum:

    Just got my Uno after finding semi-permanent projects for two previous Duemilanoves. Upgraded to Arduino 0020. After rebooting, and power cycling the Uno, there’s still no serial port for the Uno.

    The board is noted under Linux, which reports an unknown device with ID 2341:0001. On my MacBook (10.6.4), System Profiler lists:
    Code:

    Communication Device:
    
      Product ID:	0x0001
      Vendor ID:	0x2341
      Version:	 0.00
      Speed:	Up to 12 Mb/sec
      Location ID:	0x24110000
      Current Available (mA):	500
      Current Required (mA):	Unknown (Device has not been configured) 
    
    

    There are no /dev/tty* or /dev/cu* devices that correspond to the device.

  • if you can measure it …

    I’ve had the PowerCost Monitorâ„¢ up and running for over a week now. It was pretty easy to fit. The fiddliest bit was working out and entering the time-of-use rates – which I’ll have to change again in November.

    Over the last six days that I’ve been logging it, it exactly matches our meter. That’s one of the reasons I bought it; I didn’t want to be fiddling with CT clamps which introduce their own inaccuracies. Now for the small matter of decoding its transmissions …

  • Dutch Bike Bits

    David will happily sell you Dutch Bike Bits, for all your fiets needs.

  • Netflix vs Zip.ca

    So, Netflix Canada launched today. As a (fairly) loyal Zip.ca subscriber, I was worried, but to be honest, I can do without putting DVDs in the mail every week. Since we can watch Netflix on the Wii, I thought I’d sign up for a trial month.

    I tried to find things I’d want to see. Netflix is drawing blanks. I took my list of 30 movies I have queued at Zip to see how they compare. It’s not so good:

    # Title Zip.ca Netflix
    1 A Single Man ✓ ✗
    2 The Dish ✓ ✗
    3 Becoming Jane ✓ ✗
    4 October Sky ✓ ✓
    5 Playtime ✓ ✗
    6 The Commitments ✓ ✗
    7 The Cove ✓ ✗
    8 Storytelling ✓ ✗
    9 Jay And Silent Bob Strike Back ✓ ✗
    10 Princess Mononoke ✓ ✗
    11 Kiki’s Delivery Service ✓ ✗
    12 Whisper of the Heart ✓ ✗
    13 Salesman ✓ ✗
    14 Festival Express ✓ ✗
    15 Fat Girl (A ma soeur!) ✓ ✗
    16 Adam ✓ ✗
    17 Micmacs (Micmacs à tire-larigot) ✓ ✗
    18 A Chorus Line ✓ ✗
    19 This is England ✓ ✓
    20 Crumb
    ✓ ✗
    21 The Harold Lloyd Comedy Collection ✓ ✗
    22 Old-Time Banjo Styles ✗ ✗
    23 Learning Mountain Dulcimer ✗ ✗
    24 Animation Greats! ✗ ✗
    25 Black Cat, White Cat ✗ ✗
    26 Northfork ✗ ✗
    27 Leningrad Cowboys: Total Balalaika Show ✗ ✗
    28 The Turning Point ✗ ✗
    29 Winter’s Bone ✗ ✗
    30 Hum Dil De Chuke Sanam ✗ ✗

    Available 70% 7%

    The unavailable titles at Zip are ones they know about, and will try to find. Not surprisingly, all of them are also not available from Netflix. The only ones I could watch at Netflix are October Sky and This Is England. And would you credit it, but didn’t the DVD for October Sky just arrive yesterday …

    Look, I know it’s early days, but Netflix needs to get a bunch better in the next 30 days. Oh, and it could do with some CanCon – it’s very weak there.

  • The Statesmen – Roo-buh-doo-buh-doo

    YouTube – The Statesmen – Roo-buh-doo-buh-doo.

    Thanks(?) to Bill Russell, who played this for me once in 1987, and I haven’t forgotten it.

  • much improved HSV colour cycling LED on Arduino

    There were some flaws in the post HSV colour cycling LED on Arduino. This does much more what I wanted:

    /*
    HSV fade/bounce for Arduino - Stewart C. Russell - scruss.com - 2010/09/19
    
    Wiring:
    LED is RGB common cathode (SparkFun sku: COM-09264 or equivalent)
        * Digital pin  9 → 165Ω resistor → LED Red pin
        * Digital pin 10 → 100Ω resistor → LED Green pin
        * Digital pin 11 → 100Ω resistor → LED Blue pin
        * GND → LED common cathode.
    */
    
    #define RED                9 // pin for red LED; green on RED+1 pin, blue on RED+2 pin
    #define DELAY              2
    
    long rgb[3];
    long rgbval, k;
    float hsv[3] = {
      0.0, 0.5, 0.5
    };
    float hsv_min[3] = {
      0.0, 0.0, 0.4 // keep V term greater than 0 for smoothness
    };
    float hsv_max[3] = {
      6.0, 1.0, 1.0
    };
    float hsv_delta[3] = {
      0.0005, 0.00013, 0.00011
    };
    
    /*
    chosen LED SparkFun sku: COM-09264
     has Max Luminosity (RGB): (2800, 6500, 1200)mcd
     so we normalize them all to 1200 mcd -
     R  1200/2800  =  0.428571428571429   =   109/256
     G  1200/6500  =  0.184615384615385   =    47/256
     B  1200/1200  =  1.0                 =   256/256
     */
    long bright[3] = {
      109, 47, 256
    };
    
    void setup () {
      randomSeed(analogRead(4));
      for (k=0; k<3; k++) {
        pinMode(RED + k, OUTPUT);
        rgb[k]=0; // start with the LED off
        analogWrite(RED + k, rgb[k] * bright[k]/256);
        if (k>1 && random(100) > 50) {
          // randomly twiddle direction of saturation and value increment on startup
          hsv_delta[k] *= -1.0;
        }
      }
    }
    
    void loop() {
      for (k=0; k<3; k++) { // for all three HSV values
        hsv[k] += hsv_delta[k];
        if (k<1) { // hue sweeps simply upwards
          if (hsv[k] > hsv_max[k]) {
            hsv[k]=hsv_min[k];
          }    
        }
        else { // saturation or value bounce around
          if (hsv[k] > hsv_max[k] || hsv[k] < hsv_min[k]) {
            hsv_delta[k] *= -1.0;
            hsv[k] += hsv_delta[k];
          }
        }
        hsv[k] = constrain(hsv[k], hsv_min[k], hsv_max[k]); // keep values in range
      }
    
      rgbval=HSV_to_RGB(hsv[0], hsv[1], hsv[2]);
      rgb[0] = (rgbval & 0x00FF0000) >> 16; // there must be better ways
      rgb[1] = (rgbval & 0x0000FF00) >> 8;
      rgb[2] = rgbval & 0x000000FF;
    
      for (k=0; k<3; k++) { // for all three RGB values
        analogWrite(RED + k, rgb[k] * bright[k]/256);
      }
      delay(DELAY);
    }
    
    long HSV_to_RGB( float h, float s, float v ) {
      /*
         modified from Alvy Ray Smith's site:
       http://www.alvyray.com/Papers/hsv2rgb.htm
       H is given on [0, 6]. S and V are given on [0, 1].
       RGB is returned as a 24-bit long #rrggbb
       */
      int i;
      float m, n, f;
    
      // not very elegant way of dealing with out of range: return black
      if ((s<0.0) || (s>1.0) || (v<0.0) || (v>1.0)) {
        return 0L;
      }
    
      if ((h < 0.0) || (h > 6.0)) {
        return long( v * 255 ) + long( v * 255 ) * 256 + long( v * 255 ) * 65536;
      }
      i = floor(h);
      f = h - i;
      if ( !(i&1) ) {
        f = 1 - f; // if i is even
      }
      m = v * (1 - s);
      n = v * (1 - s * f);
      switch (i) {
      case 6:
      case 0: // RETURN_RGB(v, n, m)
        return long(v * 255 ) * 65536 + long( n * 255 ) * 256 + long( m * 255);
      case 1: // RETURN_RGB(n, v, m) 
        return long(n * 255 ) * 65536 + long( v * 255 ) * 256 + long( m * 255);
      case 2:  // RETURN_RGB(m, v, n)
        return long(m * 255 ) * 65536 + long( v * 255 ) * 256 + long( n * 255);
      case 3:  // RETURN_RGB(m, n, v)
        return long(m * 255 ) * 65536 + long( n * 255 ) * 256 + long( v * 255);
      case 4:  // RETURN_RGB(n, m, v)
        return long(n * 255 ) * 65536 + long( m * 255 ) * 256 + long( v * 255);
      case 5:  // RETURN_RGB(v, m, n)
        return long(v * 255 ) * 65536 + long( m * 255 ) * 256 + long( n * 255);
      }
    } 
    
  • bear


    Originally uploaded to Flickr by mindazonaltal

  • Actually, I don’t think that the Notional Past was being ironic

    It’s hard to call anything “breakaway” when the combined current ages of the proponents would put them born in the same week as Lord  Rayleigh. The major schism would be over who had the more outlandish hat: radar station vs lampshade.

  • my little nerd whiskers are quivering

    I notice that TheSource.ca has the BlueLine PowerCost Monitor at a good price. I also notice that the PowerCost uses 433MHz wireless, for which you can get a 433MHz Receiver Shield for Arduino. People have used this to receive data from home weather stations.

    It’s just a smop before I have my own network-connected meter now …