Hi,
The proper way to achieve this is to use osc.on_float which will call
a function each time an event is received. For instance, to implement
the mute button, we should call a function which will either backup
the current volume and set the volume to zero, or restore the old
volume. So, it can be implemented as follows:
# Where the old volume will be stored
vol1_old = ref 1.
# Implement the mute button
osc.on_float("/1/mute1", fun (x) -> if x == 1.0 then vol1_old :=
!vol1; vol1 := 0. else vol1 := !vol1_old end)
The solo button can be implemented in a simlar fashion (but you have
to backup the volume of all the tracks excepting the current one).
Currently there is no way to send OSC messages, but I have filed a bug
report so that I think of adding support for this soon... :
https://github.com/savonet/liquidsoap/issues/95
Cheers,
Samuel.
On Wed, Jul 31, 2013 at 4:29 PM, Ashworth Payne
<[email protected]> wrote:
> Hello list,
>
> I'm working on a mixer in TouchOSC and have had a little success. I can
> change volume on two sources, as well as pan them in the stereo field.
> Cool.
>
> Where I'm stuck is in implementing Mute and Solo buttons. I'm probably
> going about it in a screwy manner as I'm not a programmer. Some guidance
> would be greatly appreciated.
>
> Oh yeah, before giving over my (terrible code) and error messages: can I
> write data back to TouchOSC from Liquid Soap? Thanks in advance.
>
> Error message from console:
> At line 43, char 15-30:
> this value has type
> ()->float
> but it should be a subtype of
> something that is an orderable type
>
> # The volume for each source
> vol1 = ref 1.
> vol2 = ref 1.
>
> # Amplify sources according to their volume
> s1 = amplify({!vol1},s1)
> s2 = amplify({!vol2},s2)
> # Pan sources
> s1 = stereo.pan(pan=(osc.float("/1/rotary1",0.000)),field=90.,s1)
> s2 = stereo.pan(pan=(osc.float("/1/rotary2",0.000)),field=90.,s2)
>
> vol1 =
> if osc.float("/1/solo2",0.0) == "1.0" <line 43
> then
> vol1 := 0
> elsif
> osc.float("/1/mute1",0.0) == "1.0"
> then
> vol1 := 0
> else
> vol1 := osc.float("/1/fader7",0.500)
> end
>
> vol2 =
> Similar to vol1 but with a few logical changes
> end
>
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users