Chris@404: Chris@404: OSC control of Sonic Visualiser Chris@404: =============================== Chris@404: Chris@404: Sonic Visualiser can be controlled remotely using the Open Sound Chris@404: Control protocol. This facility requires Steve Harris's liblo (Lite Chris@404: OSC) library to have been available when Sonic Visualiser was built. Chris@404: Chris@404: Sonic Visualiser opens a single OSC port on startup. The URL of this Chris@404: port is printed to standard output on startup, or can be read from the Chris@404: About box on the Help menu. Chris@404: Chris@404: OSC commands accepted by Sonic Visualiser take the form: Chris@404: Chris@404: ://:/ [ ...] Chris@404: Chris@404: For example, "osc.udp://localhost:12654/play 2.0" will play the Chris@404: current session from time 2.0 seconds. Chris@404: Chris@404: Methods that manipulate panes or layers act on the currently selected Chris@404: pane or layer. Use the setcurrent method to choose the right target Chris@404: for subsequent such methods. Chris@404: Chris@495: If you need an OSC client, there is a small program in the svcore Chris@495: library at Chris@495: Chris@495: svcore/data/osc/sv-osc-send.c Chris@495: Chris@495: that sends an OSC method and arguments to a given URL -- this is not Chris@495: specific to SV but will work with it. To compile that program you Chris@495: should only have to run Chris@495: Chris@495: $ gcc sv-osc-send.c -o sv-osc-send -llo Chris@495: Chris@495: provided you have liblo installed. Chris@495: Chris@495: Then there is a small shell script in the same directory, called Chris@495: sv-command, that provides a basic command shell for Sonic Visualiser. Chris@495: Start SV first, then sv-command should find its OSC port from the Chris@495: system process table when you start it. Chris@495: For example: Chris@495: Chris@495: $ PATH=.:$PATH ./sv-command # Set PATH so it can find sv-osc-send Chris@495: /open snare_hex.wav Chris@495: /add spectrogram Chris@495: /set layer Colour Sunset Chris@495: /play Chris@495: /quit Chris@495: $ Chris@404: Chris@404: Chris@404: OSC methods available Chris@404: ===================== Chris@404: Chris@404: Main window methods Chris@404: ------------------- Chris@404: Chris@404: /open Chris@404: Chris@404: Open a new file (of type determined by Sonic Visualiser). Chris@404: If it is an audio file, use it to replace the existing main Chris@404: audio file (if any). Chris@404: Chris@404: /openadditional Chris@404: Chris@404: Open a new file. If it is an audio file, open it in a new Chris@404: pane in addition to the existing audio file (if any). Chris@404: Chris@404: /recent Chris@404: /last Chris@404: Chris@404: Open the 'th most recent file from the Recent Files menu, Chris@404: counting from 1 for the most recent file opened. "last" is a Chris@404: synonym for "recent 1". Chris@404: Chris@404: /save Chris@404: Chris@404: Save the current session in as an SV session file. Chris@404: This action will try to fail rather than overwrite an existing Chris@404: file, but you probably shouldn't rely on that. Chris@404: Chris@404: /export Chris@404: Chris@404: Export the (first) selected area of the main audio file Chris@404: (or all of it, if there is no selection) in , as a Chris@404: WAV file. This action will try to fail rather than overwrite Chris@404: an existing file, but you probably shouldn't rely on that. Chris@404: Chris@2242: /exportlayer Chris@2242: Chris@2242: Export the current layer to a file, of type determined from the Chris@2242: file's suffix. See /setcurrent for how to change which layer is Chris@2242: current. This action will try to fail rather than overwrite an Chris@2242: existing file, but you probably shouldn't rely on that. Chris@2242: Chris@404: /jump Chris@404: /jump end Chris@404: /jump selection Chris@404: Chris@404: Jump the playback position to time (in seconds); or to Chris@404: the end of the file; or to the start of the current selection. Chris@404: Chris@404: /play Chris@404: /play Chris@404: /play selection Chris@404: Chris@404: Start playback. If a time is given, start from that time Chris@404: in seconds. If the word "selection" is given instead, play Chris@404: the current selection. Chris@404: Chris@404: /stop Chris@404: Chris@404: Stop playback. Chris@404: Chris@404: /loop on Chris@404: /loop off Chris@404: Chris@404: Switch playback loop mode on or off. Chris@404: Chris@404: /select Chris@404: /select all Chris@404: /select none Chris@404: Chris@404: Select the region from times to in seconds; or select Chris@404: the whole file; or clear the selection. If there is a layer Chris@404: selected that can be used as a snap guide for the selection, then Chris@404: the selection will be snapped to it (in the same manner as when Chris@404: making selections interactively). Chris@404: Chris@404: /addselect Chris@404: Chris@404: Make an additional selection (leaving any existing selection Chris@404: in place) from times to in seconds. Chris@404: Chris@404: /undo Chris@404: /redo Chris@404: Chris@404: Undo the last editing operation; redo the last undone operation. Chris@404: Note that most of the classic editing operations (copy and paste Chris@404: etc) are not controllable via OSC, but undo may still be useful Chris@404: because Sonic Visualiser considers actions such as adding a pane Chris@404: to be undoable editing operations as well. Chris@404: Chris@404: /add Chris@404: /add Chris@404: Chris@404: Add a new pane containing a layer of the given type, based on Chris@404: the main audio file. If no is specified, use all Chris@404: available channels. Useful s are: Chris@404: Chris@404: waveform Chris@404: spectrogram Chris@404: spectrum Chris@404: timeruler Chris@404: Chris@404: The following s are less useful, because they create Chris@404: empty layers which there is currently no OSC support for editing: Chris@404: Chris@404: timeinstants Chris@404: timevalues Chris@404: notes Chris@404: text Chris@404: colour3dplot Chris@404: Chris@404: /set Chris@404: /set pane Chris@404: /set layer Chris@404: Chris@404: Set a main window control; a property of the current pane; or a Chris@404: property of the current layer. Chris@404: Chris@404: Accepted main window s are: Chris@404: Chris@404: gain Chris@404: whose values are linear multipliers (i.e. 1.0 == unity gain). Chris@404: Chris@1617: speed Chris@1617: takes a value of a percentage change in playback Chris@1617: speed, so 100 is the default playback speed, 200 sets Chris@1617: double the default speed, and 50 sets half the default. Chris@404: Chris@404: overlays Chris@404: controls the verbosity level of the text overlays on Chris@404: each pane, from 0 (everything off) to 2 (everything on). Chris@404: Chris@404: zoomwheels Chris@404: controls whether the zoom wheels are displayed (1) or not (0). Chris@404: Chris@404: propertyboxes Chris@404: controls whether the property boxes are displayed (1) or not (0). Chris@404: Chris@404: For pane and layer properties, the control name is the displayed Chris@404: name of the given property (though you may use "-" or "_" in place Chris@404: of any spaces in the name if it's easier for you). The value may Chris@404: be the displayed value or underlying integer for the property. Chris@404: Chris@404: Some examples: Chris@404: Chris@404: /set pane Global-Scroll off Chris@404: /set pane Follow_Playback Scroll Chris@404: /set layer Colour Blue Chris@404: /set layer Scale-Units dB Chris@404: /set layer Frequency-Scale Log Chris@404: Chris@404: Note that while you can use "-" or "_" in place of spaces in the Chris@404: property name, you cannot currently do so in the value text. If Chris@404: this is a problem for you, you might be able to set the value Chris@404: as an integer instead (all layer properties can be set this way). Chris@404: Chris@404: /setcurrent Chris@404: /setcurrent Chris@404: Chris@404: Make the given (a number counting from 1 for the topmost Chris@404: pane) and optionally the given on that pane (a number Chris@404: counting from 1 for the "frontmost" layer) the current pane and Chris@404: layer for subsequent pane and layer operations. Chris@404: Chris@404: /delete pane Chris@404: /delete layer Chris@404: Chris@404: Delete the current pane or layer. Chris@404: Chris@404: /zoom Chris@404: /zoom in Chris@404: /zoom out Chris@404: /zoom default Chris@404: Chris@404: Zoom to a given zoom , given in audio sample frames per Chris@404: pixel; or zoom in or out one step from the current level; or Chris@404: return to the default zoom level. This method acts on the Chris@404: current pane (it only affects all panes if set to Global Zoom, Chris@404: which is the default). Chris@404: Chris@404: /zoomvertical Chris@404: /zoomvertical in Chris@404: /zoomvertical out Chris@404: /zoomvertical default Chris@404: Chris@404: Change the vertical zoom and origin so as to show the value Chris@404: range from to in the vertical scale; or zoom in or Chris@404: out vertically; or return to the default vertical zoom level. Chris@404: The effect of this method is heavily dependent on the current Chris@404: layer. Chris@404: Chris@404: /transform Chris@404: Chris@404: Transform the current main audio file using the named transform. Chris@404: Transforms are named according to the scheme Chris@404: Chris@404: type:source:plugin:output Chris@404: Chris@404: For example, the percussion onset detector from the Vamp example Chris@404: plugin set can be invoked via Chris@404: Chris@404: /transform vamp:vamp-example-plugins:percussiononsets:onsets Chris@404: Chris@404: If the output is omitted, the first is used. Note that you Chris@404: need to use the plugin and output name, not description: in Chris@404: this case "percussiononsets" rather than "Simple Percussion Chris@404: Onset Detector". Chris@404: Chris@404: There is not yet any way to run a transform via OSC on any but Chris@404: the main audio file, nor with any but its default parameters, Chris@404: processing block/step size, or channel selection. Chris@404: Chris@404: /resize Chris@404: /resize pane Chris@404: Chris@404: Resize the main window to width and height (if the Chris@404: window system permits); resize the current pane to height Chris@404: if possible (!!! not yet working). Chris@404: Chris@404: /quit Chris@404: Chris@404: Exit the program abruptly without saving. Chris@404: Chris@404: Handy things still missing from the OSC interface include: Chris@404: Chris@404: * the ability to run transforms with non-default parameters or Chris@404: starting from different source models Chris@404: * the ability to add layers to a pane (without transform) Chris@404: * the ability to add panes (and layers) showing any but the Chris@404: main model Chris@404: * the ability to set play parameters on a layer/model and show/hide it Chris@404: * the ability to set the vertical zoom range (vital for spectrogram) Chris@404: * the ability to import and export layers Chris@404: * a working pane resize Chris@404: * quick shortcuts to Melodic Range Spectrogram, Peak Frequency Spectrogram Chris@404: * the ability to rename a layer Chris@404: Chris@404: