mute/unmute track by name
Posted: Sun Feb 18, 2024 1:30 pm
Hi!
i'm new in the M4L world and I'd Like to mute/unmute some tracks each time I'm opening a song.
I basically know how to mute track with a specific id but I want to be able to target a track by its name. This way, I could change track order without having to modify my patch.
I found how to get the name of a track. I guess I'll have to make a list with all the tracks of my project to store their ids and names and then scan the list to target the tracks I want to mute. But I have no clue how to manipulate strings within M4L nor making some iterative action like "for(i=0;i<tab.length;i++)"
Any link which explains the basic programmation concepts (setting variables, iterative actions, conditions, string manipulation etc...) applied to the M4L world would be greatly appreciated.
Here is my patch right now.
<pre><code>
----------begin_max5_patcher----------
1007.3ocuX0zaiaCD8r8uBAc1UfCEkHUu0uNDfcQurcQA1svfVhwgoVe.IJu
Y6h8+doHsbsajikjYxgXEMdDe78lgyLxea4B+MkOIZ789QuO4sXw2VtXgwTm
gEGtegeN+ozc7Fia94hlF9Vg+J62oDOoL1K34BuO6+we+O81I3Ye1u2ih1bY
wNgx733CFq3pzGjEaWWKRUV3wPb.JLLAEkvvIT.RfUdXFI.sxCPwcWvn.j2e
8eqaYqpeggCVslTesRXWUe+iOfLyrQK273OfQ9c199xkcer5Fo9Vgxqi9Slw
wTC4nrtKQXmRwXWxvFMCyaUBOXpbLJwF.igfHMGYtMLRdUHIZxjDwd8HYTxb
HYg3K5G9YbbmbuHP+Eca8IRxPT3.mOw1bWpaoLsey0v2KxVa2vq4JUsbiNB0
bf3GX9B+0Uh5FYiRTjZVXvX2HYtJ6Pl4EOUIi.mk7ibpHANM4Wu6evqK6Xc2
w.UMO8ua7vSNGAOPM7XbPBKJIDnQLFCECZa.3Xwf45CIcBxfzGlH8A.GPIX8
cz3vPFjPXq7HIWg9gWj9qN72fx.3ZYP8frISrWlJbhXvBnwmHEQZofRmqTrg
WrsSJjEp9KCIJtL0ntzzf3B8ACegVDQj.cnOAvI.hDCDbrN0.CO+nwUKSLyT
in4HCok44hB0yzg2+Ge325MVUKZz9vUxxhSmtghsweBMAwn5bf3dxAGtvNgi
mtJmlYM1zsHZT.EyX.kh.MrTLVmaMP9FCEn6WSn5.QBIl.lxQrKp1nAjRrKk
xe5W9vcebVhYH4MUL00weMDyYMJdMOSVtUeZr5ZBmVchNJUlgU59e2oTCctd
HkZ.rukFdGmPphWqe0CkndsnfuYm3LYVIx6WndaMx+QbZW787csm4Plroacx
rnq2y5M7LhPltGWr7wc+5cdpRu2oc5zu7w1Fk7dY5wvAZhgCh4knfPyqKZGD
eZoiypJ404580k4tmsgg1wK69LNY5jk3vNi4R8Ix1iz+9xBUeplYVuWfYc9Z
d+YS4vZIem2OWtKy+EBy1Hqc7Zx0FfX.licLykEukD2VMiL6QnuzjRmM8nwA
cpcw++2Gxrs5retT0T1Vm1ifctKSsi9xJBcxdwwT8OcrL1I9TVmIpMQrAiNt
DXfMLxvMgLcLHG4e4ZpiEn3Q.TD0A.Ek7lgzXDOLR6DbiHgIuUbBFUpH3Bjh
FCmRbERv0hSDWfDLBjLwIv0GjGEz.YXnuspWvXNF7L00VslWUsu6WBy5rABc
KrGKMaK1JysxB6sQlaq0uaeu+wFK7ZcSGktiSasswzSwDe6iVpIXQq7f7pIm
FRS6wtlXMUbKOLcQW98k+KTnKUpK
-----------end_max5_patcher-----------
</code></pre>
Thank you
i'm new in the M4L world and I'd Like to mute/unmute some tracks each time I'm opening a song.
I basically know how to mute track with a specific id but I want to be able to target a track by its name. This way, I could change track order without having to modify my patch.
I found how to get the name of a track. I guess I'll have to make a list with all the tracks of my project to store their ids and names and then scan the list to target the tracks I want to mute. But I have no clue how to manipulate strings within M4L nor making some iterative action like "for(i=0;i<tab.length;i++)"
Any link which explains the basic programmation concepts (setting variables, iterative actions, conditions, string manipulation etc...) applied to the M4L world would be greatly appreciated.
Here is my patch right now.
<pre><code>
----------begin_max5_patcher----------
1007.3ocuX0zaiaCD8r8uBAc1UfCEkHUu0uNDfcQurcQA1svfVhwgoVe.IJu
Y6h8+doHsbsajikjYxgXEMdDe78lgyLxea4B+MkOIZ789QuO4sXw2VtXgwTm
gEGt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