maandag 19 oktober 2015

Week 3: Max Patch OSC Routing & Db conversion

This week we made a lot of progress yet again. However more so on the area of working together with the java-based web UI. One of these subjects included routing all the OSC messages correctly as part of our full working prototype. And contrary to previous versions, with the option of setting the value of every parameter on the web-client, not in max7.

The OSC messages are structured in a way so we can process them correctly. This takes the following form from root to branch:

/Messagetype PluginName ModuleName State Value

for example this results in OSC messages such as the following:

/Transport Playing Value
/ioSettings Channel Value

An message setting the compressor threshold to -10db would look like this:
/plugincontrol compressor threshold 1 -10db

You can see a screenshot here of our OSC routing in Max 7:


Another part that was not yet implemented was conversion from Db to lineair floating numbers. We added the option of sending values from OSC so we no longer need to premeditate the desired values in Max 7. Basically we just send the values from the web and let our Max 7 be the slave. However since code not automatically works with logarithmic values like decibel. The math to convert from floats to logarithmic decibel works like this:

Db to Float:
f(y) = 10^(x/20)

Float to Db:
f(y) = log(x) * 20

This is achieved in max in a simple Expr object, creating a mathematical function:




Geen opmerkingen:

Een reactie posten