Skip to content

Commit

Permalink
Adds files and updates test project.
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy Nolan committed Aug 20, 2021
1 parent 0a7f22c commit 673365f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions max/scripts/init_clip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* global post, messagename, outlet, LiveAPI, jsarguments */

inlets = 1
outlets = 1
autowatch = 1

var path = jsarguments[1]

function anything () {
'use strict'

if (messagename === 'bang') {
initializeClip()
}
}

function initializeClip () {
'use strict'

var apiObject = new LiveAPI(path.split('/').join(' '))
var clipName = '' + apiObject.get('name')[0]
var clipColor = apiObject.get('color')[0]
var clipObject = this.patcher.getnamed('clip_ui')

clipObject.message('text', clipName.substring(0, 25))
clipObject.message('bgcolor', [(clipColor >> 16 & 255) / 255, (clipColor >> 8 & 255) / 255, (clipColor & 255) / 255, 1.0])

outlet(0, 'id ' + apiObject.id)
}
Binary file modified test/touchdesigner.toe
Binary file not shown.

0 comments on commit 673365f

Please sign in to comment.