Stanford mobile music toolkit
By Ge Wang
http://momu.stanford.edu/toolkit/
synthesis tool kit: http://momu.stanford.edu/stk/
Stanford mobile music toolkit
By Ge Wang
http://momu.stanford.edu/toolkit/
synthesis tool kit: http://momu.stanford.edu/stk/
A few references:
Classic PGmidi (Pete Goodliffe)
http://goodliffe.blogspot.com/2010/10/using-coremidi-in-ios-example.html
The synthetic bits coreMidi braindump is now password protected… sigh
A helpful diagram showing terminology
http://xmidi.com/blog/how-to-access-midi-devices-with-coremidi/
Useful core Audio and core Midi links for iOS
http://www.deluge.co/?q=core-midi-core-audio-useful-links
an older ios midi project
https://github.com/JohnGoodstadt/MidiNotes
at Apple iOS developer Library
iOS code that demonstrates AVCaptureSession, AUGraph. Also, how to write audio data to a file. Basically the app records from the built-in mic and process with an AU delay effect
Sample code for a collection of utility classes to handle error check, codecs, structure compatibility, etc.,
At Apple Developer Library
At Stackoverflow
http://stackoverflow.com/questions/11596229/any-documentation-on-core-audios-public-utility-classes
This is obscure, but happened with Loup and was fixed by using the answer from the following SO post
http://stackoverflow.com/questions/13133883/having-difficulty-pulling-repository-from-assembla
<code>Error validating server certificate for 'https://subversion.assembla.com:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: *.assembla.com - Valid: from Thu, 24 Mar 2011 19:30:40 GMT until Sun, 24 Mar 2013 19:30:40 GMT - Issuer: 07969287, http://certificates.godaddy.com/repository, GoDaddy.com, Inc., Scottsdale, Arizona, US - Fingerprint: ae:b0:b6:94:14:5f:4b:28:d2:82:68:ae:e9:18:85:b3:ea:36:ee:f2 (R)eject, accept (t)emporarily or accept (p)ermanently?</code>
Shell object artifacts.
Today I set up a subpatcher in Max to launch a ruby server, using [aka.shell]. I didn’t realize it was running, so I ran it again – then Max froze, so I force-quit out of it. This left a zombie process in control of the UDP port.
Later I found this command, which identifies all processes on the machine:
# ps -xo pid,ppid,stat,command
Anyway, its probably not a good idea to run servers from shell commands without a way to kill them.
Here’s a screenshot of the sub-patcher which figures out how to run a shell command in the same folder as the patch:
in tkzic/max teaching examples/
ruby-shell-server-trick.maxpat
Using internet ping data to control a synthesizer in Max
This project uses ‘ping’ times to about 40 Google domains, like google.ca, google.de, etc., to control pitch and amplitude of a 20 voice droning synthesizer.
Imagine working in a Google control center. A soothing low pitched drone fills the room. Then Suddenly you hear a slowly rising pitch. You check the monitors – Google Paraguay is experiencing network failure. You light a cigarette and wait for things to calm down.
Not using ruby to ping – due to API shutting down. The new version uses the Max [shell] external to ping from the command line.
https://github.com/tkzic/internet-sensors
folder: ping
note: Occasionally the server program will time-out when its launched. Try launching again, or edit it and increase the timeout value in [p shellping].
The server is a ruby script which handles the http: requests using the Mashape ping-uin API and sends messages to Max using OSC
The synth has a weird clustering drone like effect like some kind of alien life force.
The patch design is kind of embarrassing. Its obvious I forgot how to use [poly~]. Maybe by the time you read this, we’ll have addressed this. Hey billions of patch cords look cool.
Here’s an example of the Mashape API in curl
curl --include --request GET 'https://igor-zachetly-ping-uin.p.mashape.com/pinguin.php?address=google.ca' \ --header 'X-Mashape-Authorization: YOUR-MASHAPE-API-KEY'
Here’s a list of Google domains
http://en.wikipedia.org/wiki/List_of_Google_domains
https://github.com/tkzic/internet-sensors
folder: ping
install the following ruby gems using: sudo xcrun gem install <gem-name>
# ./domain-ping.rb
note: Occasionally the server program will time-out when its launched. Try launching again, or edit it and increase the timeout value.
update 11/02/2014 – in process of updating and checking examples – but we know for sure that the Twitter examples are broken.
This post is a collection of many examples of using curl (from a terminal command line) to make API requests. The ones marked with* will run without passwords or api-keys. The responses will generally be in XML, JSON, or HTML
Some of these curl examples will have API keys, user names, and passwords. To run them, you’ll need to replace the keys with your own.
Also, when running from the command line, ampersands ‘&’ will need to be escaped by preceding them with a backslash, like \&
Other characters may need to be escaped, like:
%23 = #
%40 = @
Or you can wrap the entire URL is quotes like this:
curl "dict://dict.org/d:penguin"
Look in the address bar of your web browser. Copy the entire URL and run it in curl. It will respond with the ‘text’ version of the web page.
The respond from curl is raw data. To format JSON data, pipe the output through python, like this:
curl dict://dict.org/d:dog | python -mjson.tool
curl dict://dict.org/d:antelope
Twtitter API now requires authentication and will not run from a single curl command, except by using widgets. See this post: https://reactivemusic.net/?p=17428
curl http://api.openweathermap.org/data/2.1/forecast/city/524901
See this post for details: https://reactivemusic.net/?p=6265
curl https://api.vineapp.com/timelines/popular
Here’s an example of a typical API call which gets the weather in San Francisco. Note I have obscured the API-key.
curl -H "X-Mashape-Authorization: YOUR-MASHAPE-KEY" "https://george-vustrey-weather.p.mashape.com/api.php?_method=getForecasts&location=San%20Francisco"
Here’s the result:
[{"day_of_week":"Wed","high":"63","low":"47","condition":"Mostly Clear"},{"day_of_week":"Thu","high":"66","low":"50","condition":"Partly Cloudy"}]
[Note] more examples in tkzic/mashape
Here is an example of a request to the Thesaurus API
curl http://www.dictionaryapi.com/api/v1/references/thesaurus/xml/cheese?key=ee2466d2-07a0-40af-b959-abcdeb125f0ca
Here are two examples I just got to work using curl
curl -X POST --data "botid=b0dafd24ee35a477&input=hello" http://www.pandorabots.com/pandora/talk-xml curl -X POST --data "botid=b0dafd24ee35a477&input=Where are you?" http://www.pandorabots.com/pandora/talk-xml
<result status="0" botid="b0dafd24ee35a477" custid="b3422b612633ac87"><input>Where are you?</input><that>I am in the computer at Pandorabots.com.</that></result>
curl -X POST --data "botid=b0dafd24ee35a477&input=hello" http://www.pandorabots.com/pandora/talk-xml curl -X POST --data "botid=b0dafd24ee35a477&input=Where are you?" http://www.pandorabots.com/pandora/talk-xml curl -X POST --data "botid=b0dafd24ee35a477&input=Lets play some music today." http://www.pandorabots.com/pandora/talk-xml
This is an example of the curl command to run from the command line
the test.flac file is located in tkzic/speech – it contains a recording of the phrase “there are turtles wandering through the city”. If you click on the file it will play through audacity.
curl \ --data-binary @test.flac \ --header 'Content-type: audio/x-flac; rate=16000' \ 'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=2&lang=en-US&maxresults=6'
Today I was finally able to get this working. Reading a Cosm (Pachube) feed from curl and from Max. Here is an example that works in curl: (replace API-KEY with actual key)
curl http://api.cosm.com/v2/feeds/76490/datastreams/Power.xml?key=API-KEY
You can get JSON responses by leaving off the .xml extension or replacing it with .json
Its critical to use “key=…” not “X-ApiKey=…” like in the cosm documentation, or you will get permission errors from curl and Max.
Link to documentation: https://developers.google.com/youtube/v3/docs/search/list
Here is an example (minus the api-key) which searches for videos about cats and returns a JSON response
curl "https://www.googleapis.com/youtube/v3/search?key=API-KEY&part=snippet&q=cats"
Use this method to have a custom search which searches the whole web…
http://stackoverflow.com/questions/4082966/google-web-search-api-deprecated-what-now
Here is an example of a search using this method with curl – note the API-KEY is removed
curl "https://www.googleapis.com/customsearch/v1?key=API-KEY&cx=012117491442732664551:egvalbpelhq&q=lectures"
Not really applicable to curl, but it shows something.
curl -A Mozilla http://www.google.com/search?q=linux
with a specific lat/lon you can get results along the west coast of us - here's san francisco. This query returns all the current time points for SF curl http://cordc.ucsd.edu/js/COAMPS/query.php?ll=37.78,-122.44\&fmt=json > sf.json lets try for santa cruz curl http://cordc.ucsd.edu/js/COAMPS/query.php?ll=36.99,-122.03\&fmt=json > sc.json
very cool api that does phonetic spellings - works!!!! curl http://api.spellout.org/en/convert?text=some%20text\&alphabet=int-icao\&format=json
This works as of 1/28/2013 curl -v --request PUT --data-binary @./abc.json --header "X-ApiKey: 96PqSh4rj7HzNif3rWms3SUhwaDFGUT0g" http://api.cosm.com/v2/feeds/98281.json
Andy Farnell’s thunder algorithms from “Designing Sound”.
By Matt Meachem
http://mattmeachem.wordpress.com/2012/04/02/procedural-audio-thunder/