Hi Samuel,
Is it possible to have a source that gets a different processing per "rule" and
"value" when a handler is called, say, by osc.on_string_pair to provide "rule"
and "value". Please point out documentation to read (request.dynamic? ...
concepts I must understand:)
Something looking like:
# Different processing per OSC "rule" and "value"
def rule_handler(rule,value,s)
if (rule == "quiet" then
if (value == "on") then
s = blank(duration=5.)
elsif (value == "off")
s = s
end
elsif (rule == "sine") then
s = sine(#{value})
...
end
end
def on_rule_s1(m) =
rule = fst(m)
value = snd(m)
# Trigger new source for s1?
end
s1 = sine()
s2 = sine()
s1 = rule_handler(?,s1)
s1 = rule_handler(?,s2)
output = add(normalize=false,[s1,s2])
osc.on_string_pair("/s1/rule",on_rule_s1)
osc.on_string_pair("/s2/rule",on_rule_s2)
output.icecast(%mp3,mount="test.mp3",output)
Thanks,
Kyriakos
On Mar 6, 2013, at 8:57 PM, Samuel Mimram wrote:
> Hi,
>
> This is quite an interesting application of OSC! It was not really
> possible to do so, but I just commited a patch on the git (
> 114d1fa908fc9e02547f0de540c11d127d5964cd ) to make it possible. With
> this latest git version you can write the following:
>
> # Replace with music source
> s = sine()
> s = mksafe(s)
>
> # Create a function to insert metadata
> ms = insert_metadata(s)
> # The function to insert metadata
> imeta = fst(ms)
> # The new source
> s = snd(ms)
>
> # Handler for OSC events (gets pairs of strings)
> def on_meta(m) =
> # Extract the label
> label = fst(m)
> # Extract the value
> value = snd(m)
> # A debug message
> print("Insert metadata #{label} = #{value}")
> # Insert the metadata
> imeta([(label,value)])
> end
>
> # Call the above handler when we have a pair of strings on /metadata
> osc.on_string_pair("/metadata",on_meta)
>
> # Output on icecast
> output.icecast(%mp3,mount="test.mp3",s)
>
>
> Then each time I am doing something like:
>
> oscsend localhost 7777 "/metadata" ss "title" "The new title"
>
> I get a new metadata :) You should elaborate on this in order to
> output all the metadata at once, but it should help to get you
> started!
>
> Cheers,
>
> Sam.
>
> On Tue, Mar 5, 2013 at 5:32 PM, Kyriakos Tsoukalas
> <[email protected]> wrote:
>> Hi all,
>> I would like to send OSC messages to a liquidsoap (v1.0.1) server and have
>> it perform specific functions (to a harbor stream) per incoming OSC
>> tags(paths). How would I setup an OSC tag function trigger?
>>
>> Thanks in advance,
>> Kyriakos
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_feb
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users