Forums > MaxMSP

Random input.

July 14, 2008 | 10:37 pm

Right, so I’m wondering if it’s possible to gather information from another source and collate this information within Max.

For instance if I wanted to create a number based on the moon phase, tidal patterns, weather or something, how would/could I get this data into Max? I guess the first port of call would be to make a custom C object, but what programs (for Mac OSX) do I need to achieve this? Could I extract this data from a dashboard widget or would the security (or otherwise) of OSX prevent me from doing this? At the end of the day, all I need is a string of data that changes over time and is linked to force of nature (to which I will numerically convert in Max).

Any help would be appreciated if I’ve explained myself clearly enough!


July 14, 2008 | 11:01 pm

I’m sure you could either include a data file that would map this for
you or contact a server via http and scrape the result.

_Mark

On Jul 14, 2008, at 3:37 PM, Chris wrote:

>
> Right, so I’m wondering if it’s possible to gather information from
> another source and collate this information within Max.
>
> For instance if I wanted to create a number based on the moon phase,
> tidal patterns, weather or something, how would/could I get this
> data into Max? I guess the first port of call would be to make a
> custom C object, but what programs (for Mac OSX) do I need to
> achieve this? Could I extract this data from a dashboard widget or
> would the security (or otherwise) of OSX prevent me from doing this?
> At the end of the day, all I need is a string of data that changes
> over time and is linked to force of nature (to which I will
> numerically convert in Max).
>
> Any help would be appreciated if I’ve explained myself clearly enough!


July 15, 2008 | 12:01 am

Quote: chaostheory wrote on Mon, 14 July 2008 15:37
—————————————————-
> For instance if I wanted to create a number based on the moon phase, tidal patterns, weather or something, how would/could I get this data into Max?

I think your options are:

1. Use a standalone application that can grab the data from the ‘Net and dump it out in a file. Then convert that file format to a format Max understands, using a custom object or javascript. The [coll] object is good for storing data in Max and has an easy format to work with, so that’s probably where you’ll want the data to end up. You’ll want to automate the standalone program to regularly dump out data so Max can read in the file periodically. Maybe you can use some automation software, or if it’s a command line program you could call it from the [shell] object (search maxobjects.com for shell)

2. Write a custom C or Java object that grabs the data directly from the ‘Net. This could be easy or hard depending on where you are grabbing the data. Some sites might provide a feed (RSS or something similar), which should be easy to deal with. There should be open source libraries that can handle the feed format. Worst case you would need to grab the raw HTML and extract the desired data. Regular expressions will help achieve this, or an html parser but that’s probably overkill.

3. Find an open source program (probably Java), that does option 2 for you. Then make your own custom object to wrap that one. I’d look around sourceforge or google code.

If I was doing this, I would use my ajm.ruby object, but unless you are a Ruby programmer I don’t think there’s a reason to go there…

As far as what programs to actually use, or what websites to query, I couldn’t say. Maybe some government site like NOAA or USGS. A while back someone was asking about how to work with a program called JTides, which gets tidal info, but it didn’t seem like the easiest route (see http://tinyurl.com/5629cg). So do some research, maybe you’ll find something that’s straightforward and easy to use.

> Could I extract this data from a dashboard widget or would the security (or otherwise) of OSX prevent me from doing this?

If a dashboard widget can dump out the data to a file, that’s option 1. Otherwise, not sure how this would work.

Sorry I don’t have more specifics. Hope this helps.


July 17, 2008 | 4:17 pm

Thank you both for your input as it has certainly given me some direction!

I managed to find the SDK (although for Max 4.5 so I hope it works with 5.02). However, I have also been pointed in the direction of jit.uldl so this may also be an avenue I can explore.


July 17, 2008 | 5:57 pm

Quote: chaostheory wrote on Thu, 17 July 2008 18:17
—————————————————-
> I managed to find the SDK (although for Max 4.5 so I hope it works with 5.02).
—————————————————-

Mostly.

For a beginner there should probably be no problems. There are some exotic/advanced/obscure things that don’t work any more. Of course, for those of us using these things, they don’t seem exotic/advanced/obscure.

A list of known issues is at < http://www.cycling74.com/forums/index.php?t=msg&rid=0&S=8eecc48dde031a3654e68bcbd271bcb1&th=33065&goto=138609#msg_138629>


Viewing 5 posts - 1 through 5 (of 5 total)