Page 1 of 1

Speaker On button state detection

Posted: Tue Jan 30, 2024 11:14 pm
by johnclark
Hi,
i'd like to know if it's possible to add "something" at the beginning of a song to detect if a specific track of that song is activated (i.e. to detect whether the speaker on button of that track is on or off). And if it's not, to automatically activate the track.
If it's possible, what would be this "something" ?
Thank you

Re: Speaker On button state detection

Posted: Wed Jan 31, 2024 1:25 am
by [jur]
Yep, you can observe a track's mute button state in M4L.

Re: Speaker On button state detection

Posted: Wed Jan 31, 2024 8:31 am
by johnclark
Ok thank you and before I buy the Max4live extension just for this purpose, can you confirm me that along with the capacity to observe the track's mute button state, I can change it with kind of a logical gate (i.e. if it's "off", i want it "on," if it's already "on", i'll let it stay that way).
That means M4L can let me execute kind of a little script at the beginning of a track. Is that so ?

Re: Speaker On button state detection

Posted: Wed Jan 31, 2024 8:51 am
by chapelier fou
Yes you can definitely do that !

I know it's too early to give you a patching advice, but I'll do it anyway :
You'll likely encounter an error message saying : "changes cannot be triggered by notifications" (which I plan to make as a T-Shirt by the way :D )
[deferlow] will then be your friend.

But more seriously, get back here, I'll be happy to help you to patch this little device (and it's a great first project to learn).

Re: Speaker On button state detection

Posted: Sun Feb 04, 2024 7:38 pm
by johnclark
thank you very much for your help !

Re: Speaker On button state detection

Posted: Mon Feb 05, 2024 1:14 pm
by johnclark
chapelier fou wrote:
Wed Jan 31, 2024 8:51 am
But more seriously, get back here, I'll be happy to help you to patch this little device (and it's a great first project to learn).
Ok i'm ready to go. I've just bought M4L. I've opened some tutorials like this one (https://www.youtube.com/watch?v=-eoToUb ... el=Ableton). It seems like what I want to learn is "controlling live" with M4L. But I have to admit that I don't know where to start.

The concept of my device is simple :
1) I have to check the state of the mute button of a specific track at the begining of my song.
2) if it's off, I want it on, if it's on, I don't want to change anything.
3) when my song is playing, the mute button is desactivated by other actions
4) when the song has ended. I'm playing another song in the same project and we're back to step one.

First, how can I check the state of a mute button ?

Re: Speaker On button state detection

Posted: Mon Feb 05, 2024 2:04 pm
by Rivanni
johnclark wrote:
Mon Feb 05, 2024 1:14 pm
chapelier fou wrote:
Wed Jan 31, 2024 8:51 am
But more seriously, get back here, I'll be happy to help you to patch this little device (and it's a great first project to learn).
Ok i'm ready to go. I've just bought M4L. I've opened some tutorials like this one (https://www.youtube.com/watch?v=-eoToUb ... el=Ableton). It seems like what I want to learn is "controlling live" with M4L. But I have to admit that I don't know where to start.

The concept of my device is simple :
1) I have to check the state of the mute button of a specific track at the begining of my song.
2) if it's off, I want it on, if it's on, I don't want to change anything.
3) when my song is playing, the mute button is desactivated by other actions
4) when the song has ended. I'm playing another song in the same project and we're back to step one.

First, how can I check the state of a mute button ?
Get the id of a specific track by sending the message "path live_set tracks 0" (in this case the first track) to [live.path].
Or if you want the id of the track the Max device is on, use "path this_device canonical_parent" as shown in the video.

Send the track id and the message "get mute" and "get muted_via_solo" to a [live.object].

Or when you want to observe it, send the track id and the message "property mute" to [live.observer].


If you have a Max patch you want us to look at because you are stuck, select everything in the Max patch, go to the Edit menu, and select 'Copy Compressed'. hen you can paste the result here.
Such compressed code can be copied and simply pasted in a Max window as you would paste any text. It will automatically convert to objects etc.

I made a small example to get you going

Code: Select all

<pre><code>
----------begin_max5_patcher----------
1070.3ocsXssiaCBD84juBK+raDfM9R+P5KUUQDGRV25fiv3zssZ+26.3ajM
W7l3UZkcLLLyblY3vv9ukK72T8Ju126qde2awh+sbwByP5AVz98B+CrWyKY0
Fw7KKNwWop1uuj6GXm+DSJXG3WaZQygpFUIWYT.tcziLU9KEh8qk7bk0ARxH
qPAdgQnUz.OBR+AAuB48i10XUi5OG41E362OUwVi4q17yuPho98FQBNlhKWy
ErMk7wN.3VEhy8pZ1I910LkRVroQwG9UcaHoMlnAcYCuZW2vci6ZylCsNZ0t
c9AvKQuG6HYYkX+MBgNxd.RGibY24p1B+YTC5BSW+RkTMU6zElI1oda4xgWl
musLXh0LG300r88EDJ9qlLNjz7B+vUIowY5BCbTh9E0VkfdfpDh+kpDHyH9v
ebvgSsaAvOI3Pe5fC79W7z0Pqq4JOkjk+qZOzGeSercSuMoheXDSSmMDK3+F
T46.rD7Dt2A3wkAI4tLajrP8q3o.xfqBT5mdpcOjPuNNuOCNASdtxWZzmcxz
P9ASnc8GEkV7ESeXTdEFHmyhr93MNHZ8QtrtnVwE41y2dbd5qDqTda7JezZd
LkL0nzFlX+Mp6wWLZgm4ZBMs1kwZXWdQ8GamD9xSB+aD.RLj3XT1nM8j6to+
5A.zrE.tImt5kh50a4mJx4d4LQknHmUtFZLfKd38JI1ZA6qGYuRT1cYDLqCR
hhyan03V5wciH0UMx7Nq1Ss5M3Za40pBASUnaaaPpXWopja4xqmHltwgzqG9
tFm3HUuwQOowmFxQeNFOcJF2De.odRaQljsnyhshljsHyhsvSxVQylsvSBW3
m1VSZWwYnet1RpIcdnBSKUD63wS5ylshaLCPC+yJiqkFX9rPX+L17oDXc6j2
Pp5yj.ipBnSaj1ybdM11aju9hdRQSQKNA.tr8royn+5uvW+wU.R1wZJUt3mk
mCL74UkVO56dnUjjznPbXBT3jgH.JWElQvz3zXRRDEkkpGh1I.NKFk.CM9J6
a16nP7vRQfpBl3PtZbWQYYuVG2JDz+f8jYBbGQZBb.bHMNJJKINkFzISCbkW
Iaag9zLM20ptaJ66B8fQOFY+VwvSTNROxwIzvXC5vwzVbFEEFld1xNJqNBWS
usJPGw6mQ0aUJJJihCroHRLdzxU8ljpmOiNLW2or98Af1dEaCs4kbndabTH6
8ImoMzP9xQeTpinZIiskMs0YFe1Ucmk+4aKT5dLNqxJDQSSIgTRVDDpMA5oL
jilK4Gl+c.6pD8+OW.JiuwkaYBluy70E+scd73kVVk+K3J.yORqAnlqKwbS1
8gbC.0ZI0QIljSzv2QInyTrtSRGcZDZPIFc99DNcb3KJ7J5bcgPymxexhSit
WNT26aascns9VRxC.CYQW6Mcb5ldn0oy5iL6gElVsW91x+60Ua6H
-----------end_max5_patcher-----------
</code></pre>

Re: Speaker On button state detection

Posted: Tue Feb 06, 2024 10:11 am
by johnclark
thank you that's exactly what I was looking for to start with M4L. I'll check this by myself and let you know how it's going on.