Re: Jack vu-meter to OSC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/07/2014 10:57 PM, michael noble wrote:
> On Fri, Mar 7, 2014 at 7:39 PM, Robin Gareus <robin@xxxxxxxxxx> wrote:
> 
>> PS. I think Ardour3 can provide meter-info per route via OSC.
> 
> 
> How could one go about verifying this? It's something I'd like to take
> advantage of if it's possible.
> 

read the source? or just try it :)

I was wrong. You can subscribe to receive async messages for the gain
fader, but not signal-level (in Ardour3.5.357). Adding support to ardour
to send meter-level notifications isnt't very hard, though.

Find a very simple script to exercise Ardour's OSC interface attached.

best,
robin

#!/usr/bin/env python

# Exercise Ardour3's Open Sound Control Interface
# Edit > Preferences > Control Surfaces > Enable Open Sound Control
# http://manual.ardour.org/using-control-surfaces/controlling-ardour-with-osc/

import liblo, sys

## Ardour's default OSC control port
try:
  target = liblo.Address(3819)
except liblo.AddressError, err:
  print str(err)
  sys.exit()

## by default ardour 'replies' to messages to the host+port
## where they came from, hence we set up a sever and only
## send OSC messages using the server's port.
try:
  server = liblo.ServerThread(9988)
except liblo.ServerError, err:
  print str(err)
  sys.exit()

## OSC server callback, called for messages sent by Ardour
def test_callback(path, args, types, src):
  # TODO don't print things here, just store data in array.
   print "message '%s' from '%s'" % (path, src.get_url())
   for a, t in zip(args, types):
     print "argument of type '%s': '%s'" % (t, a)

## 'catch all' messages by ardour.
server.add_method(None, None, test_callback)
server.start()

##################### ALL SYSTEMS GO #####################

## 'request a list of all tracks&busses (aka route) from ardour
server.send(target, "/routes/list")

## ask ardour to send regular updates for routes 1-3
## particularly level-fader
## (disabled since it clutters up the output)
#server.send(target, "/routes/listen",  1, 2, 3)

## Wait for User Input
def userinput():
  c = raw_input('A3> ')
  return c

while True:
  c = userinput() 
  if c == "p":
    server.send(target, "/ardour/transport_play")
  elif c == "s":
    server.send(target, "/ardour/transport_stop")
  elif c == "tr":
    t = raw_input('track ? ')
    l = raw_input('level ? ')
    server.send(target, "/ardour/routes/gaindB", ('i', t), ('f', l))
  elif c == "about":
    server.send(target, "/ardour/access_action", ('s', 'Window/toggle-about'))
  elif c == "mbr":
    server.send(target, "/ardour/access_action", ('s', 'Common/toggle-meterbridge'))
  elif c == "":
    break

## unsubscribe from updates
#server.send(target, "/routes/ignore", 1, 2, 3)
server.stop()
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user

[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux