Skip to content

Instantly share code, notes, and snippets.

@charlieroberts
Last active November 10, 2016 16:11
Show Gist options
  • Save charlieroberts/566b35a5de7618080dfdf57d3594b749 to your computer and use it in GitHub Desktop.
Save charlieroberts/566b35a5de7618080dfdf57d3594b749 to your computer and use it in GitHub Desktop.

What browser sends to Live:

  • Global “get_scene” Request the current LOM
    “select_parameter param_id”
    “select_track track_id” Select a particular track (by id)

  • Send MIDI notes (pitch-velocity-duration) (?pitch bend etc.?) to a track’s device
    “Track_id add beat phase pitch N”
    “Track_id add beat phase velocity N”
    “Track_id add beat phase duration N”
    “Track_id add beat phase note P V D” send all at once

  • Mute/solo tracks
    Track_id add beat phase mute 0/1”
    “Track_id add beat phase solo 0/1”
    The LOM docs remark: when setting this property, the exclusive solo logic is bypassed, so you have to unsolo the other tracks yourself.

  • Set any device parameter (instantaneous, no limits)
    “add beat phase set param_id N” (maps 0..1 to the parameter’s min/max range)
    “add beat phase zet param_id N” (sets the parameter value directly, not mapping to min/max range)

  • Map a gen~ LFO onto a device parameter (we will have limit to how many we can use, e.g. 16)
    “add beat phase gen param_id \”GenExpr\”” E.g. “0 add 3 0.5 342 \”cycle(4)\””
    Figure out voice allocator thing:
    Use parameter’s live path as the key, so that changes map to same gen~
    Otherwise pick next available voice
    Change parameters on an existing gen~ graph:
    “add beat phase genp param_id param_name N”
    Param_name corresponds to a Param object in the GenExpr
    (silent error if the parameter is not mapped or the param doesn’t exist)
    Need to send a ‘disconnect’ gen~ too, marks it as free
    “add beat phase ungen param_id”

  • Broadcast
    “*msg….”
    (sender will have to filter on the self_id, e.g. session id, e.g. a random number)

What live sends to browser:

  • Full LOM
    On patcher load, and when queried.
    “JSON” (check if charAt(0) == “{“)
    Would be really nice not to generate the LOM for each device...

  • Request for next beat’s events
    “track_id seq N”

  • Error messages
    “track_id err msg...”

  • Play/rewind etc.
    “track_id ply 0/1” (play)
    “track_id bar N”
    “track_id bit N” (beat)

  • Time signature bpm etc. “track_id bpm N”
    “track_id sig N/N”

  • Gen signals (30 Hz)
    “snapshot param_id value param_id value …”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment