max/mspでタイマー機能を実装する

# 全体像

![output.gif](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2915/75477517-fcc1-f971-0aaa-cb1dbbf799bf.gif)

## サブモジュール

#### timerObj

![Screenshot 2024-11-07 at 9.18.42.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2915/0e6755ea-be0b-8b6b-654b-a9a602d541bc.png)

インターバルを指定してタイマーの発火をbangで受け取るもの

#### randomObj

![Screenshot 2024-11-07 at 9.18.11.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2915/4e4a4e81-2b64-89d7-7352-5f916f49f6da.png)

オフセットとmaxの値を設定してランダムな値を出力するもの

# パッチ

```max:
<pre><code>
----------begin_max5_patcher----------
3037.3oc6c0sbihqD9ZmmBW9x8jYJ8CBAmKNUcdBNO.SsUJhMIC6ZCt.blY2
s128CnVfEN.VXiHPVciSZD+zcqVsZ05qg+5gUadN4mgYaV+uW+s0qV8WOrZk
3PkGXkjd0lCA+b69fLwos4PXVVvqgadDZKO7m4hiiQHT0ASNkuOLO+ONFB24
MaV+qxlh1IN6jm+su3Te9wmNDEWbEhm.QdviA4a+dT7qOkFtMGtOtH9WQOtF
S8K+CkU9Kg7UT8cu3FAOawcBWdv+9gGJ+4wQP7Fn7Q4CU9XLxWY0xmCw.xWb
3OJ3s2IdGWmFDuK4v+6baZJjrVERZOBIgJ5D8Pk+g6cMgT8NElJEMorsZyKQ
6CeKLMKJIV4rWsI33QkCuR4RJUH+Vh3F48X8ghhgCQpOTZ3aQUW+4iFjVHO4
EByoTgdYyOcc1b91jrKLM9TTcuinqQxRhNg3fBKriAagKtrupp4yZHOjiPo3
gAcivnmVRUoiJ5kecex1eOTzQfpNXxwv3n3iogYgw4A4Rlut4cguDbZe9Suj
DmmE8mBV.WZj0R6uHYwVarTHD7++MMJXesD7ZZztj3RlnQWQ4gqdbeaMVLps
72yBi3LhCN1xEWXiUnW5nwrBg7T1yAok8TOuOTsqZSdRx9lMUec6CeIW17w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