1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
|
OSC control of Sonic Visualiser
===============================
Sonic Visualiser can be controlled remotely using the Open Sound
Control protocol. This facility requires Steve Harris's liblo (Lite
OSC) library to have been available when Sonic Visualiser was built.
Sonic Visualiser opens a single OSC port on startup. The URL of this
port is printed to standard output on startup, or can be read from the
About box on the Help menu.
OSC commands accepted by Sonic Visualiser take the form:
<scheme>://<host>:<port>/<method> [<arg> ...]
For example, "osc.udp://localhost:12654/play 2.0" will play the
current session from time 2.0 seconds.
Methods that manipulate panes or layers act on the currently selected
pane or layer. Use the setcurrent method to choose the right target
for subsequent such methods.
If you need an OSC client, there is a small program in the svcore
library at
svcore/data/osc/sv-osc-send.c
that sends an OSC method and arguments to a given URL -- this is not
specific to SV but will work with it. To compile that program you
should only have to run
$ gcc sv-osc-send.c -o sv-osc-send -llo
provided you have liblo installed.
Then there is a small shell script in the same directory, called
sv-command, that provides a basic command shell for Sonic Visualiser.
Start SV first, then sv-command should find its OSC port from the
system process table when you start it.
For example:
$ PATH=.:$PATH ./sv-command # Set PATH so it can find sv-osc-send
/open snare_hex.wav
/add spectrogram
/set layer Colour Sunset
/play
/quit
$
OSC methods available
=====================
Main window methods
-------------------
/open <filename>
Open a new file (of type determined by Sonic Visualiser).
If it is an audio file, use it to replace the existing main
audio file (if any).
/openadditional <filename>
Open a new file. If it is an audio file, open it in a new
pane in addition to the existing audio file (if any).
/recent <n>
/last
Open the <n>'th most recent file from the Recent Files menu,
counting from 1 for the most recent file opened. "last" is a
synonym for "recent 1".
/save <filename>
Save the current session in <filename> as an SV session file.
This action will try to fail rather than overwrite an existing
file, but you probably shouldn't rely on that.
/export <filename>
Export the (first) selected area of the main audio file
(or all of it, if there is no selection) in <filename>, as a
WAV file. This action will try to fail rather than overwrite
an existing file, but you probably shouldn't rely on that.
/jump <t>
/jump end
/jump selection
Jump the playback position to time <t> (in seconds); or to
the end of the file; or to the start of the current selection.
/play
/play <t>
/play selection
Start playback. If a time <t> is given, start from that time
in seconds. If the word "selection" is given instead, play
the current selection.
/stop
Stop playback.
/loop on
/loop off
Switch playback loop mode on or off.
/select <t0> <t1>
/select all
/select none
Select the region from times <t0> to <t1> in seconds; or select
the whole file; or clear the selection. If there is a layer
selected that can be used as a snap guide for the selection, then
the selection will be snapped to it (in the same manner as when
making selections interactively).
/addselect <t0> <t1>
Make an additional selection (leaving any existing selection
in place) from times <t0> to <t1> in seconds.
/undo
/redo
Undo the last editing operation; redo the last undone operation.
Note that most of the classic editing operations (copy and paste
etc) are not controllable via OSC, but undo may still be useful
because Sonic Visualiser considers actions such as adding a pane
to be undoable editing operations as well.
/add <layertype>
/add <layertype> <channel>
Add a new pane containing a layer of the given type, based on
the main audio file. If no <channel> is specified, use all
available channels. Useful <layertype>s are:
waveform
spectrogram
spectrum
timeruler
The following <layertype>s are less useful, because they create
empty layers which there is currently no OSC support for editing:
timeinstants
timevalues
notes
text
colour3dplot
/set <control> <value>
/set pane <control> <value>
/set layer <control> <value>
Set a main window control; a property of the current pane; or a
property of the current layer.
Accepted main window <control>s are:
gain
whose values are linear multipliers (i.e. 1.0 == unity gain).
speedup
takes a value of a percentage increase in playback
speed, so 0 is the default playback speed, 100 sets double
the default speed, and -100 sets half the default speed
(yes, I know, it's nonsense, sorry).
overlays
controls the verbosity level of the text overlays on
each pane, from 0 (everything off) to 2 (everything on).
zoomwheels
controls whether the zoom wheels are displayed (1) or not (0).
propertyboxes
controls whether the property boxes are displayed (1) or not (0).
For pane and layer properties, the control name is the displayed
name of the given property (though you may use "-" or "_" in place
of any spaces in the name if it's easier for you). The value may
be the displayed value or underlying integer for the property.
Some examples:
/set pane Global-Scroll off
/set pane Follow_Playback Scroll
/set layer Colour Blue
/set layer Scale-Units dB
/set layer Frequency-Scale Log
Note that while you can use "-" or "_" in place of spaces in the
property name, you cannot currently do so in the value text. If
this is a problem for you, you might be able to set the value
as an integer instead (all layer properties can be set this way).
/setcurrent <pane>
/setcurrent <pane> <layer>
Make the given <pane> (a number counting from 1 for the topmost
pane) and optionally the given <layer> on that pane (a number
counting from 1 for the "frontmost" layer) the current pane and
layer for subsequent pane and layer operations.
/delete pane
/delete layer
Delete the current pane or layer.
/zoom <level>
/zoom in
/zoom out
/zoom default
Zoom to a given zoom <level>, given in audio sample frames per
pixel; or zoom in or out one step from the current level; or
return to the default zoom level. This method acts on the
current pane (it only affects all panes if set to Global Zoom,
which is the default).
/zoomvertical <min> <max>
/zoomvertical in
/zoomvertical out
/zoomvertical default
Change the vertical zoom and origin so as to show the value
range from <min> to <max> in the vertical scale; or zoom in or
out vertically; or return to the default vertical zoom level.
The effect of this method is heavily dependent on the current
layer.
/transform <name>
Transform the current main audio file using the named transform.
Transforms are named according to the scheme
type:source:plugin:output
For example, the percussion onset detector from the Vamp example
plugin set can be invoked via
/transform vamp:vamp-example-plugins:percussiononsets:onsets
If the output is omitted, the first is used. Note that you
need to use the plugin and output name, not description: in
this case "percussiononsets" rather than "Simple Percussion
Onset Detector".
There is not yet any way to run a transform via OSC on any but
the main audio file, nor with any but its default parameters,
processing block/step size, or channel selection.
/resize <w> <h>
/resize pane <h>
Resize the main window to width <w> and height <h> (if the
window system permits); resize the current pane to height <h>
if possible (!!! not yet working).
/quit
Exit the program abruptly without saving.
Handy things still missing from the OSC interface include:
* the ability to run transforms with non-default parameters or
starting from different source models
* the ability to add layers to a pane (without transform)
* the ability to add panes (and layers) showing any but the
main model
* the ability to set play parameters on a layer/model and show/hide it
* the ability to set the vertical zoom range (vital for spectrogram)
* the ability to import and export layers
* a working pane resize
* quick shortcuts to Melodic Range Spectrogram, Peak Frequency Spectrogram
* the ability to rename a layer
|