Tutorials

vimeoEmbedder.js: Embed and extend the customization of the Vimeo player using jQuery

August 12th, 2013

vimeoEmbedder is a jQuery plugin that helps artists and designers present their Vimeo videos on websites the way they want them to.

vimeoEmbedder.js is a lightweight jQuery plugin designed to help give artists and designers creative control over how their Vimeo videos are presented on the web. In addition to simplifying the process of embedding and styling the presentation of Vimeo videos, vimeoEmbedder.js has a host of configuration options that can be extended beyond the Vimeo player’s native abilities:

vimeoColor

Changes the color scheme of the Vimeo player (including play button, progress bar and volume levels).

image

URL to a JPG/PNG poster image to display before the Vimeo video is loaded and playback is started.

playButtonColor

Sets the background color of the poster image play button.

vimeoBackground

Assign a background color for the Vimeo player.

vimeoID

Input the Video ID that is assigned to your video file at Vimeo.com. (copy the URL or ID from your web browser’s address bar while viewing the video on Vimeo.)

width

Width of the player in pixels (defaults to 480 pixels).

height

Height of the player in pixels (defaults to 270 pixels).

I plan to expand the jQuery video plugin’s functionality and flexibility as new ideas arise. Please feel free to contribute to the plugins at it’s github destination. I am also open for feedback and ideas for future iterations of the plugin at jason@jasonsafir.com.

Click here to view documentation for the vimeoEmbedder.js plugin
Download the vimeoEmbedder.js plugin (ZIP)

Serial Communication Between Max/MSP and Arduino Using the ‘Serial’ Object

July 13th, 2010

I needed a script to send multiple values from Max/MSP to an Arduino to control a few components. After researching for a viable solution for my application, I had discovered that it is really easy to interface Max/MSP with an Arduino microcontroller by simply using the ‘serial‘ object built-in into Max/MSP’s objects library.

Screenshot of Arduino to Max/MSP patch

Screenshot of Arduino to Max/MSP patch

arduino-to-max.maxpat (Save Link As…)

I put together a clean serial Max patch which simply uses the ‘serial‘ and ‘unpack‘ objects to get analog and/or digital values coming from Arduino into Max/MSP. This solutions makes it really easy to get serial values from your Arduino into Max/MSP by splitting up the different readings and outputting them into number-boxes.

To make the Max/MSP and Arduino serial patch work, you will also need to copy and paste a really simple Arduino syntax into a new Arduino sketch I put together below. You may alternatively download the Max/MSP and Arduino sketch.

int val1 = 0;
int val2 = 0;
int val3 = 0;

void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
}

void loop()
{
  // read analog input, divide by 4 to make the range 0-255:
  val1 = analogRead(0);
  val2 = analogRead(1);
  val3 = digitalRead(2); 

  Serial.print(val1, DEC);
  Serial.print(" ");
  Serial.print(val2, DEC);
  Serial.print(" ");
  Serial.print(val3, DEC);
  Serial.print("\r");
  // pause for 10 milliseconds:
  delay(10);
}

Like any Arduino interface you build, you will need to identify the pin numbers you are using from your Arduino, and determine whether the inputs you are using are sending digital or analog values. The below example is setup to read an analog value from pin ‘1’ and a digital value from pin ‘2’.

 val2 = analogRead(1);
 val3 = digitalRead(2);

The Arduino sketch and Max/MSP patch I put together is setup to recognize three inputs, two analog input values on pins ‘0’ and ‘1’, and one digital input value on pin ‘2’. There is no limit in how many values you can send to Max/MSP from Arduino, on the software side, so feel free to add additional pin recognition lines into the Arduino sketch if your interface requires additional inputs. If you are adding additional inputs, it is important to make sure that the Serial.print(“\r”); line always appears at the end of the loop function, directly before the delay function. This line of code simply let’s Arduino know that we are at the end of the loop.

Max/MSP Unpack Object

For every additional serial value you arrange to send to Max from Arduino, you will also need to add an additional ‘0’ symbol into the unpack object’s input list inside the Max patch. When you input a new symbol into the ‘unpack’ object, a new outlet will appear beneath the object, which outputs your inputs serial value corresponding to the pin you identified it with in your Arduino sketch. Once you are done tweaking your Arduino sketch, don’t forget to upload it onto your Arduino board!

That’s it! I connected a toggle switch onto the ‘serial’ object. Press the switch to either turn serial communication on or off between Max/MSP and Arduino.

For instructions on getting started with using an Arduino and a breadboard, I recommend visiting ITP’s Physical Computing resource page, which has many descriptive and illustrative tutorials on getting set up with an Arduino.

Free Hockey Sound Effects!

July 17th, 2009
Peter Puck

Peter Puck, a hockey puck-shaped cartoon character by David Hill

All hockey sound effects were recorded and processed by Jason Safir.

These are some hockey sounds effects I recorded at Chelsea Piers Sky Rink in New York City last weekend for a hockey documentary that I am currently producing. All hockey sounds are rendered in high quality 320 kbps MP3 format.  Special thanks to Chelsea Piers for allowing me to go on the ice and capture these hockey sounds. You may download and use them for free in any way you choose! Right mouse click on a sound effect link and select “Save Link As..” to download rather than preview.

Reading and Writing to the VDIP1 USB Host Controller using Arduino

March 4th, 2009

The VDIP1 USB host controller is a worthwhile extension module for anyone working with the Arduino microcontroller. The ability to integrate USB inputs/outputs with your Arduino microcontroller means that you can interface it with practically any USB device, creating even more exciting possibilities with Arduino. Another valuable integration feature that the module can provide is the ability to increase Arduino’s memory capacity using any USB memory drive.

Read More »