Extracting Stock Price with StockWatch

Nov 8, 2011 at 2:08pm

Extracting Stock Price with StockWatch

Hi everyone,

I’m very new to Max/MSP and am currently trying to use it to sonify stock prices using stockwatch for a university project. I feel I have just about got my head around the stockwatch.maxhelp example but I am really struggling to figure out how to extract just the stock prices from the various components of the stockwatch readout. My hope is to take perhaps five stock prices that are changing in realtime and adjust the frequencies of different correlating buffers.

I realise there are a number of posts asking for help with stockwatch already on the forums but I get the impression most people asking are already far more competent with Max than I am, and any help at all would be greatly appreciated !

#59866
Nov 8, 2011 at 8:22pm

I have not looked at that example but I would think that the information could easily be extracted through judicious use of regular expressions, which are available through the [regexp] object.

I’m curious however as what sound parameters you are going to control based on stock data and if you’re planning to use any second order modulations?

#215503
Nov 8, 2011 at 10:59pm

You shouldn’t even need to do that, you can just [unpack] or [zl nth] the items from the list that the [mxj] object spits out. The prices seem to be formatted as strings so you might need to use [fromsymbol] too. Post what you have already and if anything specific is holding you back we’ll be able to offer some better advice.

#215504
Nov 9, 2011 at 2:13am

Wow – thank you guys for your swift responses !

At the moment I am just using the stockwatch.maxhelp example exactly as it is provided. Taking your advice, I attached a [fromsymbol] to the first output of the [mxj StockWatch] and then the [unpack] to the [fromsymbol], but none of the numbers attached to the [unpack] are changing – they remain fixed at 0, which I can only assume means I have done something wrong. When using unpack is there any specific argument I need to use, at present I have just been using something like [unpack i i i i i] but perhaps this is too simplistic (I really am horribly new to Max).

Also – using this method, is there any way to separate the stock price of multiple stocks ? At the moment I am just testing this unpack method with a single stock, but would there be a way of tracking the stock prices of multiple stocks simultaneously ? Basically, I’m hoping to end up with something similar to: http://www.youtube.com/watch?v=ihwmlP42K5A … but I can’t for the life of me see what he has done – it all looks extremely complex !

Really do appreciate your help and your swift responses – thanks a million.

#215505
Nov 9, 2011 at 6:21am

Given the ‘microtonal fluctuations’ in the stock exhange prices, I think you should use float rather than int. You should post your patch in compressed format when you’ve gone further.

#215506
Nov 9, 2011 at 12:44pm

In my opinion it is impossible to infer anything useful from the audio of that example.

If you don’t mind my making a suggestion, consider using characteristics other than the pitch to indicate change. For a simple example, consider assigning a non-changing pitch to each stock symbol and then change the value of an applied cutoff filter based on the current value of the stock. If you pick the right pitches, you will find that you can listen to quite a few stock prices simultaneously AND tell what they’re doing (same reason it’s possible to listen to multiple singers in an opera all singing different words).

Other kinds of things to do include attaching an LFO to that filter (or to the pitch for gentle vibrato) and then adjusting the rate of the LFO as a function of a characteristic of a stock in which you are interested. Modulating volume, stereo position and even reverb works very well also and you can do a number of them simultaneously.

#215507

You must be logged in to reply to this topic.