Forums > MaxMSP

http get – taking samples off a database

November 24, 2009 | 1:06 pm

Hey I am trying to get something together for a college project involving grabbing audio samples off a database. Whats the best way to go about this? Any ideas? XML to send http get?


November 26, 2009 | 10:49 am

Have a look at [jit.uldl], [jit.textfile] and [jit.str.regexp] which can download files from http or ftp. There’s a good example called "parser/downloader" in the latter’s help file which might be of use to you.

lh


November 27, 2009 | 12:37 pm

Cheers for the reply luke, will give that a go.


December 3, 2009 | 5:11 pm

Hey I managed to get this working so I can manually load a file into the buffer after it downloads. Is there a way to get the file name from jit.uldl and then append it to the save directory information so it can be automatically loaded into a browser?


December 3, 2009 | 10:18 pm

I’m not exactly sure what you mean. If you have the sound files in [buffer~]s you could always use [info~] to get the file name. By loading into a browser to you mean uploading a document to your web host from max?

lh


December 8, 2009 | 8:57 pm

the jit.udl object downloads the file to a specified location. Is there a way to get the file name and chosen download location from the udl so I can automatically load it into the buffer, without having to manually load it in??


December 9, 2009 | 12:40 am

If you’re downloading the file with [jit.uldl] I imagine you’re using the "download" message so you can just grab the filename from there. You should be able to do it with [regexp] there’s some good pointers on the forum if you need help with that. There’s an example included below for illustration. The "getdefaultdir" message will output the download location.

lh

– Pasted Max Patch, click to expand. –

December 9, 2009 | 6:24 pm

Thats great cheers, got it now. Thanks a lot!


December 26, 2009 | 2:01 pm

Another question! Is it possible to pull down a list of everything on the database and put it in a table so users can click on entries in the table to download?

Also if each sound on the database is tagged, is it possible to add these tags to the table?

Basically I want to have a table with :

column 1 : sample file name (click on this to load into buffer)
column 2+ : sample attributes (eg source, genre, etc)

Thanks a lot for the help!!


December 26, 2009 | 3:17 pm

That would depend entirely on how your database is organised. Is it a proper SQL database, a list of links in an HTML document or something else entirely? It probably isn’t impossible but it’s difficult to make suggestions without knowing a bit more. You might want to look at [jit.cellblock] for creating a table in max. The extra columns could be done if the information is stored in the database, not entirely sure how you’d go about if you want to read ID3 tags from the files themselves.

lh


December 27, 2009 | 1:04 pm

Sorry, was a bit braindead when I posted there! Yep its going to be a proper SQL database. I’m gonna include tags on the database with the files as opposed to using ID3 tags (although is this a possible alternative?).

I will check out jit.cellblock, still getting my head ’round jitter after coming from vvvv!

Thanks a lot for all your help, much appreciated!


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