Coder Social home page Coder Social logo

abletonosc's Introduction

AbletonOSC: Control Ableton Live 11 with OSC

stability-beta

AbletonOSC is a MIDI remote script that provides an Open Sound Control (OSC) interface to control Ableton Live 11. Building on ideas from the older LiveOSC scripts, its aim is to expose the entire Live Object Model API (full API docs), providing comprehensive control over Live's control interfaces using the same naming structure and object hierarchy as LOM.

NOTE: Since 2022-12-17, all getters have been modified to return the ID of the object being queried as well as the return value, for consistency with listeners. For example, /live/clip/get/name will return track_id, clip_id, name.

Installation

AbletonOSC requires Ableton Live 11 or above, and does not support earlier versions.

To install the script:

  • Download a zip of this repository, unzip its contents, and rename AbletonOSC-master to AbletonOSC
  • Install it following the instructions on Ableton's Installing third-party remote scripts doc, by copying the AbletonOSC folder to:
    • Windows: \Users\[username]\Documents\Ableton\User Library\Remote Scripts
    • macOS: Macintosh HD/Users/[username]/Music/Ableton/User Library/Remote Scripts
  • Restart Live
  • In Preferences > Link / Tempo / MIDI, under the Control Surface dropdown, select the new "AbletonOSC" option. Live should display a message saying "AbletonOSC: Listening for OSC on port 11000"

Activity logs will be output to a logs subdirectory. Logging granularity can be controlled with /live/api/set/log_level (see Application API below).

Usage

AbletonOSC listens for OSC messages on port 11000, and sends replies on port 11001. Replies will be sent to the same IP as the originating message. When querying properties, OSC wildcard patterns can be used; for example, /live/clip/get/* 0 0 will query all the properties of track 0, clip 0.

Application API

Documentation: Application API
Address Query params Response params Description
/live/test 'ok' Display a confirmation message in Live, and sends an OSC reply to /live/test
/live/application/get/version major_version, minor_version Query Live's version
/live/api/reload Initiates a live reload of the AbletonOSC server code. Used in development only.
/live/api/get/log_level log_level Returns the current log level. Default is info.
/live/api/set/log_level log_level Set the log level, which can be one of: debug, info, warning, error, critical.

Application status messages

These messages are sent to the client automatically when the application state changes.

Address Response params Description
/live/startup Sent to the client application when AbletonOSC is started
/live/error error_msg Sent to the client application when an error occurs. For more diagnostics, see logs/abletonosc.log

Song API

Represents the top-level Song object. Used to start/stop playback, create/modify scenes, create/jump to cue points, and set global parameters (tempo, metronome).

Documentation: Song API

Song methods

Address Query params Response params Description
/live/song/capture_midi Capture midi
/live/song/continue_playing Resume session playback
/live/song/create_audio_track index Create a new audio track at the specified index (-1 = end of list)
/live/song/create_midi_track index Create a new MIDI track at the specified index (-1 = end of list)
/live/song/create_return_track Create a new return track
/live/song/create_scene index Create a new scene at the specified index (-1 = end of list)
/live/song/cue_point/jump cue_point Jump to a specific cue point, by name or numeric index (based on the list of cue points)
/live/song/delete_scene scene_index Delete a scene
/live/song/delete_return_track track_index Delete a return track
/live/song/delete_track track_index Delete a track
/live/song/duplicate_scene scene_index Duplicate a scene
/live/song/duplicate_track track_index Duplicate a track
/live/song/jump_by time Jump song position by the specified time, in beats
/live/song/jump_to_next_cue Jump to the next cue marker
/live/song/jump_to_prev_cue Jump to the previous cue marker
/live/song/redo Redo the last undone operation
/live/song/start_playing Start session playback
/live/song/stop_playing Stop session playback
/live/song/stop_all_clips Stop all clips from playing
/live/song/tap_tempo Mimics a tap of the "Tap Tempo" button
/live/song/trigger_session_record Triggers record in session mode
/live/song/undo Undo the last operation

Song properties

  • Changes to any Track property can be listened for by calling /live/song/start_listen/<property>
  • Responses will be sent to /live/song/get/<property>, with parameters <property_value>
  • For further information on these properties and their parameters, see documentation for Live Object Model - Song.

Getters

Address Query params Response params Description
/live/song/get/arrangement_overdub arrangement_overdub Query whether arrangement overdub is on
/live/song/get/back_to_arranger back_to_arranger Query whether "back to arranger" is lit
/live/song/get/can_redo can_redo Query whether redo is available
/live/song/get/can_undo can_undo Query whether undo is available
/live/song/get/clip_trigger_quantization clip_trigger_quantization Query the current clip trigger quantization level
/live/song/get/current_song_time current_song_time Query the current song time, in beats
/live/song/get/groove_amount groove_amount Query the current groove amount
/live/song/get/is_playing is_playing Query whether the song is currently playing
/live/song/get/loop loop Query whether the song is currently looping
/live/song/get/loop_length loop_length Query the current loop length
/live/song/get/loop_start loop_start Query the current loop start point
/live/song/get/metronome metronome_on Query metronome on/off
/live/song/get/midi_recording_quantization midi_recording_quantization Query the current MIDI recording quantization
/live/song/get/nudge_down nudge_down Query nudge down
/live/song/get/nudge_up nudge_up Query nudge up
/live/song/get/punch_in punch_in Query punch in
/live/song/get/punch_out punch_out Query punch out
/live/song/get/record_mode record_mode Query the current record mode
/live/song/get/session_record session_record Query whether session record is enabled
/live/song/get/signature_denominator denominator Query the current time signature's denominator
/live/song/get/signature_numerator numerator Query the current time signature's numerator
/live/song/get/song_length song_length Query the song arrangement length, in beats
/live/song/get/tempo tempo_bpm Query the current song tempo

Setters

Address Query params Response params Description
/live/song/set/arrangement_overdub arrangement_overdub Set arrangement overdub (1=on, 0=off)
/live/song/set/back_to_arranger back_to_arranger Set whether "back to arranger" is lit (1=on, 0=off)
/live/song/set/clip_trigger_quantization clip_trigger_quantization Set the current clip trigger quantization level
/live/song/set/current_song_time current_song_time Set the current song time, in beats
/live/song/set/groove_amount groove_amount Set the current groove amount
/live/song/set/loop loop Set whether the song is currently looping (1=on, 0=off)
/live/song/set/loop_length loop_length Set the current loop length
/live/song/set/loop_start loop_start Set the current loop start point
/live/song/set/metronome metronome_on Set metronome (1=on, 0=off)
/live/song/set/midi_recording_quantization midi_recording_quantization Set the current MIDI recording quantization
/live/song/set/nudge_down nudge_down Set nudge down
/live/song/set/nudge_up nudge_up Set nudge up
/live/song/set/punch_in punch_in Set punch in
/live/song/set/punch_out punch_out Set punch out
/live/song/set/record_mode record_mode Set the current record mode
/live/song/set/session_record session_record Set whether session record is enabled (1=on, 0=off)
/live/song/set/signature_denominator signature_denominator Set the time signature's denominator
/live/song/set/signature_numerator signature_numerator Set the time signature's numerator
/live/song/set/record_mode record_mode Set the current record mode
/live/song/set/tempo tempo_bpm Set the current song tempo

Song: Properties of cue points, scenes and tracks

Address Query params Response params Description
/live/song/get/cue_points name, time, ... Query a list of the song's cue points
/live/song/get/num_scenes num_scenes Query the number of scenes
/live/song/get/num_tracks num_tracks Query the number of tracks
/live/song/get/track_names [index_min, index_max] Query track names (optionally, over a given range)
/live/song/get/track_data [various] Query bulk properties of multiple tracks/clips. See below for further info.

Querying track/clip data in bulk with /live/song/get/track_data

It is often useful to be able to query data en masse about lots of different tracks and clips -- for example, when a set is first opened, to synchronise the state of your client with the Ableton set. This can be achieved with the /live/song/get/track_data API, which can query user-specified properties of multiple tracks and clips.

Properties must be of the format track.property_name, clip.property_name or clip_slot.property_name.

For example:

/live/song/get/track_data 0 12 track.name clip.name clip.length

Queries tracks 0..11, and returns a long list of values comprising:

[track_0_name, clip_0_0_name,   clip_0_1_name,   ... clip_0_7_name,
               clip_1_0_length, clip_0_1_length, ... clip_0_7_length,
 track_1_name, clip_1_0_name,   clip_1_1_name,   ... clip_1_7_name, ...]

Beat events

To request a status message to be sent to the client on each beat, call /live/song/start_listen/beat. Every beat, a reply will be sent to /live/song/get/beat, with an int parameter containing the current beat number. To stop listening for beat events, call /live/song/stop_listen/beat.


View API

Represents the view (user interface) of live

Documentation: View API
Address Query params Response params Description
/live/view/get/selected_scene scene_index Returns the selected scene index (first scene = 0)
/live/view/get/selected_track track_index Returns the selected index track (first track = 0)
/live/view/get/selected_clip track_index, scene_index Returns the track and scene index of the selected clip
/live/view/get/selected_device track_index, device_index Get the selected device (first device = 0)
/live/view/set/selected_scene scene_index Set the selected scene (first scene = 0)
/live/view/set/selected_track track_index Set the selected track (first track = 0)
/live/view/set/selected_clip track_index, scene_index Set the selected clip
/live/view/set/selected_device track_index, device_index Set the selected device (first device = 0)
/live/view/start_listen/selected_scene selected_scene Start listening to the selected scene (first scene = 0)
/live/view/start_listen/selected_track selected_track Start listening to selected track (first track = 0)
/live/view/stop_listen/selected_scene Stop listening to the selected scene (first scene = 0)
/live/view/stop_listen/selected_track Stop listening to selected track (first track = 0)

Track API

Represents an audio, MIDI, return or master track. Can be used to set track audio parameters (volume, panning, send, mute, solo), listen for the playing clip slot, query devices, etc. Can also be used to query clips in arrangement view.

To query the properties of multiple tracks, see Song: Properties of cue points, scenes and tracks.

Documentation: Track API

Track methods

Address Query params Response params Description
/live/track/stop_all_clips track_id Stop all clips on track

Track properties

  • Changes for any Track property can be listened for by calling /live/track/start_listen/<property> <track_index>
  • Responses will be sent to /live/track/get/<property>, with parameters <track_index> <property_value>

Getters

Address Query params Response params Description
/live/track/get/arm track_id track_id, armed Query whether track is armed
/live/track/get/available_input_routing_channels track_id track_id, channel, ... List input channels (e.g. "1", "2", "1/2", ...)
/live/track/get/available_input_routing_types track_id track_id, type, ... List input routes (e.g. "Ext. In", ...)
/live/track/get/available_output_routing_channels track_id track_id, channel, ... List output channels (e.g. "1", "2", "1/2", ...)
/live/track/get/available_output_routing_types track_id track_id, type, ... List output routes (e.g. "Ext. Out", ...)
/live/track/get/can_be_armed track_id track_id, can_be_armed Query whether track can be armed
/live/track/get/color track_id track_id, color Query track color
/live/track/get/color_index track_id track_id, color_index Query track color index
/live/track/get/current_monitoring_state track_id track_id, state Query current monitoring state (1=on, 0=off)
/live/track/get/fired_slot_index track_id track_id, index Query currently-fired slot
/live/track/get/fold_state track_id track_id, fold_state Query folded state (for groups)
/live/track/get/has_audio_input track_id track_id, has_audio_input Query has_audio_input
/live/track/get/has_audio_output track_id track_id, has_audio_output Query has_audio_output
/live/track/get/has_midi_input track_id track_id, has_midi_input Query has_midi_input
/live/track/get/has_midi_output track_id track_id, has_midi_output Query has_midi_output
/live/track/get/input_routing_channel track_id track_id, channel Query current input routing channel
/live/track/get/input_routing_type track_id track_id, type Query current input routing type
/live/track/get/output_routing_channel track_id track_id, channel Query current output routing channel
/live/track/get/output_meter_left track_id track_id, level Query current output level, left channel
/live/track/get/output_meter_level track_id track_id, level Query current output level, both channels
/live/track/get/output_meter_right track_id track_id, level Query current output level, right channel
/live/track/get/output_routing_type track_id track_id, type Query current output routing type
/live/track/get/is_foldable track_id track_id, is_foldable Query whether track is foldable, i.e. is a group
/live/track/get/is_grouped track_id track_id, is_grouped Query whether track is in a group
/live/track/get/is_visible track_id track_id, is_visible Query whether track is visible (1=on, 0=off)
/live/track/get/mute track_id track_id, mute Query track mute (1=on, 0=off)
/live/track/get/name track_id track_id, name Query track name
/live/track/get/panning track_id track_id, panning Query track panning
/live/track/get/playing_slot_index track_id track_id, index Query currently-playing slot
/live/track/get/send track_id, send_id track_id, send_id, value Query track send
/live/track/get/solo track_id track_id, solo Query track solo on/off
/live/track/get/volume track_id track_id, volume Query track volume

Setters

Address Query params Response params Description
/live/track/set/arm track_id, armed Set track arm state (1=on, 0=off)
/live/track/set/color track_id, color Set track color
/live/track/set/color_index track_id, color_index Set track color index
/live/track/set/current_monitoring_state track_id, state Set monitoring on/off
/live/track/set/fold_state track_id, fold_state Set group folded (1=on, 0=off)
/live/track/set/input_routing_channel track_id, channel Set input routing channel
/live/track/set/input_routing_type track_id, type Set input routing type
/live/track/set/mute track_id, mute Set track mute (1=on, 0=off)
/live/track/set/name track_id, name Set track name
/live/track/set/output_routing_channel track_id, channel Set output routing channel
/live/track/set/output_routing_type track_id, type Set output routing type
/live/track/set/panning track_id, panning Set track panning
/live/track/set/send track_id, send_id, value Set track send
/live/track/set/solo track_id, solo Set track solo (1=on, 0=off)
/live/track/set/volume track_id, volume Set track volume

Track: Properties of multiple clips

Address Query params Response params Description
/live/track/get/clips/name track_id track_id, [name, ....] Query all clip names on track
/live/track/get/clips/length track_id track_id, [length, ...] Query all clip lengths on track
/live/track/get/clips/color track_id track_id, [color, ...] Query all clip colors on track
/live/track/get/arrangement_clips/name track_id track_id, [name, ....] Query all arrangement view clip names on track
/live/track/get/arrangement_clips/length track_id track_id, [length, ...] Query all arrangement view clip lengths on track
/live/track/get/arrangement_clips/start_time track_id track_id, [start_time, ...] Query all arrangement view clip times on track

Track: Properties of devices

Address Query params Response params Description
/live/track/get/num_devices track_id track_id, num_devices Query the number of devices on the track
/live/track/get/devices/name track_id track_id, [name, ...] Query all device names on track
/live/track/get/devices/type track_id track_id, [type, ...] Query all devices types on track
/live/track/get/devices/class_name track_id track_id, [class, ...] Query all device class names on track

See Device API for details on Device type/class_names.


Clip Slot API

A Clip Slot represents a container for a clip. It is used to create and delete clips, and query their existence.

Documentation: Clip Slot API
Address Query params Response params Description
/live/clip_slot/create_clip track_index, clip_index, length Create a clip in the slot
/live/clip_slot/delete_clip track_index, clip_index Delete the clip in the slot
/live/clip_slot/get/has_clip track_index, clip_index track_index, clip_index, has_clip Query whether the slot has a clip
/live/clip_slot/get/has_stop_button track_index, clip_index track_index, clip_index, has_stop_button Query whether the slot has a stop button
/live/clip_slot/set/has_stop_button track_index, clip_index, has_stop_button Add or remove stop button (1=on, 0=off)
/live/clip_slot/duplicate_clip_to track_index, clip_index, target_track_index, target_clip_index Duplicate the clip to an empty target clip slot

Clip API

Represents an audio or MIDI clip. Can be used to start/stop clips, and query/modify their notes, name, gain, pitch, color, playing state/position, etc.

Documentation: Clip API
Address Query params Response params Description
/live/clip/fire track_id, clip_id Start clip playback
/live/clip/stop track_id, clip_id Stop clip playback
/live/clip/duplicate_loop track_id, clip_id Duplicates clip loop
/live/clip/get/notes track_id, clip_id, [start_pitch, pitch_span, start_time, time_span] track_id, clip_id, pitch, start_time, duration, velocity, mute, [pitch, start_time...] Query the notes in a given clip, optionally including a start time/pitch and time/pitch span.
/live/clip/add/notes track_id, clip_id, pitch, start_time, duration, velocity, mute, ... Add new MIDI notes to a clip. pitch is MIDI note index, start_time and duration are beats in floats, velocity is MIDI velocity index, mute is true/false
/live/clip/remove/notes [start_pitch, pitch_span, start_time, time_span] Remove notes from a clip in a range of pitches and times. If no ranges specified, all notes are removed. Note that ordering has changed as of 2023-11.
/live/clip/get/color track_id, clip_id track_id, clip_id, color Get clip color
/live/clip/set/color track_id, clip_id, color Set clip color
/live/clip/get/name track_id, clip_id track_id, clip_id, name Get clip name
/live/clip/set/name track_id, clip_id, name Set clip name
/live/clip/get/gain track_id, clip_id track_id, clip_id, gain Get clip gain
/live/clip/set/gain track_id, clip_id, gain Set clip gain
/live/clip/get/length track_id, clip_id track_id, clip_id, length Get clip length
/live/clip/get/pitch_coarse track_id, clip_id track_id, clip_id, semitones Get clip coarse re-pitch
/live/clip/set/pitch_coarse track_id, clip_id, semitones Set clip coarse re-pitch
/live/clip/get/pitch_fine track_id, clip_id track_id, clip_id, cents Get clip fine re-pitch
/live/clip/set/pitch_fine track_id, clip_id, cents Set clip fine re-pitch
/live/clip/get/file_path track_id, clip_id track_id, clip_id, file_path Get clip file path
/live/clip/get/is_audio_clip track_id, clip_id track_id, clip_id, is_audio_clip Query whether clip is audio
/live/clip/get/is_midi_clip track_id, clip_id track_id, clip_id, is_midi_clip Query whether clip is MIDI
/live/clip/get/is_playing track_id, clip_id track_id, clip_id, is_playing Query whether clip is playing
/live/clip/get/is_recording track_id, clip_id track_id, clip_id, is_recording Query whether clip is recording
/live/clip/get/playing_position track_id, clip_id track_id, clip_id, playing_position Get clip's playing position
/live/clip/start_listen/playing_position track_id, clip_id Start listening for clip's playing position. Replies are sent to /live/clip/get/playing_position, with args: track_id, clip_id, playing_position
/live/clip/stop_listen/playing_position track_id, clip_id Stop listening for clip's playing position.
/live/clip/get/loop_start track_id, clip_id track_id, clip_id, loop_start Get clip's loop start
/live/clip/set/loop_start track_id, clip_id, loop_start Set clip's loop start
/live/clip/get/loop_end track_id, clip_id track_id, clip_id, loop_end Get clip's loop end
/live/clip/set/loop_end track_id, clip_id, loop_end Set clip's loop end
/live/clip/get/warping track_id, clip_id track_id, clip_id, warping Get clip's warp mode
/live/clip/set/warping track_id, clip_id, warping Set clip's warp mode
/live/clip/get/start_marker track_id, clip_id track_id, clip_id, start_marker Get clip's start marker
/live/clip/set/start_marker track_id, clip_id, start_marker Set clip's start marker, expressed in floating-point beats
/live/clip/get/end_marker track_id, clip_id track_id, clip_id, end_marker Get clip's end marker
/live/clip/set/end_marker track_id, clip_id, end_marker Set clip's end marker, expressed in floating-point beats

Device API

Represents an instrument or effect.

  • Changes for any Parameter property can be listened for by calling /live/device/start_listen/parameter/value <track_index> <device index> <parameter_index>
Documentation: Device API
Address Query params Response params Description
/live/device/get/name track_id, device_id track_id, device_id, name Get device name
/live/device/get/class_name track_id, device_id track_id, device_id, class_name Get device class_name
/live/device/get/type track_id, device_id track_id, device_id, type Get device type
/live/device/get/num_parameters track_id, device_id track_id, device_id, num_parameters Get the number of parameters exposed by the device
/live/device/get/parameters/name track_id, device_id track_id, device_id, [name, ...] Get the list of parameter names exposed by the device
/live/device/get/parameters/value track_id, device_id track_id, device_id, [value, ...] Get the device parameter values
/live/device/get/parameters/min track_id, device_id track_id, device_id, [value, ...] Get the device parameter minimum values
/live/device/get/parameters/max track_id, device_id track_id, device_id, [value, ...] Get the device parameter maximum values
/live/device/get/parameters/is_quantized track_id, device_id track_id, device_id, [value, ...] Get the list of is_quantized settings (i.e., whether the parameter must be an int/bool)
/live/device/set/parameters/value track_id, device_id, value, value ... Set the device parameter values
/live/device/get/parameter/value track_id, device_id, parameter_id track_id, device_id, parameter_id, value Get a device parameter value
/live/device/get/parameter/value_string track_id, device_id, parameter_id track_id, device_id, parameter_id, value Get the device parameter value as a readable string ex: 2500 Hz
/live/device/set/parameter/value track_id, device_id, parameter_id, value Set a device parameter value

For devices:

  • name is the human-readable name
  • type is 1 = audio_effect, 2 = instrument, 4 = midi_effect
  • class_name is the Live instrument/effect name, e.g. Operator, Reverb. For external plugins and racks, can be AuPluginDevice, PluginDevice, InstrumentGroupDevice...

Utilities

Included with the framework is a command-line console utility run-console.py, which can be used as a quick and easy way to send OSC queries to AbletonOSC. Example:

(1653)(AbletonOSC)$ ./run-console.py
AbletonOSC command console
Usage: /live/osc/command [params]
>>> /live/song/set/tempo 123.0
>>> /live/song/get/tempo
(123.0,)
>>> /live/song/get/track_names
('1-MIDI', '2-MIDI', '3-Audio', '4-Audio')

Acknowledgements

Thanks to Stu Fisher (and other authors) for LiveOSC, the spiritual predecessor to this library. Thanks to Julien Bayle and NSUSpray for providing XML API docs, based on original work by Hanz Petrov.

For code contributions and feedback, many thanks to:

abletonosc's People

Contributors

axeldelafosse avatar billmoser avatar capturcus avatar ideoforms avatar marcobn avatar markmarijnissen avatar mcparaf avatar steeltrack avatar stevmills avatar strongbearceo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abletonosc's Issues

How to bind to an external device ?

Hi

First of all, thanks for your script, it's awesome.

I'm trying to build an Arduino controller that would be based on this.
I'm wondering how to get the script working with an ip that would not be 127.0.0.1

Let's say my router attributes ip 192.168.1.12 to my controller, how can I let the script know where to send messages ?

I'm pretty n00b with ips and networking, so forgive my ignorance.

Tolerate floats?

Request from lengwenings: Could AbletonOSC tolerate floats as IDs?

TouchOSC scripting has two ways of sending OSC messages - simple and complex.
Simple would be enough for AbletonOSC, but when using the simple way TouchOSC 
auto-converts all numbers to floats which AbletonOSC does not tolerate.

This means you have to script every OSC message complex:

sendOSC( {'/live/set/clip/name', { {tag = 'i', value = 0 },  {tag = 'i', value = 2 } ,  {tag = 's', value = "test" } } } )

instead of simple:

sendOSC( '/live/set/clip/name', 0, 2, "test" )

Request: select_track

Could you please implement the possibility to select a track and query which track is currently selected?

for instance:
/live/song/get/selected_track
/live/song/set/selected_track

I would highly appreciate that.
Thank you!

I really like this project!

Log entries do not reflect origin of detected changes.

Log entries do not reflect origin of detected changes.

(2022-11-29 02:14:10,237) [INFO] Adding listener for track (0,), property: color
(2022-11-29 02:14:10,239) [INFO] Adding listener for track (1,), property: color
(2022-11-29 02:14:10,240) [INFO] Adding listener for track (2,), property: color
(2022-11-29 02:14:10,243) [INFO] Adding listener for track (0,), property: name
(2022-11-29 02:14:10,244) [INFO] Adding listener for track (1,), property: name
(2022-11-29 02:14:10,245) [INFO] Adding listener for track (2,), property: name
(2022-11-29 02:14:14,537) [INFO] Property color changed: 8912743
(2022-11-29 02:14:26,101) [INFO] Property name changed: 2-Audio
(2022-11-29 02:14:40,191) [INFO] Property name changed: 3-Audio

[WinError 10035] A non-blocking socket operation could not be completed immediately

Hello everyone!
I m trying to setup AbletonOSC with Ableton 11 on Windows 10.
I get an error message the exact same way as this user on Stackoverflow
I was wondering, if there has been a solution to this and, if it is possible to find documentation about it, since I couldn't find anything online. I m suspecting it's a problem with Windows.

I get this message in the activity log file:

[INFO] AbletonOSC: Socket error: Traceback (most recent call last):
  File "C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\AbletonOSC\abletonosc\osc_server.py", line 62, in process
    data, addr = self._socket.recvfrom(65536)
BlockingIOError: [WinError 10035] A non-blocking socket operation could not be completed immediately

and at the begining of the log file:

(2021-12-15 01:05:42,667) [INFO] Starting OSC server (local ('127.0.0.1', 11000), remote ('127.0.0.1', 11001))
(2021-12-15 01:05:42,670) [INFO] Disconneting...
(2021-12-15 01:05:42,671) [INFO] Starting OSC server (local ('127.0.0.1', 11000), remote ('127.0.0.1', 11001))
(2021-12-15 01:05:43,026) [INFO] AbletonOSC: Error handling message: Traceback (most recent call last):
  File "C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\AbletonOSC\abletonosc\osc_server.py", line 64, in process
    message = OscMessage(data)
  File "C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\AbletonOSC\pythonosc\osc_message.py", line 23, in __init__
    self._parse_datagram()
  File "C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\AbletonOSC\pythonosc\osc_message.py", line 33, in _parse_datagram
    type_tag, index = osc_types.get_string(self._dgram, index)
  File "C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\AbletonOSC\pythonosc\parsing\osc_types.py", line 86, in get_string
    return data_str.replace(b'\x00', b'').decode('utf-8'), start_index + offset
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 0: invalid continuation byte

One thing to note: I can not rule out user error to 100%.
Thank you

AbletonOSC only seems to listen to Localhost?

Hoi,

I have been using AbletonOSC (receiver) and Unity3D (sender) for half a year on a single pc without any problems, always sending to localhost (127.0.0.1). I am trying to split the OSC sender software (Unity3D application) and Ableton to two different PCs in a network, but AbletonOSC does not pick up the messages. With a 3rd software (Wireshark) I have been monitoring the incoming network traffic on the Ableton PC and the OSC messages arrive on the correct port but don't get picked up by AbletonOSC. Is there any way to have the plugin listen to other IPs than localhost or am I doing something wrong?

Any help is greatly appreciated. Thanks a lot for that awesome plugin btw!

Greetings,
JM

Handling of all active listeners

It's sometimes hard to keep an overview of all started listeners and it gets more difficult with the new wildcard *.

Would it be possible to get something like /live/get/allactivelisteners and /live/stop/allactivelisteners ?
Probably this is only for development purposes and may be too much work to implement as listeners "belong" to different .py files, right?

Changes in /live/track/get/clips/name

I started using AbletonOSC from version before date 2022-12-17.

Taking as an example track 0 (with empty clips), with this new version, the message /live/track/get/clips/name is returning:

[0, null, null, null, null, null, null, null, null]

In the previous version, the same message returned:

[null, null, null, null, null, null, null, null, null]

PS: I'm using the Open Stage Control server app

Weird Null Error

I made a thing in touchdesigner to either speed up or slow down tracks across multiple BPMs to ensure the show is in sync if I change a song's bpm, however whenever I send the bpm value to AbletonOSC (at /live/song/set/tempo) I get this error message:

(2023-01-20 21:47:23,734) [INFO] Setting property for song: tempo (new value 90.0)
(2023-01-20 21:47:23,734) [ERROR] AbletonOSC: Error handling OSC message: Python argument types in
    None.None(Song, str)
did not match C++ signature:
    None(class TPyHandle<class ASong>, float)
(2023-01-20 21:47:23,735) [WARNING] AbletonOSC: Traceback (most recent call last):
  File "C:\Users\scripthead\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\osc_server.py", line 108, in process
    rv = callback(message.params)
  File "C:\Users\scripthead\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\handler.py", line 32, in _set_property
    setattr(target, prop, params[0])
Boost.Python.ArgumentError: Python argument types in
    None.None(Song, str)
did not match C++ signature:
    None(class TPyHandle<class ASong>, float)

I was running Ableton 11.2.6

Request: add instrument to track

I am writing a Python Cli tool that lets me select a few chords and sends them to Live using AbletonOSC. It works fine but the more I think about this the more I want this to become a kind of template creator where I can quickly create jam tracks specifying only the chord progression.

So my question, is there a way to add instruments to tracks using AbletonOSC. I tried many things, but I guess it is not yet implemented. Is this something that is planned to come?

btw I really appreciate this project, thanks for the good work!

Clips in arrangement view

Hi,
Great job so far reworking the LiveOSC. Woudl it be possible to be able to get clips that are on a track in arrangement view?
Thanks for all the great work so far!

Judah

Clip position

Hello!
Thanks a lot for porting the former LiveOSC to Ableton Live 11!
I know it's work in progress, so don't expect everything to be in place.
I would like to ask for one listener though that I would consider essential.
From what I understand it should be
/live/clip/position (int track) (int clip) (float position) (float length) (float loop_start) (float loop_end)
to see how far a playing clip has progressed in its total length or loop.

Oh, and of course related to this:
Is there a listener or a query for the play state of clips?

Joern

Track API cannot get float value

Hi!

When I try to get the volume (/live/track/get/volume) or panning (/live/track/get/panning) of a track, I get the following error in the log file.

(2022-09-19 22:07:49,875) [INFO] AbletonOSC: Error handling message: Traceback (most recent call last):
  File "PATH\AbletonOSC\abletonosc\osc_server.py", line 71, in process
    self.send(message.address, rv)
  File "PATH\AbletonOSC\abletonosc\osc_server.py", line 47, in send
    for param in params:
TypeError: 'float' object is not iterable

I also get similar error when I try to get the send value (/live/track/get/send):

(2022-09-19 22:15:22,189) [INFO] AbletonOSC: Error handling message: Traceback (most recent call last):
  File "PATH\AbletonOSC\abletonosc\osc_server.py", line 71, in process
    self.send(message.address, rv)
  File "PATH\AbletonOSC\abletonosc\osc_server.py", line 47, in send
    for param in params:
TypeError: 'DeviceParameter' object is not iterable

Documentation of device type numbers

live/device/get/type works, but the results of my short test do not match the values given in the ReadMe.
I get 1 for instruments, 2 for audio fx and 4 for midi fx.
Couldn't find any API documentation listing these values to check them.

(already reported by mail)

Track type

Is there a way to find out if a track is midi / audio (/ send / master) ?
Couldn't find anything in AbletonOSC, but neither in the Live API - seems there is no 'track type'
property. Strange as it seems to be of interest to know which calls you can make to a certain track.
All I could find was "has midi input/output" and "has audio input/output" which will help to conclude
the desired information, but doesn't seem very elegant...

Return errors via OSC?

Should some errors and infos that go to the log maybe also be returned via OSC
in some way, maybe as /AbletonOSC/error (string) or something? Not to be handled
by TouchOSC in any way, just to provide a realtime feedback in the OSC monitor when
something is wrong.
Wouldn't do any harm when everything is ok as it wouldn't cause any additional messages,
but would make it easier to try and explore AbletonOSC and to develop and debug tools using
AbletonOSC as it would be easier to understand why nothing happens in some situations.

Some examples how that came to my mind:
AttributeError: 'NoneType' object has no attribute 'color' - when you try to get color from an empty clip slot.
AttributeError: 'NoneType' object has no attribute 'gain' - when you try to get gain from an empty clip slot.
RuntimeError: Gain is only available for Audio Clips - when you try to get gain from a midi clip.
etc.

And for any kind of typos or calls that are not available:
[INFO] AbletonOSC: Unknown OSC address: /live/track/get/clips/colr
[INFO] AbletonOSC: Unknown OSC address: /live/track/get/clips/color_index

Cue Points

Can you add a way to get cue point names, and move between them? Such as next, previous and a specific cue point?

Song API methods not documented in ReadMe

I found some undocumented methods in song.py and tested them. They work, but are not in the ReadMe.

jump_by (float)
jump_to_prev_cue
jump_to_next_cue
duplicate_scene (int)
duplicate_track (int)
tap_tempo
trigger_session_record

I also found the property start_time in song.py, but this does not work and seems to be a clip - not song - property.

Add support for setting gain values in dB

Currently, all volume levels are floats (0..1). The API should ideally expose the ability to set gain values in dB, which will require an internal mapping from db to linear (as provided by @marcobn), and vice versa.

Get track_data extensions

  • /live/song/get/track_data should send data in multiple packets if one is too small
  • /live/song/get/track_data should support -1 to denote max track

live/song/get/cue_points Error

live/song/get/cue_points is checked off in my list, so I suppose it worked, but now it doesn't and gives me an error in the log.

(2022-11-29 00:25:33,451) [INFO] AbletonOSC: Error handling message: Traceback (most recent call last):
File "C:\Users\Anja\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\osc_server.py", line 110, in process
assert isinstance(rv, tuple)
AssertionError

Request: 3 new clip listeners

I would like to have the following 3 clip listeners that are quite essential
to build a TouchOSC template for session view:

/live/clip/start_listen/color
/live/clip/start_listen/name
/live/clip/start_listen/length

Edit: Make it 5 ;-)

/live/clip_slot/start_listen/has_clip
/live/clip_slot/start_listen/has_stop_button

Request: Let new listener trigger a 'get'

At the moment listeners only send information when a change occurs.
So to get the actual state of something in the beginning you have to manually query it before starting a listener.

Would it be possible to let a new listener do this automatically when it is started?

Example:
/live/track/start_listen/color (track_id) would automatically trigger a /live/track/get/color (track_id) once.

This would automatically update a control when a listener is started and do no harm if it is already up-to-date for some reason.

Generic track "start_listen" command

I wondered if it would be possible to have a generic track 'start_listen' command that would allow for any property on a given track to be listened for, rather than having to be specific about the property which is currently the case.

e.g.
/live/track/start_listen 0

With this you could listen for mute, volume, send level, name, color etc. etc.

Device in a group

I can change Gain on a first device on the first channel:

Screenshot 2022-12-07 at 02 01 25

    params = (0, 0, 1.0, 1.0)
    client.send_message("/live/device/set/parameters/value", params)

How to achieve same when device is in a group?

Screenshot 2022-12-07 at 02 03 09

I guess, behind the scene, we have to get Device object from this group (it's maybe a Chain.Devices). And then use this object in /live/device/set/parameters/value . Is it supported now?

Import errors on MacOS

I'm having trouble running the code outside of Ableton. The python compiler embedded in Ableton seems to load the code just fine, but trouble is when i try to fire a pytest or run any modules just by python [module]

I'm using pyenv and virtualenv, so it's a completely clean and isolated environment.

The problem seems to be import errors

I get a bunch of errors very similar to the one i dumped down below. It seems to be related to relative imports.

Terminal output

python version: 3.11.0
pytest version: 7.2.0

MacOS Catalina 10.15.7


_____________________________________ ERROR collecting tests/test_track.py _____________________________________
ImportError while importing test module '/Users/ferry/dev/seed/remote/AbletonOSC/tests/test_track.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../.pyenv/versions/3.11.0/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/__init__.py:4: in <module>
    from ..client import AbletonOSCClient, TICK_DURATION
client/__init__.py:1: in <module>
    from .client import AbletonOSCClient, TICK_DURATION
client/client.py:3: in <module>
    from pythonosc.udp_client import SimpleUDPClient
E   ModuleNotFoundError: No module named 'pythonosc'

Help: How do i test with OSC?

I tried a few OST tester softwares, but i seem to not be able to connect with ableton :(
https://github.com/ETCLabs/OSCTester

I tried all settings!
I tried connecting to 0.0.0.0 on port 11000, also tried host 127.0.0.1 and port 11000, i also tried combinations with port 11001.
You get the idea! I'm not able to connect and test sadly :(

I'm not trying to do something in particular, i just wanted to test it out.

Please halp ❤️

Response parameters missing in ReadMe

Response parameters are missing in the ReadMe for
live/device/get/name
live/device/get/class_name
live/device/get/type

(already reported by mail)

Track API properties not documented in ReadMe

/live/track/get/clips/color

get&set
arm, color_index, current_monitoring_state, fold_state

are working, but missing in ReadMe
Seems all the above track properties and more also have undocumented listeners (only color, name, arm tested).

Are there undocumented listeners for clips implemented already, too?
I'm not able to "find" listeners in track.py, so I don't know what to look for in clip.py.

live/device/set/parameters/value Error

live/device/set/parameters/value (to set ALL device values at once) does not work and gives an error in the log.
I tried with Abletons MIDI Pitch device which has 4 parameters and sent
track_id, device_id, value, value, value, value (int, int, float, float, float, float).

/get/parameters/value, /get/parameter/value and also /set/parameter/value (to set ONE device value) work as expected.

(already reported by mail)

(2022-11-29 00:38:15,965) [INFO] AbletonOSC: Error handling message: Traceback (most recent call last):
File "C:\Users\Anja\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\osc_server.py", line 107, in process
rv = callback(message.params)
File "C:\Users\Anja\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\device.py", line 14, in device_callback
return func(device, *args, params[2:])
File "C:\Users\Anja\Documents\Ableton\User Library\Remote Scripts\AbletonOSC\abletonosc\device.py", line 62, in device_set_parameters_value
for index, value in params:
TypeError: cannot unpack non-iterable float object

Getter for time signature

I'm working on something where I would like to keep count of the measures. However, there seems to be no listener for that, so I figured I'd build my own basing it off of /live/song/beat. The thing is, I don't know the time signature of the song and can't just assume it is 4/4. I found the song properties signature_denominator and signature_numerator here: https://docs.cycling74.com/max8/vignettes/live_object_model#Song.
However, I can't get them (yet), can I? I tried listening for them with /live/song/start_listen/signature_denominator but I get an "Unknown OSC address" error. I also tried get instead of start_listen, but had the same result.

Am I overlooking something here?

Request: The red box

The red box is an important tool when remote controlling the Live session view.
It's part of the remote scripts for all grid controllers like Launchpad, Push, APC, ...
I assume you are familiar with it, if not:
https://remotify.io/sites/default/files/pre-built-scripts/kuala/red-box.gif

The red box is an API feature, functions are de/activate, size x/y and move up/down/left/right.
In the example above it is 4x4, with a Novation Launchpad for example it would be 8x8 and show
which 8x8 clips are controlled by the Launchpad. If you move the box by 8 steps the Launchpad
shows and controls 8x8 other clips.

See it in action here:
https://www.youtube.com/watch?v=3aX-7jmYJJU

It would be nice for AbletonOSC, also to limit the the number of active listeners as you only have to
watch tracks and clips that are inside the box at the moment. AbletonOSC could only provide the mentioned
visual functionality of the box and leave the handling of the listeners to the client OR assist the
client by adjusting some things internally when the box is moved.

Send me a message if you want to go into details.

Define a list of messages to fire when a set is loaded

This is my first contact with AbletonOSC. Excellent initiative.

One question: Do some of the files allow you to add a list of actions to be triggered when Ableton is loaded?

Currently, when we reload or open a project in Ableton we get the message "AbletonOSC: Listening for OSC on port 11000".

It would be very interesting to be able to send, for example, messages like:
/live/song/get/metronome
/live/track/get/clips/name
/live/track/get/color
/live/device/get/name
(among others)

I'm currently a Clyphx Pro user who has a folder called "user_actions". Inside it is possible to create py files to send OSC messages when live is started. For example:

Nome do arquivo: listener_track.py

from ClyphX_Pro.clyphx_pro.UserActionsBase import UserActionsBase

TOCA_MAX_TRACKS = 8

class listener_track(UserActionsBase):

	def create_actions(self):
		
		self.add_global_action('listener_track', self.listener_track)

	def listener_track(self, *a):
		add_func = self.song().add_tracks_listener(self.atualiza)

	def atualiza(self):
		amount_of_tracks = len(self.song().tracks)
		
		for tr_nums in range(0, TOCA_MAX_TRACKS):
			if (tr_nums < amount_of_tracks):

				tr_colore = hex(self.song().tracks[tr_nums].color).lstrip('0x')
				tr_named = self.song().tracks[tr_nums].name
					
			else:

				tr_colore = "rgba(109,181,253,0)"
				tr_named = " "

			self.canonical_parent.clyphx_pro_component.trigger_action_list('OSC str /track_name_%s "%s"' % (tr_nums, tr_named))
			self.canonical_parent.clyphx_pro_component.trigger_action_list('OSC str /color_address%s "%s"' % (tr_nums, tr_colore))

I'm not a python programmer (this code should even have sectors that need refactoring) but it works for me. That is, I can get the names and colors of each track (or an "empty" when they don't exist) as soon as I start my live set.

Yours sincerely!

Request: Get audio output value (complementary to getting the volume set in ableton)

I am writing a Python tool that does automatic camera switching for a live set, it requires to be able to read the audio inputs in specific tracks to know what instruments are being played.

I linked my script to ableton with python-osc and abletonosc, but then discovered get/volume returns the value of the volume set in ableton, not the value of the audio

Getter for Song length

I noticed the current Song endpoint doesn't have a getter for song_length though it's part of the LOM. Is it possible to add this getter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.