Skip to content

Commit 9711dd3

Browse files
authored
New object firedSlotStartOrStop (#3)
1 parent 14b5bf6 commit 9711dd3

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ useful for MIDI controllers.
9494
When this JS object receives a bang, it calculates the musical time in beats that
9595
a clip that has been fired will start playing.
9696

97+
### firedSlotStartOrStop
98+
99+
When this JS object receives an integer value as returned by the slot property
100+
*fired_slot_index*, it determines if that value means a clip will start playing
101+
or the track will stop playing, and issues a bang to outlet 1 or 2, accordingly.
102+
97103
## Developing your own js objects
98104

99105
If you want to develop your own js objects, you probably want the build to

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "max-for-live-lib",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Library of useful Max for Live objects",
55
"private": true,
66
"dependencies": {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { getNumberProperty, getLiveTrackIndex } from "../../util";
2+
3+
autowatch = 1;
4+
inlets = 1;
5+
outlets = 3;
6+
setinletassist(0, "Integer: fired slot index");
7+
setoutletassist(0, "Bang: fired slot will start clip");
8+
setoutletassist(1, "Bang: no slot has been fired");
9+
setoutletassist(2, "Bang: fired slot will stop track");
10+
11+
export function msg_int(value: number) {
12+
if (value === -1) {
13+
outlet(1, "bang");
14+
return;
15+
}
16+
if (value !== -2) {
17+
const hasClip = getNumberProperty(
18+
`live_set tracks ${getLiveTrackIndex()} clip_slots ${value} has_clip`
19+
);
20+
if (hasClip) {
21+
outlet(0, "bang");
22+
return;
23+
}
24+
}
25+
outlet(2, "bang");
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./firedSlotStartOrStop";

0 commit comments

Comments
 (0)