New Interfaces for Musical Expression

By Michael Lyons

notes

http://www.kasrl.org/publications.html

Gestural control without primary feedback. i.e.. Theremin.

Perry’s Principles (perry cook)

human/artistic

  • P1: Programmability is a curse
  • P2: Smart instruments are often not smart
  • P3: Copying an instrument is dumb, leveraging expert technique is smart
  • P4: Some players have spare bandwidth, some do not
  • P5: Make a piece, not an instrument or controller
  • P6: Instant music, subtlety later

Technological

  • P7: Miracle, Industry Designed, Inadequate
  • P8: Batteries, Die (a command not an observation)
  • P9: Wires are not that bad (compared to wireless)
Miscellaneous
  • P10: New algorithms suggest new controllers
  • P11: New controllers suggest new algorithms
  • P12: Existing Instruments suggest new controllers
  • P13: Everyday objects suggest amusing controllers
New (as of 2007)
  • P14: More can be better (but hard)
  • P15: Music + Engineering is a great Teaching (and Marketing) tool
  • P17: Younger students are more fearless

 

Tweet from Max with ruby

Update 6/2014: working version here: https://reactivemusic.net/?p=7013

notes

The zapier.com trigger method of sending tweets from Max is limited by number of tweets and sync rate. So it would be nice to set up another intermediary server program in ruby or php which eliminates the middle-man and just sends tweets directly.

Or you could use the mxj searchTweet program, which has been updated to do this on the search side.

twitter gem

update: Got it working with this gem: https://github.com/sferik/twitter. Its much easier than dealing with xively.

docs: http://rdoc.info/gems/twitter

how to destroy a tweet: http://stackoverflow.com/questions/10640811/twitter-gem-how-to-get-the-id-of-a-new-tweet

how to get a timeline: http://bobbyprabowo.wordpress.com/2010/01/01/simple-twitter-gem-tutorial/

example of error handling code:

MAX_ATTEMPTS = 3
num_attempts = 0
begin
  num_attempts += 1
  retweets = Twitter.retweeted_by_user("sferik")
rescue Twitter::Error::TooManyRequests => error
  if num_attempts <= MAX_ATTEMPTS
    # NOTE: Your process could go to sleep for up to 15 minutes but if you
    # retry any sooner, it will almost certainly fail with the same exception.
    sleep error.rate_limit.reset_in
    retry
  else
    raise
  end
end

 

Another useful SO post: http://stackoverflow.com/questions/16618037/twitter-rate-limit-hit-while-requesting-friends-with-ruby-gem/16620639#16620639

 

How to set up Max Twitter triggers with Xively and Zapier

note: 6/2021 – Everything on this post no longer works, except the idea. See Internetsensors posts for current methods

notes

pachube.com and cosm.com have now changed into xively.com. Also Twitter has migrated to the version 1.1 API. The old method of sending tweets with cosm.com no longer works as of of June 2013.

Here are revised instructions for setting up an intermediary program that allows you to send Tweets from Max/MSP using a xively.com “device” (feed). This setup is required by the tweetCurl patches in the Max/MSP internet sensors project:

https://reactivemusic.net/?p=5859

Summary: the Max program will issue an http: put request to your xively.com feed with the Tweet text as data. When the data is received it triggers a request to xapier.com which logs into your Twitter account and sends the Tweet. xapier.com handles authentication using Oauth.

1. set up a xively.com account (self explanatory)

2. add a device. From the xively.com home page select “develop” from the “web tools” menu. You’ll get a screen like this one:

Click on +add device. The following screen will appear:

Fill in the fields. The names and choices can be whatever you want.  Then click the “Add Device” box to get the following screen:

Now click on +Add Channel. Fill in the Channel ID field with the name: tweet (as shown below) then click the “save channel” box.

3. Add Trigger. The trigger will link this channel to Twitter. Please follow the instructions here: https://xively.com/dev/tutorials/zapier/

Notes:

  • You will need to sign up for a free zapier account
  • assign Twitter as your action service for the “zap”
  • For the ‘message’ field of your zap select “body trigger datastream value value”. This will be the actual text of the tweet coming from xively.com
  • limited to 10 tweets per hour
  • when you select twitter as an action in zapier, it will attempt to log you in to do the oauth authentication. If you are already logged into Twitter – make sure its the correct account.
  • zapier will provide you with the URL to insert into the trigger field in your xively.com device.
4. From the xively.com device screen copy the feed-ID and API-key into your Max patch in the appropriate fields.

 

 

 

 

Tesla vehicle API with Max/MSP

notes

update 12/2013 – see this post for an example of how to display geo-coded data from Max/MSP to Google maps https://reactivemusic.net/?p=8115

original post

This is a reference to some notes. In June, I wrote a Max patch to communicate with my brother David’s Tesla Model S, using an API which runs on Tesla servers and communicates with the car. You can do things like honk horn, flash lights, open doors – and also receive data on speed, position, and battery condition.

Can’t really test the control part of this – without the possibility of causing a car accident in California, but here’s a screen shot of the files. Essentially  I just ran a node server for the API and communicated from Max using Osc.

The last thing I did was to track his return trip from SFO to Santa Cruz and plot points on a map.We will eventually update this prototype to plot data on a Google Map.

Much of the logic was borrowed from the Irish Train mapping project: https://reactivemusic.net/?p=5477

 

 

 

How to change Twitter trigger with Xively to use Zapier

notes

This method was used to fix the tweetcurl series of Max patches and anything else which uses Tom Igoe’s method of sending tweets from Arduino via cosm.

http://www.tigoe.com/pcomp/code/arduinowiring/1135/ (old method)

The automatic twitter trigger used in the “internet sensors” project via cosm, stopped working when cosm migrated to xively.com. But it works correctly from a device (or Max) to xively. So you don’t need to change anything except the xively trigger associated with the feed.

The fix is to go into your xively feed (legacy feed) delete the existing trigger and set up a new trigger using zapier – using the instructions in this tutorial.

https://xively.com/dev/tutorials/zapier/

Notes:

  • You will need to sign up for a free zapier account
  • the text value of the tweet for zapier is called “body trigger datastream value value”
  • limited to 10 tweets per hour
  • when you select Twitter as an action in zapier, it will attempt to log you in to do the oauth authentication. If you are already logged into Twitter – make sure its the correct account.

If you really want to send Tweets from Max, check out the Twitter client that uses ruby: https://reactivemusic.net/?p=7013

 

 

 

 

get web video into Jitter

notes

1. first QC + syphon

http://cycling74.com/forums/topic/using-jitter-to-display-a-website/

Have installed this plugin with Quartz Composer and used the Simple Browser.qtz example, in tkzic/quartz

http://code.google.com/p/cogewebkit/

2. Also there is the [jweb] object

http://williamjturkel.net/code/interacting-with-multimedia-in-max-6/

3. An approach using [jweb] amd [jit.desktop]

http://cycling74.com/forums/topic/import-live-feed-into-jitter/

 

Open weather map API queries

edit 4/27/2015

This curl examples for this API are broken. – the API now requires a key: http://openweathermap.org/api

notes

I’m using this API now instead of the CORDC wind forecast data for the internet-sensors wind example. You can get 7 day forecast data for practically anywhere. Also historical data is available. And its free.

Get forecast by city id

Weather forecast in the city for the next 7 days.

http://api.openweathermap.org/data/2.1/forecast/city/{CITY_ID}

http://api.openweathermap.org/data/2.1/forecast/city/524901

{"message":"","cod":"200","calctime":0.0189,"list":[
{"dt":1345251600,
    "main":{"temp":286.6,"humidity":98,"pressure":1002,"temp_min":286,"temp_max":287},
    "wind":{"speed":0,"deg":-2},
    "rain":{"3h":2},
    "clouds":{"all":56},
    "weather":{"id":803,"main":"Clouds","description":"broken clouds", "img":"..." }
....

This gets city code for santa cruz – 5393052

curl http://api.openweathermap.org/data/2.1/find/name?q=santa%20cruz,US

this gets 7 days of santa cruz forecasts with time stamps

curl http://api.openweathermap.org/data/2.1/forecast/city/5393052

typical JSON response (for one datapoint):

{
		"dt": 1364176800,
		"main": {
			"temp": 285.54,
			"temp_min": 282.6,
			"temp_max": 287.5,
			"pressure": 1015.99,
			"humidity": 87.6,
			"temp_kf": 2.94
		},
		"weather": [{
			"id": 801,
			"main": "Clouds",
			"description": "few clouds",
			"icon": "02n"
		}],
		"clouds": {
			"all": 17,
			"low": 0,
			"middle": 0,
			"high": 17
		},
		"wind": {
			"speed": 4.29,
			"deg": 311,
			"gust": 5.1
		},
		"dt_txt": "2013-03-25 02:00:00"
	}

So… to get precipitation, we need to just look for “rain”, or “snow”  indicator