National Weather Service API
National Weather Service REST API
http://graphical.weather.gov/xml/rest.php
open weather map
Now using this API with Max and Pd. See the Internet sensors projects:
https://reactivemusic.net/?p=5859
National Weather Service REST API
http://graphical.weather.gov/xml/rest.php
Now using this API with Max and Pd. See the Internet sensors projects:
https://reactivemusic.net/?p=5859
updated 5/17/2014
This fork adds the following features to Chris Wilson’s Web Audio Playground:
Try it out at: http:zerokidz.com/wap/index.html
For optimum results try Chrome on Mac OS. But it does work in other browsers.
Patch file format is JSON. Patches are reloaded by firing gesture events which created them.
Source code: https://github.com/tkzic/WebAudio
sub-folder: osctest
Note: You can either run a local web server, using nodeserver.js and index.html – in the WebAudio folder – or use the online version of WAP as described here.
1. Load WAP in a Google Chrome browser using the following URL: http:zerokidz.com/wap/index.html
2. In WAP, load a patch called: delay-thing.
Note: If the patch doesn’t exist you can paste it in by opening the file osctest/delay-thing.json in a text editor and copying the text. Then click paste in WAP and paste in the text. Then make sure to save it in WAP by typing in the name “delay-thing” and clicking the save-as: button
3. In a terminal window, go to the osctest/ folder and start the server by typing:
ruby ./wapOSCserver.rb
4. In WAP, Press the OSC button – the ruby server should acknowledge with the message: “WebSocket connection open”
5. Open the Max patch: wapOSCtester.maxpat
6. In WAP press the play button on the Oscillator module (you should hear sounds)
7. In the Max patch drag the slider on the left to control the oscillator pitch. You should hear the sound change and see the sliders move in WAP.
The html side of the connection is done in js/socketsOSC.js
look at the function: connectOSC() – which gets triggered by the OSC button in index.html
Incoming messages from Max (via Ruby server) are parsed in parseOSCMessage() which figures out how to set appropriate values for the audio objects in the DOM.
There are currently no acknowledgement or error messages being returned (at least I don’t remember doing this)
This is a tweak of a demo program by Boris Smus from http://webaudioapi.com
The audio is generated in the web browser using the webaudio API. Oscillator frequency is being controlled by an iPod touch running touchOSC.
A ruby program is running in the background. It starts 2 servers, one to handle Osc messages from the iPod. and a websockets server which passes Osc messages to the web client in the browser, which parses the data and sets oscillator frequency.
local source files in tkzic/web-audio-api/webaudioapi/content/posts/oscillator-ws
(these are for my local files – source has not been published yet) Please contact me directly for more information about this code. Or have a look at a very similar example at: https://github.com/tkzic/WebAudio
1. run the node webserver in tkzic/
node nodeserver.js
(it will run on localhost port 8081 – for example http://127.0.0.1:8081)
2. In Chrome web browser, run: http://192.168.1.104:8081/web-audio-api/webaudioapi/content/posts/oscillator-ws/index.html
The following screen will appear:
3. From a terminal prompt run this ruby script (in tkzic/web-audio-api/webaudioapi/content/posts/oscillator-ws)
./wapOSCserver.rb
4. In webpage in Chrome, click the sockets button – the ruby server should open a socket connection, also click the play/pause button to start the oscillator
5. In touchOSC point the host to the ip address of the laptop (ie., 192.168.1.104) running on default ports, (out 8000, in 9000)
6. In touchOSC run the ‘simple’ layout and move fader1 to change the pitch of the oscillator
Note: You will probably also want to open the developer javascript console in Chrome to see what is going on.
Need to clean up the ruby server code to handle error conditions, ie., network interruptions, missing files, browser incompatibility, etc.,
With full source code examples.
By Boris Smus at HTML5 Rocks
http://www.html5rocks.com/en/tutorials/webaudio/intro/
update 5/2014
To get full source with comments, make a URL in this format – (the buttons on the tutorial page only gives minified JS)
http://www.html5rocks.com/en/tutorials/webaudio/intro/js/rhythm-sample.js?ModPagespeed=off
Here’s a note about it: https://github.com/html5rocks/www.html5rocks.com/issues/367
To get the source for the UI – ie., buttons and sliders – just view the page source for the tutorial
Scheduling Web Audio
http://www.html5rocks.com/en/tutorials/audio/scheduling/
JAM with chrome case study
http://www.html5rocks.com/en/tutorials/casestudies/jamwithchrome-audio/
http://www.html5rocks.com/en/tutorials/casestudies/technitone/
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.