harp-dev commited on
Commit
f7f9ad7
·
verified ·
1 Parent(s): b98ca56

Remove what inference does not use: the Max patches, the training scripts, and macOS clutter

Browse files
.DS_Store DELETED
Binary file (6.15 kB)
 
TODOS DELETED
@@ -1 +0,0 @@
1
- [ ] add sketch2sound finetuning
 
 
assets/.DS_Store DELETED
Binary file (6.15 kB)
 
hello.py DELETED
@@ -1,48 +0,0 @@
1
- import random
2
- import vampnet
3
- import audiotools as at
4
-
5
- # load the default vampnet model
6
- interface = vampnet.interface.Interface.default()
7
-
8
- # list available finetuned models
9
- finetuned_model_choices = interface.available_models()
10
- print(f"available finetuned models: {finetuned_model_choices}")
11
-
12
- # pick a random finetuned model
13
- model_choice = random.choice(finetuned_model_choices)
14
- print(f"choosing model: {model_choice}")
15
-
16
- # or pick a specific finetuned model
17
- print(f"actually, forcing model: default")
18
- model_choice = "default"
19
-
20
- # load a finetuned model
21
- interface.load_finetuned(model_choice)
22
-
23
- # load an example audio file
24
- signal = at.AudioSignal("assets/example.wav")
25
-
26
- # get the tokens for the audio
27
- codes = interface.encode(signal)
28
-
29
- # build a mask for the audio
30
- mask = interface.build_mask(
31
- codes, signal,
32
- periodic_prompt=13,
33
- upper_codebook_mask=3,
34
- )
35
-
36
- # generate the output tokens
37
- output_tokens = interface.vamp(
38
- codes, mask, return_mask=False,
39
- temperature=1.0,
40
- typical_filtering=False,
41
- debug=True
42
- )
43
-
44
- # convert them to a signal
45
- output_signal = interface.decode(output_tokens)
46
-
47
- # save the output signal
48
- output_signal.write("scratch/output.wav")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scratch/rms_mask.txt DELETED
@@ -1,14 +0,0 @@
1
- 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1
2
- 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1
3
- 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1
4
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
5
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
6
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
8
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
9
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
10
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
11
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
12
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
13
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
14
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/exp/eval.py DELETED
@@ -1,110 +0,0 @@
1
- from pathlib import Path
2
- import os
3
- from functools import partial
4
-
5
- from frechet_audio_distance import FrechetAudioDistance
6
- import pandas
7
- import argbind
8
- import torch
9
- from tqdm import tqdm
10
-
11
- import audiotools
12
- from audiotools import AudioSignal
13
-
14
- @argbind.bind(without_prefix=True)
15
- def eval(
16
- exp_dir: str = None,
17
- baseline_key: str = "baseline",
18
- audio_ext: str = ".wav",
19
- ):
20
- assert exp_dir is not None
21
- exp_dir = Path(exp_dir)
22
- assert exp_dir.exists(), f"exp_dir {exp_dir} does not exist"
23
-
24
- # set up our metrics
25
- # sisdr_loss = audiotools.metrics.distance.SISDRLoss()
26
- # stft_loss = audiotools.metrics.spectral.MultiScaleSTFTLoss()
27
- mel_loss = audiotools.metrics.spectral.MelSpectrogramLoss()
28
- frechet = FrechetAudioDistance(
29
- use_pca=False,
30
- use_activation=False,
31
- verbose=True,
32
- audio_load_worker=4,
33
- )
34
- frechet.model.to("cuda" if torch.cuda.is_available() else "cpu")
35
-
36
- # figure out what conditions we have
37
- conditions = [d.name for d in exp_dir.iterdir() if d.is_dir()]
38
-
39
- assert baseline_key in conditions, f"baseline_key {baseline_key} not found in {exp_dir}"
40
- conditions.remove(baseline_key)
41
-
42
- print(f"Found {len(conditions)} conditions in {exp_dir}")
43
- print(f"conditions: {conditions}")
44
-
45
- baseline_dir = exp_dir / baseline_key
46
- baseline_files = sorted(list(baseline_dir.glob(f"*{audio_ext}")), key=lambda x: int(x.stem))
47
-
48
- metrics = []
49
- for condition in tqdm(conditions):
50
- cond_dir = exp_dir / condition
51
- cond_files = sorted(list(cond_dir.glob(f"*{audio_ext}")), key=lambda x: int(x.stem))
52
-
53
- print(f"computing fad for {baseline_dir} and {cond_dir}")
54
- frechet_score = frechet.score(baseline_dir, cond_dir)
55
-
56
- # make sure we have the same number of files
57
- num_files = min(len(baseline_files), len(cond_files))
58
- baseline_files = baseline_files[:num_files]
59
- cond_files = cond_files[:num_files]
60
- assert len(list(baseline_files)) == len(list(cond_files)), f"number of files in {baseline_dir} and {cond_dir} do not match. {len(list(baseline_files))} vs {len(list(cond_files))}"
61
-
62
- def process(baseline_file, cond_file):
63
- # make sure the files match (same name)
64
- assert baseline_file.stem == cond_file.stem, f"baseline file {baseline_file} and cond file {cond_file} do not match"
65
-
66
- # load the files
67
- baseline_sig = AudioSignal(str(baseline_file))
68
- cond_sig = AudioSignal(str(cond_file))
69
-
70
- cond_sig.resample(baseline_sig.sample_rate)
71
- cond_sig.truncate_samples(baseline_sig.length)
72
-
73
- # if our condition is inpainting, we need to trim the conditioning off
74
- if "inpaint" in condition:
75
- ctx_amt = float(condition.split("_")[-1])
76
- ctx_samples = int(ctx_amt * baseline_sig.sample_rate)
77
- print(f"found inpainting condition. trimming off {ctx_samples} samples from {cond_file} and {baseline_file}")
78
- cond_sig.trim(ctx_samples, ctx_samples)
79
- baseline_sig.trim(ctx_samples, ctx_samples)
80
-
81
- return {
82
- # "sisdr": -sisdr_loss(baseline_sig, cond_sig).item(),
83
- # "stft": stft_loss(baseline_sig, cond_sig).item(),
84
- "mel": mel_loss(baseline_sig, cond_sig).item(),
85
- "frechet": frechet_score,
86
- # "visqol": vsq,
87
- "condition": condition,
88
- "file": baseline_file.stem,
89
- }
90
-
91
- print(f"processing {len(baseline_files)} files in {baseline_dir} and {cond_dir}")
92
- metrics.extend(tqdm(map(process, baseline_files, cond_files), total=len(baseline_files)))
93
-
94
- metric_keys = [k for k in metrics[0].keys() if k not in ("condition", "file")]
95
-
96
-
97
- for mk in metric_keys:
98
- stat = pandas.DataFrame(metrics)
99
- stat = stat.groupby(['condition'])[mk].agg(['mean', 'count', 'std'])
100
- stat.to_csv(exp_dir / f"stats-{mk}.csv")
101
-
102
- df = pandas.DataFrame(metrics)
103
- df.to_csv(exp_dir / "metrics-all.csv", index=False)
104
-
105
-
106
- if __name__ == "__main__":
107
- args = argbind.parse_args()
108
-
109
- with argbind.scope(args):
110
- eval()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/exp/experiment.py DELETED
@@ -1,254 +0,0 @@
1
- from pathlib import Path
2
- import random
3
- from typing import List
4
- import tempfile
5
- import subprocess
6
-
7
- import argbind
8
- from tqdm import tqdm
9
- import torch
10
-
11
- from vampnet.interface import Interface
12
- from vampnet import mask as pmask
13
- import audiotools as at
14
-
15
- Interface: Interface = argbind.bind(Interface)
16
-
17
-
18
-
19
- def calculate_bitrate(
20
- interface, num_codebooks,
21
- downsample_factor
22
- ):
23
- bit_width = 10
24
- sr = interface.codec.sample_rate
25
- hop = interface.codec.hop_size
26
- rate = (sr / hop) * ((bit_width * num_codebooks) / downsample_factor)
27
- return rate
28
-
29
- def baseline(sig, interface):
30
- return interface.preprocess(sig)
31
-
32
- def reconstructed(sig, interface):
33
- return interface.decode(
34
- interface.encode(sig)
35
- )
36
-
37
- def coarse2fine(sig, interface):
38
- z = interface.encode(sig)
39
- z = z[:, :interface.c2f.n_conditioning_codebooks, :]
40
-
41
- z = interface.coarse_to_fine(z)
42
- return interface.decode(z)
43
-
44
- class CoarseCond:
45
-
46
- def __init__(self, num_conditioning_codebooks, downsample_factor):
47
- self.num_conditioning_codebooks = num_conditioning_codebooks
48
- self.downsample_factor = downsample_factor
49
-
50
- def __call__(self, sig, interface):
51
- z = interface.encode(sig)
52
- mask = pmask.full_mask(z)
53
- mask = pmask.codebook_unmask(mask, self.num_conditioning_codebooks)
54
- mask = pmask.periodic_mask(mask, self.downsample_factor)
55
-
56
- zv = interface.coarse_vamp(z, mask)
57
- zv = interface.coarse_to_fine(zv)
58
- return interface.decode(zv)
59
-
60
- def opus(sig, interface, bitrate=128):
61
- sig = interface.preprocess(sig)
62
-
63
- with tempfile.NamedTemporaryFile(suffix=".wav") as f:
64
- sig.write(f.name)
65
-
66
- opus_name = Path(f.name).with_suffix(".opus")
67
- # convert to opus
68
- cmd = [
69
- "ffmpeg", "-y", "-i", f.name,
70
- "-c:a", "libopus",
71
- "-b:a", f"{bitrate}",
72
- opus_name
73
- ]
74
- subprocess.run(cmd, check=True)
75
-
76
- # convert back to wav
77
- output_name = Path(f"{f.name}-opus").with_suffix(".wav")
78
- cmd = [
79
- "ffmpeg", "-y", "-i", opus_name,
80
- output_name
81
- ]
82
-
83
- subprocess.run(cmd, check=True)
84
-
85
- sig = at.AudioSignal(
86
- output_name,
87
- sample_rate=sig.sample_rate
88
- )
89
- return sig
90
-
91
- def mask_ratio_1_step(ratio=1.0):
92
- def wrapper(sig, interface):
93
- z = interface.encode(sig)
94
- mask = pmask.linear_random(z, ratio)
95
- zv = interface.coarse_vamp(
96
- z,
97
- mask,
98
- sampling_steps=1,
99
- )
100
-
101
- return interface.decode(zv)
102
- return wrapper
103
-
104
- def num_sampling_steps(num_steps=1):
105
- def wrapper(sig, interface: Interface):
106
- z = interface.encode(sig)
107
- mask = pmask.periodic_mask(z, 16)
108
- zv = interface.coarse_vamp(
109
- z,
110
- mask,
111
- sampling_steps=num_steps,
112
- )
113
-
114
- zv = interface.coarse_to_fine(zv)
115
- return interface.decode(zv)
116
- return wrapper
117
-
118
- def beat_mask(ctx_time):
119
- def wrapper(sig, interface):
120
- beat_mask = interface.make_beat_mask(
121
- sig,
122
- before_beat_s=ctx_time/2,
123
- after_beat_s=ctx_time/2,
124
- invert=True
125
- )
126
-
127
- z = interface.encode(sig)
128
-
129
- zv = interface.coarse_vamp(
130
- z, beat_mask
131
- )
132
-
133
- zv = interface.coarse_to_fine(zv)
134
- return interface.decode(zv)
135
- return wrapper
136
-
137
- def inpaint(ctx_time):
138
- def wrapper(sig, interface: Interface):
139
- z = interface.encode(sig)
140
- mask = pmask.inpaint(z, interface.s2t(ctx_time), interface.s2t(ctx_time))
141
-
142
- zv = interface.coarse_vamp(z, mask)
143
- zv = interface.coarse_to_fine(zv)
144
-
145
- return interface.decode(zv)
146
- return wrapper
147
-
148
- def token_noise(noise_amt):
149
- def wrapper(sig, interface: Interface):
150
- z = interface.encode(sig)
151
- mask = pmask.random(z, noise_amt)
152
- z = torch.where(
153
- mask,
154
- torch.randint_like(z, 0, interface.coarse.vocab_size),
155
- z
156
- )
157
- return interface.decode(z)
158
- return wrapper
159
-
160
- EXP_REGISTRY = {}
161
-
162
- EXP_REGISTRY["gen-compression"] = {
163
- "baseline": baseline,
164
- "reconstructed": reconstructed,
165
- "coarse2fine": coarse2fine,
166
- **{
167
- f"{n}_codebooks_downsampled_{x}x": CoarseCond(num_conditioning_codebooks=n, downsample_factor=x)
168
- for (n, x) in (
169
- (1, 1), # 1 codebook, no downsampling
170
- (4, 4), # 4 codebooks, downsampled 4x
171
- (4, 16), # 4 codebooks, downsampled 16x
172
- (4, 32), # 4 codebooks, downsampled 16x
173
- )
174
- },
175
- **{
176
- f"token_noise_{x}": mask_ratio_1_step(ratio=x)
177
- for x in [0.25, 0.5, 0.75]
178
- },
179
-
180
- }
181
-
182
-
183
- EXP_REGISTRY["sampling-steps"] = {
184
- # "codec": reconstructed,
185
- **{f"steps_{n}": num_sampling_steps(n) for n in [1, 4, 12, 36, 64, 72]},
186
- }
187
-
188
-
189
- EXP_REGISTRY["musical-sampling"] = {
190
- **{f"beat_mask_{t}": beat_mask(t) for t in [0.075]},
191
- **{f"inpaint_{t}": inpaint(t) for t in [0.5, 1.0,]}, # multiply these by 2 (they go left and right)
192
- }
193
-
194
- @argbind.bind(without_prefix=True)
195
- def main(
196
- sources=[
197
- "/media/CHONK/hugo/spotdl/val",
198
- ],
199
- output_dir: str = "./samples",
200
- max_excerpts: int = 2000,
201
- exp_type: str = "gen-compression",
202
- seed: int = 0,
203
- ext: str = [".mp3"],
204
- ):
205
- at.util.seed(seed)
206
- interface = Interface()
207
-
208
- output_dir = Path(output_dir)
209
- output_dir.mkdir(exist_ok=True, parents=True)
210
-
211
- from audiotools.data.datasets import AudioLoader, AudioDataset
212
-
213
- loader = AudioLoader(sources=sources, shuffle_state=seed, ext=ext)
214
- dataset = AudioDataset(loader,
215
- sample_rate=interface.codec.sample_rate,
216
- duration=interface.coarse.chunk_size_s,
217
- n_examples=max_excerpts,
218
- without_replacement=True,
219
- )
220
-
221
- if exp_type in EXP_REGISTRY:
222
- SAMPLE_CONDS = EXP_REGISTRY[exp_type]
223
- else:
224
- raise ValueError(f"Unknown exp_type {exp_type}")
225
-
226
-
227
- indices = list(range(max_excerpts))
228
- random.shuffle(indices)
229
- for i in tqdm(indices):
230
- # if all our files are already there, skip
231
- done = []
232
- for name in SAMPLE_CONDS:
233
- o_dir = Path(output_dir) / name
234
- done.append((o_dir / f"{i}.wav").exists())
235
- if all(done):
236
- continue
237
-
238
- sig = dataset[i]["signal"]
239
- results = {
240
- name: cond(sig, interface).cpu()
241
- for name, cond in SAMPLE_CONDS.items()
242
- }
243
-
244
- for name, sig in results.items():
245
- o_dir = Path(output_dir) / name
246
- o_dir.mkdir(exist_ok=True, parents=True)
247
-
248
- sig.write(o_dir / f"{i}.wav")
249
-
250
- if __name__ == "__main__":
251
- args = argbind.parse_args()
252
-
253
- with argbind.scope(args):
254
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/exp/export.py DELETED
@@ -1,75 +0,0 @@
1
- from pathlib import Path
2
-
3
- import shutil
4
- import argparse
5
- from vampnet import DEFAULT_HF_MODEL_REPO
6
- from huggingface_hub import create_repo, repo_exists, HfApi
7
-
8
-
9
-
10
- parser = argparse.ArgumentParser(description="Export the fine-tuned model to the repo")
11
- parser.add_argument(
12
- "--name", type=str, default="lazaro-ros-sep",
13
- help="name of the fine-tuned model to export"
14
- )
15
- parser.add_argument(
16
- "--model", type=str, default="latest",
17
- help="model version to export. check runs/<name> for available versions"
18
- )
19
- parser.add_argument(
20
- "--repo", type=str, default=DEFAULT_HF_MODEL_REPO,
21
- help="name of the repo to export to"
22
- )
23
-
24
- args = parser.parse_args()
25
- name = args.name
26
- version = args.model
27
-
28
- ##
29
- print(f"~~~~~~~~~~~ vampnet export! ~~~~~~~~~~~~")
30
- print(f"exporting {name} version {version} to {args.repo}\n")
31
-
32
- run_dir = Path(f"runs/{name}")
33
- repo_dir = Path("models/vampnet")
34
-
35
- # create our repo
36
- new_repo = False
37
- if not repo_exists(args.repo):
38
- print(f"repo {args.repo} does not exist, creating it")
39
- print(f"creating a repo at {args.repo}")
40
- create_repo(args.repo)
41
- new_repo = True
42
-
43
- paths = []
44
- for part in ("coarse", "c2f"):
45
- outdir = repo_dir / "loras" / name
46
- outdir.mkdir(parents=True, exist_ok=True)
47
- outpath = outdir / f"{part}.pth"
48
- path = run_dir / part / version / "vampnet" / "weights.pth"
49
- # path.rename(outpath)
50
- shutil.copy(path, outpath)
51
- paths.append(outpath)
52
- print(f"copied {path} to {outpath}")
53
-
54
- print(f"uploading files to {args.repo}")
55
- # upload files to the repo
56
-
57
- # if it's a new repo, let's add the default models too
58
- if new_repo:
59
- paths.extend([repo_dir / "c2f.pth", repo_dir / "coarse.pth", repo_dir / "codec.pth", repo_dir / "wavebeat.pth"])
60
-
61
- api = HfApi()
62
-
63
- for path in paths:
64
- path_in_repo = str(path.relative_to(repo_dir))
65
- print(f"uploading {path} to {args.repo}/{path_in_repo}")
66
- api.upload_file(
67
- path_or_fileobj=path,
68
- path_in_repo=path_in_repo,
69
- repo_id=args.repo,
70
- token=True,
71
- commit_message=f"uploading {path_in_repo}",
72
- )
73
-
74
-
75
- print("done!!! >::0")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/exp/fine_tune.py DELETED
@@ -1,87 +0,0 @@
1
- import argbind
2
- from pathlib import Path
3
- import yaml
4
- from typing import List
5
-
6
-
7
-
8
-
9
- """example output: (yaml)
10
-
11
- """
12
-
13
- @argbind.bind(without_prefix=True, positional=True)
14
- def fine_tune(audio_files_or_folders: List[str], name: str):
15
-
16
- conf_dir = Path("conf")
17
- assert conf_dir.exists(), "conf directory not found. are you in the vampnet directory?"
18
-
19
- conf_dir = conf_dir / "generated"
20
- conf_dir.mkdir(exist_ok=True)
21
-
22
- finetune_dir = conf_dir / name
23
- finetune_dir.mkdir(exist_ok=True)
24
-
25
- finetune_c2f_conf = {
26
- "$include": ["conf/lora/lora.yml"],
27
- "fine_tune": True,
28
- "train/AudioLoader.sources": audio_files_or_folders,
29
- "val/AudioLoader.sources": audio_files_or_folders,
30
- "VampNet.n_codebooks": 14,
31
- "VampNet.n_conditioning_codebooks": 4,
32
- "VampNet.embedding_dim": 1280,
33
- "VampNet.n_layers": 16,
34
- "VampNet.n_heads": 20,
35
- "AudioDataset.duration": 3.0,
36
- "AudioDataset.loudness_cutoff": -40.0,
37
- "save_path": f"./runs/{name}/c2f",
38
- "fine_tune_checkpoint": "./models/vampnet/c2f.pth"
39
- }
40
-
41
- finetune_coarse_conf = {
42
- "$include": ["conf/lora/lora.yml"],
43
- "fine_tune": True,
44
- "train/AudioLoader.sources": audio_files_or_folders,
45
- "val/AudioLoader.sources": audio_files_or_folders,
46
- "save_path": f"./runs/{name}/coarse",
47
- "fine_tune_checkpoint": "./models/vampnet/coarse.pth"
48
- }
49
-
50
- interface_conf = {
51
- "Interface.coarse_ckpt": f"./runs/{name}/coarse/latest/vampnet/weights.pth",
52
-
53
- "Interface.coarse2fine_ckpt": f"./runs/{name}/c2f/latest/vampnet/weights.pth",
54
- "Interface.wavebeat_ckpt": "./models/wavebeat.pth",
55
-
56
- "Interface.codec_ckpt": "./models/vampnet/codec.pth",
57
- "AudioLoader.sources": [audio_files_or_folders],
58
- }
59
-
60
- # save the confs
61
- with open(finetune_dir / "c2f.yml", "w") as f:
62
- yaml.dump(finetune_c2f_conf, f)
63
-
64
- with open(finetune_dir / "coarse.yml", "w") as f:
65
- yaml.dump(finetune_coarse_conf, f)
66
-
67
- with open(finetune_dir / "interface.yml", "w") as f:
68
- yaml.dump(interface_conf, f)
69
-
70
-
71
- # print(f"generated confs in {finetune_dir}.
72
- # run training jobs with `python scripts/exp/train.py --args.load {finetune_dir}/<c2f/coarse>.yml` ")
73
-
74
- print(f"generated confs in {finetune_dir}.")
75
- print()
76
- print(f"you'll need to run two training jobs, though they can run in parallel on separate GPUs.")
77
- print(f"run the coarse job with \n\tpython scripts/exp/train.py --args.load {finetune_dir}/coarse.yml\n")
78
- print(f"run the c2f job with \n\tpython scripts/exp/train.py --args.load {finetune_dir}/c2f.yml\n")
79
- if __name__ == "__main__":
80
- args = argbind.parse_args()
81
-
82
- with argbind.scope(args):
83
- fine_tune()
84
-
85
-
86
-
87
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/exp/train.py DELETED
@@ -1,746 +0,0 @@
1
- import os
2
- import sys
3
- import warnings
4
- from pathlib import Path
5
- from typing import Optional
6
- from dataclasses import dataclass
7
-
8
- import argbind
9
- import audiotools as at
10
- import torch
11
- import torch.nn as nn
12
- from audiotools import AudioSignal
13
- from audiotools.data import transforms as tfm
14
- from einops import rearrange
15
- from rich import pretty
16
- from rich.traceback import install
17
- from torch.utils.tensorboard import SummaryWriter
18
-
19
- import vampnet
20
- from vampnet.modules.transformer import VampNet
21
- # from vampnet.control import Sketch2SoundController
22
- from vampnet.util import codebook_unflatten, codebook_flatten
23
- from vampnet import mask as pmask
24
- # from dac.model.dac import DAC
25
- from lac.model.lac import LAC as DAC
26
-
27
- from audiotools.ml.decorators import (
28
- timer, Tracker, when
29
- )
30
-
31
- import loralib as lora
32
-
33
- import torch._dynamo
34
- torch._dynamo.config.verbose=True
35
-
36
-
37
- # Enable cudnn autotuner to speed up training
38
- # (can be altered by the funcs.seed function)
39
- torch.backends.cudnn.benchmark = bool(int(os.getenv("CUDNN_BENCHMARK", 1)))
40
- # Uncomment to trade memory for speed.
41
-
42
- # Install to make things look nice
43
- warnings.filterwarnings("ignore", category=UserWarning)
44
- pretty.install()
45
- install()
46
-
47
- # optim
48
- Accelerator = argbind.bind(at.ml.Accelerator, without_prefix=True)
49
- CrossEntropyLoss = argbind.bind(nn.CrossEntropyLoss)
50
- AdamW = argbind.bind(torch.optim.AdamW)
51
- NoamScheduler = argbind.bind(vampnet.scheduler.NoamScheduler)
52
-
53
- # transforms
54
- filter_fn = lambda fn: hasattr(fn, "transform") and fn.__qualname__ not in [
55
- "BaseTransform",
56
- "Compose",
57
- "Choose",
58
- ]
59
-
60
- # model
61
- VampNet = argbind.bind(VampNet)
62
-
63
-
64
- # data
65
- AudioLoader = argbind.bind(at.datasets.AudioLoader)
66
- AudioDataset = argbind.bind(at.datasets.AudioDataset, "train", "val")
67
-
68
- IGNORE_INDEX = -100
69
-
70
- # Sketch2SoundController = argbind.bind(Sketch2SoundController)
71
-
72
-
73
- @argbind.bind("train", "val", without_prefix=True)
74
- def build_transform():
75
- transform = tfm.Compose(
76
- tfm.VolumeNorm(("const", -24)),
77
- # tfm.PitchShift(),
78
- tfm.RescaleAudio(),
79
- )
80
- return transform
81
-
82
-
83
- @torch.no_grad()
84
- def apply_transform(transform_fn, batch):
85
- sig: AudioSignal = batch["signal"]
86
- kwargs = batch["transform_args"]
87
-
88
- sig: AudioSignal = transform_fn(sig.clone(), **kwargs)
89
- return sig
90
-
91
-
92
- def build_datasets(args, sample_rate: int):
93
- with argbind.scope(args, "train"):
94
- train_data = AudioDataset(
95
- AudioLoader(), sample_rate, transform=build_transform()
96
- )
97
- with argbind.scope(args, "val"):
98
- val_data = AudioDataset(AudioLoader(), sample_rate, transform=build_transform())
99
- return train_data, val_data
100
-
101
-
102
- def rand_float(shape, low, high, rng):
103
- return rng.draw(shape)[:, 0] * (high - low) + low
104
-
105
-
106
- def flip_coin(shape, p, rng):
107
- return rng.draw(shape)[:, 0] < p
108
-
109
-
110
- def num_params_hook(o, p):
111
- return o + f" {p/1e6:<.3f}M params."
112
-
113
-
114
- def add_num_params_repr_hook(model):
115
- import numpy as np
116
- from functools import partial
117
-
118
- for n, m in model.named_modules():
119
- o = m.extra_repr()
120
- p = sum([np.prod(p.size()) for p in m.parameters()])
121
-
122
- setattr(m, "extra_repr", partial(num_params_hook, o=o, p=p))
123
-
124
- def get_controls(state, sig: at.AudioSignal):
125
- # get controls
126
- n_batch = sig.samples.shape[0]
127
- if state.controller is not None:
128
- ctrls = state.controller.extract(sig)
129
- # draw control masks
130
- ctrl_masks = state.controller.random_mask(
131
- ctrls,
132
- r=state.rng.draw(n_batch)[:, 0].to(state.device)
133
- )
134
- else:
135
- ctrls = None
136
- ctrl_masks = None
137
-
138
- return ctrls, ctrl_masks
139
-
140
-
141
- def generate_z_mask(state, z, vn, n_batch, ctrl_masks=None):
142
- r = state.rng.draw(n_batch)[:, 0].to(state.device)
143
-
144
- mask, ii = state.model.random_mask(z, r)
145
- mask = pmask.codebook_unmask(mask, vn.n_conditioning_codebooks)
146
-
147
- # outpaint?
148
- # if state.outpaint_prob > 0:
149
- # if flip_coin(state.outpaint_prob):
150
- # mask, ctrl_masks = state.build_tria_mask(mask, ctrl_masks)
151
- z_mask = pmask.apply_mask(z, mask, vn.mask_token)
152
-
153
- return z_mask, mask, ii, r, ctrl_masks
154
-
155
- def accuracy(
156
- preds: torch.Tensor,
157
- target: torch.Tensor,
158
- top_k: int = 1,
159
- ignore_index: Optional[int] = None,
160
- ) -> torch.Tensor:
161
- # Flatten the predictions and targets to be of shape (batch_size * sequence_length, n_class)
162
- preds = rearrange(preds, "b p s -> (b s) p")
163
- target = rearrange(target, "b s -> (b s)")
164
-
165
- # return torchmetrics.functional.accuracy(preds, target, task='multiclass', top_k=topk, num_classes=preds.shape[-1], ignore_index=ignore_index)
166
- if ignore_index is not None:
167
- # Create a mask for the ignored index
168
- mask = target != ignore_index
169
- # Apply the mask to the target and predictions
170
- preds = preds[mask]
171
- target = target[mask]
172
-
173
- # Get the top-k predicted classes and their indices
174
- _, pred_indices = torch.topk(preds, k=top_k, dim=-1)
175
-
176
- # Determine if the true target is in the top-k predicted classes
177
- correct = torch.sum(torch.eq(pred_indices, target.unsqueeze(1)), dim=1)
178
-
179
- # Calculate the accuracy
180
- accuracy = torch.mean(correct.float())
181
-
182
- return accuracy
183
-
184
- def _metrics(z_hat, r, target, flat_mask, output):
185
- for r_range in [(0, 0.5), (0.5, 1.0)]:
186
- unmasked_target = target.masked_fill(flat_mask.bool(), IGNORE_INDEX)
187
- masked_target = target.masked_fill(~flat_mask.bool(), IGNORE_INDEX)
188
-
189
- assert target.shape[0] == r.shape[0]
190
- # grab the indices of the r values that are in the range
191
- r_idx = (r >= r_range[0]) & (r < r_range[1])
192
-
193
- # grab the target and z_hat values that are in the range
194
- r_unmasked_target = unmasked_target[r_idx]
195
- r_masked_target = masked_target[r_idx]
196
- r_z_hat = z_hat[r_idx]
197
-
198
- for topk in (1, 25):
199
- s, e = r_range
200
- tag = f"accuracy-{s}-{e}/top{topk}"
201
-
202
- output[f"{tag}/unmasked"] = accuracy(
203
- preds=r_z_hat,
204
- target=r_unmasked_target,
205
- ignore_index=IGNORE_INDEX,
206
- top_k=topk,
207
- )
208
- output[f"{tag}/masked"] = accuracy(
209
- preds=r_z_hat,
210
- target=r_masked_target,
211
- ignore_index=IGNORE_INDEX,
212
- top_k=topk,
213
- )
214
-
215
-
216
- @dataclass
217
- class State:
218
- model: VampNet
219
- codec: DAC
220
- # controller: Sketch2SoundController
221
- controller: Optional[object]
222
-
223
- optimizer: AdamW
224
- scheduler: NoamScheduler
225
- criterion: CrossEntropyLoss
226
- grad_clip_val: float
227
-
228
- rng: torch.quasirandom.SobolEngine
229
-
230
- train_data: AudioDataset
231
- val_data: AudioDataset
232
-
233
- tracker: Tracker
234
-
235
-
236
- @timer()
237
- def train_loop(state: State, batch: dict, accel: Accelerator):
238
- state.model.train()
239
- batch = at.util.prepare_batch(batch, accel.device)
240
- signal = apply_transform(state.train_data.transform, batch)
241
-
242
- output = {}
243
- vn = accel.unwrap(state.model)
244
- with accel.autocast():
245
- with torch.inference_mode():
246
- state.codec.to(accel.device)
247
- z = state.codec.encode(signal.samples, signal.sample_rate)["codes"]
248
- z = z[:, : vn.n_codebooks, :]
249
-
250
- n_batch = z.shape[0]
251
- r = state.rng.draw(n_batch)[:, 0].to(accel.device)
252
-
253
- mask = pmask.random(z, r)
254
- mask = pmask.codebook_unmask(mask, vn.n_conditioning_codebooks)
255
- z_mask, mask = pmask.apply_mask(z, mask, vn.mask_token)
256
-
257
- # get controls
258
- ctrls, ctrl_masks = get_controls(state, signal)
259
-
260
- # TODO: KEEP INCORPORATING ZMASK CODE
261
-
262
- z_mask_latent = vn.embedding.from_codes(z_mask, state.codec)
263
-
264
- dtype = torch.bfloat16 if accel.amp else None
265
- with accel.autocast(dtype=dtype):
266
- z_hat = state.model(z_mask_latent)
267
-
268
- target = codebook_flatten(
269
- z[:, vn.n_conditioning_codebooks :, :],
270
- )
271
-
272
- flat_mask = codebook_flatten(
273
- mask[:, vn.n_conditioning_codebooks :, :],
274
- )
275
-
276
- # replace target with ignore index for masked tokens
277
- t_masked = target.masked_fill(~flat_mask.bool(), IGNORE_INDEX)
278
- output["loss"] = state.criterion(z_hat, t_masked)
279
-
280
- _metrics(
281
- r=r,
282
- z_hat=z_hat,
283
- target=target,
284
- flat_mask=flat_mask,
285
- output=output,
286
- )
287
-
288
-
289
- accel.backward(output["loss"])
290
-
291
- output["other/learning_rate"] = state.optimizer.param_groups[0]["lr"]
292
- output["other/batch_size"] = z.shape[0]
293
-
294
-
295
- accel.scaler.unscale_(state.optimizer)
296
- output["other/grad_norm"] = torch.nn.utils.clip_grad_norm_(
297
- state.model.parameters(), state.grad_clip_val
298
- )
299
-
300
- accel.step(state.optimizer)
301
- state.optimizer.zero_grad()
302
-
303
- state.scheduler.step()
304
- accel.update()
305
-
306
-
307
- return {k: v for k, v in sorted(output.items())}
308
-
309
- # def get_controls(self, sig: sn.Signal, controller):
310
- # # get controls
311
- # n_batch = sig.wav.shape[0]
312
- # if self.controller is not None:
313
- # ctrls = self.controller.extract(sig)
314
- # # draw control masks
315
- # ctrl_masks = self.controller.random_mask(
316
- # ctrls,
317
- # r=self.rng.draw(n_batch)[:, 0].to(self.device)
318
- # )
319
- # else:
320
- # ctrls = None
321
- # ctrl_masks = None
322
-
323
- # return ctrls, ctrl_masks
324
-
325
-
326
- @timer()
327
- @torch.no_grad()
328
- def val_loop(state: State, batch: dict, accel: Accelerator):
329
- state.model.eval()
330
- state.codec.eval()
331
- batch = at.util.prepare_batch(batch, accel.device)
332
- signal = apply_transform(state.val_data.transform, batch)
333
-
334
- vn = accel.unwrap(state.model)
335
- z = state.codec.encode(signal.samples, signal.sample_rate)["codes"]
336
- z = z[:, : vn.n_codebooks, :]
337
-
338
- n_batch = z.shape[0]
339
- r = state.rng.draw(n_batch)[:, 0].to(accel.device)
340
-
341
- mask = pmask.random(z, r)
342
- mask = pmask.codebook_unmask(mask, vn.n_conditioning_codebooks)
343
- z_mask, mask = pmask.apply_mask(z, mask, vn.mask_token)
344
-
345
- z_mask_latent = vn.embedding.from_codes(z_mask, state.codec)
346
-
347
- z_hat = state.model(z_mask_latent)
348
-
349
- target = codebook_flatten(
350
- z[:, vn.n_conditioning_codebooks :, :],
351
- )
352
-
353
- flat_mask = codebook_flatten(
354
- mask[:, vn.n_conditioning_codebooks :, :]
355
- )
356
-
357
- output = {}
358
- # replace target with ignore index for masked tokens
359
- t_masked = target.masked_fill(~flat_mask.bool(), IGNORE_INDEX)
360
- output["loss"] = state.criterion(z_hat, t_masked)
361
-
362
- _metrics(
363
- r=r,
364
- z_hat=z_hat,
365
- target=target,
366
- flat_mask=flat_mask,
367
- output=output,
368
- )
369
-
370
- return output
371
-
372
-
373
- def validate(state, val_dataloader, accel):
374
- for batch in val_dataloader:
375
- output = val_loop(state, batch, accel)
376
- # Consolidate state dicts if using ZeroRedundancyOptimizer
377
- if hasattr(state.optimizer, "consolidate_state_dict"):
378
- state.optimizer.consolidate_state_dict()
379
- return output
380
-
381
-
382
- def checkpoint(state, save_iters, save_path, fine_tune):
383
- if accel.local_rank != 0:
384
- state.tracker.print(f"ERROR:Skipping checkpoint on rank {accel.local_rank}")
385
- return
386
-
387
- metadata = {"logs": dict(state.tracker.history)}
388
-
389
- tags = ["latest"]
390
- state.tracker.print(f"Saving to {str(Path('.').absolute())}")
391
-
392
- if state.tracker.step in save_iters:
393
- tags.append(f"{state.tracker.step // 1000}k")
394
-
395
- if state.tracker.is_best("val", "loss"):
396
- state.tracker.print(f"Best model so far")
397
- tags.append("best")
398
-
399
- if fine_tune:
400
- for tag in tags:
401
- # save the lora model
402
- (Path(save_path) / tag).mkdir(parents=True, exist_ok=True)
403
- torch.save(
404
- lora.lora_state_dict(accel.unwrap(state.model)),
405
- f"{save_path}/{tag}/lora.pth"
406
- )
407
-
408
- for tag in tags:
409
- model_extra = {
410
- "optimizer.pth": state.optimizer.state_dict(),
411
- "scheduler.pth": state.scheduler.state_dict(),
412
- "tracker.pth": state.tracker.state_dict(),
413
- "metadata.pth": metadata,
414
- }
415
-
416
- accel.unwrap(state.model).metadata = metadata
417
- accel.unwrap(state.model).save_to_folder(
418
- f"{save_path}/{tag}", model_extra, package=False
419
- )
420
-
421
-
422
- def save_sampled(state, z, writer):
423
- num_samples = z.shape[0]
424
-
425
- for i in range(num_samples):
426
- sampled = accel.unwrap(state.model).generate(
427
- codec=state.codec,
428
- time_steps=z.shape[-1],
429
- start_tokens=z[i : i + 1],
430
- )
431
- sampled.cpu().write_audio_to_tb(
432
- f"sampled/{i}",
433
- writer,
434
- step=state.tracker.step,
435
- plot_fn=None,
436
- )
437
-
438
-
439
- def save_imputation(state, z, val_idx, writer):
440
- n_prefix = int(z.shape[-1] * 0.25)
441
- n_suffix = int(z.shape[-1] * 0.25)
442
-
443
- vn = accel.unwrap(state.model)
444
-
445
- mask = pmask.inpaint(z, n_prefix, n_suffix)
446
- mask = pmask.codebook_unmask(mask, vn.n_conditioning_codebooks)
447
- z_mask, mask = pmask.apply_mask(z, mask, vn.mask_token)
448
-
449
- imputed_noisy = vn.decode(z_mask, state.codec)
450
- imputed_true = vn.decode(z, state.codec)
451
-
452
- imputed = []
453
- for i in range(len(z)):
454
- imputed.append(
455
- vn.generate(
456
- codec=state.codec,
457
- time_steps=z.shape[-1],
458
- start_tokens=z[i][None, ...],
459
- mask=mask[i][None, ...],
460
- )
461
- )
462
- imputed = AudioSignal.batch(imputed)
463
-
464
- for i in range(len(val_idx)):
465
- imputed_noisy[i].cpu().write_audio_to_tb(
466
- f"inpainted_prompt/{i}",
467
- writer,
468
- step=state.tracker.step,
469
- plot_fn=None,
470
- )
471
- imputed[i].cpu().write_audio_to_tb(
472
- f"inpainted_middle/{i}",
473
- writer,
474
- step=state.tracker.step,
475
- plot_fn=None,
476
- )
477
- imputed_true[i].cpu().write_audio_to_tb(
478
- f"reconstructed/{i}",
479
- writer,
480
- step=state.tracker.step,
481
- plot_fn=None,
482
- )
483
-
484
-
485
- @torch.no_grad()
486
- def save_samples(state: State, val_idx: int, writer: SummaryWriter):
487
- state.model.eval()
488
- state.codec.eval()
489
- vn = accel.unwrap(state.model)
490
-
491
- batch = [state.val_data[i] for i in val_idx]
492
- batch = at.util.prepare_batch(state.val_data.collate(batch), accel.device)
493
-
494
- signal = apply_transform(state.val_data.transform, batch)
495
-
496
- z = state.codec.encode(signal.samples, signal.sample_rate)["codes"]
497
- z = z[:, : vn.n_codebooks, :]
498
-
499
- r = torch.linspace(0.1, 0.95, len(val_idx)).to(accel.device)
500
-
501
-
502
- mask = pmask.random(z, r)
503
- mask = pmask.codebook_unmask(mask, vn.n_conditioning_codebooks)
504
- z_mask, mask = pmask.apply_mask(z, mask, vn.mask_token)
505
-
506
- z_mask_latent = vn.embedding.from_codes(z_mask, state.codec)
507
-
508
- z_hat = state.model(z_mask_latent)
509
-
510
- z_pred = torch.softmax(z_hat, dim=1).argmax(dim=1)
511
- z_pred = codebook_unflatten(z_pred, n_c=vn.n_predict_codebooks)
512
- z_pred = torch.cat([z[:, : vn.n_conditioning_codebooks, :], z_pred], dim=1)
513
-
514
- generated = vn.decode(z_pred, state.codec)
515
- reconstructed = vn.decode(z, state.codec)
516
- masked = vn.decode(z_mask.squeeze(1), state.codec)
517
-
518
- for i in range(generated.batch_size):
519
- audio_dict = {
520
- "original": signal[i],
521
- "masked": masked[i],
522
- "generated": generated[i],
523
- "reconstructed": reconstructed[i],
524
- }
525
- for k, v in audio_dict.items():
526
- v.cpu().write_audio_to_tb(
527
- f"onestep/_{i}.r={r[i]:0.2f}/{k}",
528
- writer,
529
- step=state.tracker.step,
530
- plot_fn=None,
531
- )
532
-
533
- save_sampled(state=state, z=z, writer=writer)
534
- save_imputation(state=state, z=z, val_idx=val_idx, writer=writer)
535
-
536
-
537
-
538
- @argbind.bind(without_prefix=True)
539
- def load(
540
- args,
541
- accel: at.ml.Accelerator,
542
- tracker: Tracker,
543
- save_path: str,
544
- resume: bool = False,
545
- tag: str = "latest",
546
- fine_tune_checkpoint: Optional[str] = None,
547
- grad_clip_val: float = 5.0,
548
- ) -> State:
549
- codec = DAC.load(args["codec_ckpt"], map_location="cpu")
550
- codec.eval()
551
-
552
- model, v_extra = None, {}
553
-
554
- if args["fine_tune"]:
555
- assert fine_tune_checkpoint is not None, "Must provide a fine-tune checkpoint"
556
- model = torch.compile(
557
- VampNet.load(location=Path(fine_tune_checkpoint),
558
- map_location="cpu",
559
- )
560
- )
561
-
562
- if resume:
563
- kwargs = {
564
- "folder": f"{save_path}/{tag}",
565
- "map_location": "cpu",
566
- "package": False,
567
- }
568
- tracker.print(f"Loading checkpoint from {kwargs['folder']}")
569
- if (Path(kwargs["folder"]) / "vampnet").exists():
570
- model, v_extra = VampNet.load_from_folder(**kwargs)
571
- else:
572
- raise ValueError(
573
- f"Could not find a VampNet checkpoint in {kwargs['folder']}"
574
- )
575
-
576
-
577
-
578
-
579
- model = torch.compile(VampNet()) if model is None else model
580
- model = accel.prepare_model(model)
581
-
582
- # assert accel.unwrap(model).n_codebooks == codec.quantizer.n_codebooks
583
- assert (
584
- accel.unwrap(model).vocab_size == codec.quantizer.quantizers[0].codebook_size
585
- )
586
-
587
-
588
- if accel.world_size > 1:
589
- from torch.distributed.optim import ZeroRedundancyOptimizer
590
- optimizer = ZeroRedundancyOptimizer(model.parameters(), AdamW)
591
- print(f"OPTIMIZER LR is {optimizer.param_groups[0]['lr']}")
592
- else:
593
- optimizer = AdamW(model.parameters())
594
-
595
- scheduler = NoamScheduler(optimizer, d_model=accel.unwrap(model).embedding_dim)
596
- scheduler.step()
597
-
598
- if "optimizer.pth" in v_extra:
599
- optimizer.load_state_dict(v_extra["optimizer.pth"])
600
- scheduler.load_state_dict(v_extra["scheduler.pth"])
601
- if "tracker.pth" in v_extra:
602
- tracker.load_state_dict(v_extra["tracker.pth"])
603
-
604
- criterion = CrossEntropyLoss()
605
-
606
- sample_rate = codec.sample_rate
607
-
608
- # a better rng for sampling from our schedule
609
- rng = torch.quasirandom.SobolEngine(1, scramble=True, seed=args["seed"])
610
-
611
- # log a model summary w/ num params
612
- if accel.local_rank == 0:
613
- add_num_params_repr_hook(accel.unwrap(model))
614
- with open(f"{save_path}/model.txt", "w") as f:
615
- f.write(repr(accel.unwrap(model)))
616
-
617
- # load the datasets
618
- train_data, val_data = build_datasets(args, sample_rate)
619
-
620
- # controller = Sketch2SoundController(sample_rate=sample_rate, hop_length=codec.hop_length)
621
-
622
- return State(
623
- tracker=tracker,
624
- model=model,
625
- codec=codec,
626
- optimizer=optimizer,
627
- scheduler=scheduler,
628
- criterion=criterion,
629
- rng=rng,
630
- train_data=train_data,
631
- val_data=val_data,
632
- grad_clip_val=grad_clip_val,
633
- controller=None,
634
- )
635
-
636
-
637
- @argbind.bind(without_prefix=True)
638
- def train(
639
- args,
640
- accel: at.ml.Accelerator,
641
- seed: int = 0,
642
- codec_ckpt: str = None,
643
- save_path: str = "ckpt",
644
- num_iters: int = int(1000e6),
645
- save_iters: list = [10000, 50000, 100000, 300000, 500000,],
646
- sample_freq: int = 10000,
647
- val_freq: int = 1000,
648
- batch_size: int = 12,
649
- val_idx: list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
650
- num_workers: int = 10,
651
- fine_tune: bool = False,
652
- ):
653
- assert codec_ckpt is not None, "codec_ckpt is required"
654
-
655
- seed = seed + accel.local_rank
656
- at.util.seed(seed)
657
- writer = None
658
-
659
- if accel.local_rank == 0:
660
- writer = SummaryWriter(log_dir=f"{save_path}/logs/")
661
- argbind.dump_args(args, f"{save_path}/args.yml")
662
-
663
- tracker = Tracker(
664
- writer=writer, log_file=f"{save_path}/log.txt", rank=accel.local_rank
665
- )
666
-
667
- # load the codec model
668
- state: State = load(
669
- args=args,
670
- accel=accel,
671
- tracker=tracker,
672
- save_path=save_path)
673
- print("initialized state.")
674
- state.device = accel.device
675
-
676
- train_dataloader = accel.prepare_dataloader(
677
- state.train_data,
678
- start_idx=state.tracker.step * batch_size,
679
- num_workers=num_workers,
680
- batch_size=batch_size,
681
- collate_fn=state.train_data.collate,
682
- )
683
- val_dataloader = accel.prepare_dataloader(
684
- state.val_data,
685
- start_idx=0,
686
- num_workers=num_workers,
687
- batch_size=batch_size,
688
- collate_fn=state.val_data.collate,
689
- persistent_workers=num_workers > 0,
690
- )
691
- print("initialized dataloader.")
692
-
693
-
694
-
695
- if fine_tune:
696
- lora.mark_only_lora_as_trainable(state.model)
697
- print("marked only lora as trainable.")
698
-
699
- # Wrap the functions so that they neatly track in TensorBoard + progress bars
700
- # and only run when specific conditions are met.
701
- global train_loop, val_loop, validate, save_samples, checkpoint
702
-
703
- train_loop = tracker.log("train", "value", history=False)(
704
- tracker.track("train", num_iters, completed=state.tracker.step)(train_loop)
705
- )
706
- val_loop = tracker.track("val", len(val_dataloader))(val_loop)
707
- validate = tracker.log("val", "mean")(validate)
708
-
709
- save_samples = when(lambda: accel.local_rank == 0)(save_samples)
710
- checkpoint = when(lambda: accel.local_rank == 0)(checkpoint)
711
-
712
- print("starting training loop. model will compile. this will take a while. hold on a sec! go get a coffee!")
713
- with tracker.live:
714
- for tracker.step, batch in enumerate(train_dataloader, start=tracker.step):
715
- train_loop(state, batch, accel)
716
-
717
- last_iter = (
718
- tracker.step == num_iters - 1 if num_iters is not None else False
719
- )
720
-
721
- if tracker.step % sample_freq == 0 or last_iter:
722
- save_samples(state, val_idx, writer)
723
-
724
- if tracker.step % val_freq == 0 or last_iter:
725
- validate(state, val_dataloader, accel)
726
- checkpoint(
727
- state=state,
728
- save_iters=save_iters,
729
- save_path=save_path,
730
- fine_tune=fine_tune)
731
-
732
- # Reset validation progress bar, print summary since last validation.
733
- tracker.done("val", f"Iteration {tracker.step}")
734
-
735
- if last_iter:
736
- break
737
-
738
-
739
- if __name__ == "__main__":
740
- args = argbind.parse_args()
741
- args["args.debug"] = int(os.getenv("LOCAL_RANK", 0)) == 0
742
- with argbind.scope(args):
743
- with Accelerator() as accel:
744
- if accel.local_rank != 0:
745
- sys.tracebacklimit = 0
746
- train(args, accel)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/README.md DELETED
@@ -1,28 +0,0 @@
1
- # Scripts
2
-
3
- ## process_zip.py
4
-
5
- Some requirements that may not be installed in the docker image:
6
- * argbind
7
- * wav2wav (pip install git+https://github.com/descriptinc/lyrebird-wav2wav.git or `pip install git+https://github.com/descriptinc/lyrebird-wav2wav.git@<branchname>`)
8
-
9
- ### zip folder structure
10
-
11
- The zip folder should have the following internal structure:
12
-
13
- ```
14
- base_folder/
15
- test_case_1/
16
- before.wav
17
- test_case_2/
18
- before.wav
19
- ...
20
- test_case_n/
21
- before.wav
22
- ```
23
-
24
- Note: There can be issues with the output zip if the input zip folder structure is too deep or too shallow. IF you want/need to use a zip file with a different folder structure, adjust this:
25
- https://github.com/descriptinc/lyrebird-wav2wav/blob/136c923ce19df03876a515ca0ed83854710cfa30/scripts/utils/process_zip.py#L28
26
-
27
- ### Execution
28
- `python process_zip.py <path/to/zip> -tag <string>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/gtzan_embeddings.py DELETED
@@ -1,264 +0,0 @@
1
- """
2
- TODO: train a linear probe
3
- usage:
4
- python gtzan_embeddings.py --args.load conf/interface.yml --Interface.device cuda --path_to_gtzan /path/to/gtzan/genres_original --output_dir /path/to/output
5
- """
6
- from pathlib import Path
7
- from typing import List
8
-
9
- import audiotools as at
10
- from audiotools import AudioSignal
11
- import argbind
12
- import torch
13
- import numpy as np
14
- import zipfile
15
- import json
16
-
17
- from vampnet.interface import Interface
18
- import tqdm
19
-
20
- # bind the Interface to argbind
21
- Interface = argbind.bind(Interface)
22
-
23
- DEBUG = False
24
-
25
- def smart_plotly_export(fig, save_path):
26
- img_format = save_path.split('.')[-1]
27
- if img_format == 'html':
28
- fig.write_html(save_path)
29
- elif img_format == 'bytes':
30
- return fig.to_image(format='png')
31
- #TODO: come back and make this prettier
32
- elif img_format == 'numpy':
33
- import io
34
- from PIL import Image
35
-
36
- def plotly_fig2array(fig):
37
- #convert Plotly fig to an array
38
- fig_bytes = fig.to_image(format="png", width=1200, height=700)
39
- buf = io.BytesIO(fig_bytes)
40
- img = Image.open(buf)
41
- return np.asarray(img)
42
-
43
- return plotly_fig2array(fig)
44
- elif img_format == 'jpeg' or 'png' or 'webp':
45
- fig.write_image(save_path)
46
- else:
47
- raise ValueError("invalid image format")
48
-
49
- def dim_reduce(emb, labels, save_path, n_components=3, method='tsne', title=''):
50
- """
51
- dimensionality reduction for visualization!
52
- saves an html plotly figure to save_path
53
- parameters:
54
- emb (np.ndarray): the samples to be reduces with shape (samples, features)
55
- labels (list): list of labels for embedding
56
- save_path (str): path where u wanna save ur figure
57
- method (str): umap, tsne, or pca
58
- title (str): title for ur figure
59
- returns:
60
- proj (np.ndarray): projection vector with shape (samples, dimensions)
61
- """
62
- import pandas as pd
63
- import plotly.express as px
64
- if method == 'umap':
65
- from umap import UMAP
66
- reducer = umap.UMAP(n_components=n_components)
67
- elif method == 'tsne':
68
- from sklearn.manifold import TSNE
69
- reducer = TSNE(n_components=n_components)
70
- elif method == 'pca':
71
- from sklearn.decomposition import PCA
72
- reducer = PCA(n_components=n_components)
73
- else:
74
- raise ValueError
75
-
76
- proj = reducer.fit_transform(emb)
77
-
78
- if n_components == 2:
79
- df = pd.DataFrame(dict(
80
- x=proj[:, 0],
81
- y=proj[:, 1],
82
- instrument=labels
83
- ))
84
- fig = px.scatter(df, x='x', y='y', color='instrument',
85
- title=title+f"_{method}")
86
-
87
- elif n_components == 3:
88
- df = pd.DataFrame(dict(
89
- x=proj[:, 0],
90
- y=proj[:, 1],
91
- z=proj[:, 2],
92
- instrument=labels
93
- ))
94
- fig = px.scatter_3d(df, x='x', y='y', z='z',
95
- color='instrument',
96
- title=title)
97
- else:
98
- raise ValueError("cant plot more than 3 components")
99
-
100
- fig.update_traces(marker=dict(size=6,
101
- line=dict(width=1,
102
- color='DarkSlateGrey')),
103
- selector=dict(mode='markers'))
104
-
105
- return smart_plotly_export(fig, save_path)
106
-
107
-
108
-
109
- # per JukeMIR, we want the emebddings from the middle layer?
110
- def vampnet_embed(sig: AudioSignal, interface: Interface, layer=10):
111
- with torch.inference_mode():
112
- # preprocess the signal
113
- sig = interface.preprocess(sig)
114
-
115
- # get the coarse vampnet model
116
- vampnet = interface.coarse
117
-
118
- # get the tokens
119
- z = interface.encode(sig)[:, :vampnet.n_codebooks, :]
120
- z_latents = vampnet.embedding.from_codes(z, interface.codec)
121
-
122
- # do a forward pass through the model, get the embeddings
123
- _z, embeddings = vampnet(z_latents, return_activations=True)
124
- # print(f"got embeddings with shape {embeddings.shape}")
125
- # [layer, batch, time, n_dims]
126
- # [20, 1, 600ish, 768]
127
-
128
-
129
- # squeeze batch dim (1 bc layer should be dim 0)
130
- assert embeddings.shape[1] == 1, f"expected batch dim to be 1, got {embeddings.shape[0]}"
131
- embeddings = embeddings.squeeze(1)
132
-
133
- num_layers = embeddings.shape[0]
134
- assert layer < num_layers, f"layer {layer} is out of bounds for model with {num_layers} layers"
135
-
136
- # do meanpooling over the time dimension
137
- embeddings = embeddings.mean(dim=-2)
138
- # [20, 768]
139
-
140
- # return the embeddings
141
- return embeddings
142
-
143
- from dataclasses import dataclass, fields
144
- @dataclass
145
- class Embedding:
146
- genre: str
147
- filename: str
148
- embedding: np.ndarray
149
-
150
- def save(self, path):
151
- """Save the Embedding object to a given path as a zip file."""
152
- with zipfile.ZipFile(path, 'w') as archive:
153
-
154
- # Save numpy array
155
- with archive.open('embedding.npy', 'w') as f:
156
- np.save(f, self.embedding)
157
-
158
- # Save non-numpy data as json
159
- non_numpy_data = {f.name: getattr(self, f.name) for f in fields(self) if f.name != 'embedding'}
160
- with archive.open('data.json', 'w') as f:
161
- f.write(json.dumps(non_numpy_data).encode('utf-8'))
162
-
163
- @classmethod
164
- def load(cls, path):
165
- """Load the Embedding object from a given zip path."""
166
- with zipfile.ZipFile(path, 'r') as archive:
167
-
168
- # Load numpy array
169
- with archive.open('embedding.npy') as f:
170
- embedding = np.load(f)
171
-
172
- # Load non-numpy data from json
173
- with archive.open('data.json') as f:
174
- data = json.loads(f.read().decode('utf-8'))
175
-
176
- return cls(embedding=embedding, **data)
177
-
178
-
179
- @argbind.bind(without_prefix=True)
180
- def main(
181
- path_to_gtzan: str = None,
182
- cache_dir: str = "./.gtzan_emb_cache",
183
- output_dir: str = "./gtzan_vampnet_embeddings",
184
- layers: List[int] = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
185
- ):
186
- path_to_gtzan = Path(path_to_gtzan)
187
- assert path_to_gtzan.exists(), f"{path_to_gtzan} does not exist"
188
-
189
- cache_dir = Path(cache_dir)
190
- output_dir = Path(output_dir)
191
- output_dir.mkdir(exist_ok=True, parents=True)
192
-
193
- # load our interface
194
- # argbind will automatically load the default config,
195
- interface = Interface()
196
-
197
- # gtzan should have a folder for each genre, so let's get the list of genres
198
- genres = [Path(x).name for x in path_to_gtzan.iterdir() if x.is_dir()]
199
- print(f"Found {len(genres)} genres")
200
- print(f"genres: {genres}")
201
-
202
- # collect audio files, genres, and embeddings
203
- data = []
204
- for genre in genres:
205
- audio_files = list(at.util.find_audio(path_to_gtzan / genre))
206
- print(f"Found {len(audio_files)} audio files for genre {genre}")
207
-
208
- for audio_file in tqdm.tqdm(audio_files, desc=f"embedding genre {genre}"):
209
- # check if we have a cached embedding for this file
210
- cached_path = (cache_dir / f"{genre}_{audio_file.stem}.emb")
211
- if cached_path.exists():
212
- # if so, load it
213
- if DEBUG:
214
- print(f"loading cached embedding for {cached_path.stem}")
215
- embedding = Embedding.load(cached_path)
216
- else:
217
- try:
218
- sig = AudioSignal(audio_file)
219
- except Exception as e:
220
- print(f"failed to load {audio_file.name} with error {e}")
221
- print(f"skipping {audio_file.name}")
222
- continue
223
-
224
- # gets the embedding
225
- emb = vampnet_embed(sig, interface).cpu().numpy()
226
-
227
- # create an embedding we can save/load
228
- embedding = Embedding(
229
- genre=genre,
230
- filename=audio_file.name,
231
- embedding=emb
232
- )
233
-
234
- # cache the embeddings
235
- cached_path.parent.mkdir(exist_ok=True, parents=True)
236
- embedding.save(cached_path)
237
- data.append(embedding)
238
-
239
- # now, let's do a dim reduction on the embeddings
240
- # and visualize them.
241
-
242
- # collect a list of embeddings and labels
243
- embeddings = [d.embedding for d in data]
244
- labels = [d.genre for d in data]
245
-
246
- # convert the embeddings to a numpy array
247
- embeddings = np.stack(embeddings)
248
-
249
- # do dimensionality reduction for each layer we're given
250
- for layer in tqdm.tqdm(layers, desc="dim reduction"):
251
- dim_reduce(
252
- embeddings[:, layer, :], labels,
253
- save_path=str(output_dir / f'vampnet-gtzan-layer={layer}.html'),
254
- n_components=2, method='tsne',
255
- title=f'vampnet-gtzan-layer={layer}'
256
- )
257
-
258
-
259
-
260
-
261
- if __name__ == "__main__":
262
- args = argbind.parse_args()
263
- with argbind.scope(args):
264
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/huggingface/push_to_repos.sh DELETED
@@ -1,37 +0,0 @@
1
- # the (remote repo, model_name) are:
2
- # vampnet-music (default)
3
- # vampnet-percussion (percussion)
4
- # vampnet-choir ()'choir')
5
- # etc for..
6
- # 'machines'
7
- # 'n64'
8
- # 'opera'
9
- # 'percussion'
10
-
11
- # iterate through remote, model_name pairs:
12
- # and edit the DEFAULT_MODEL file in the repo
13
- # add commit and push to the right remote
14
- # each remote starts with https://huggingface.co/hugggof/{repo_name}
15
-
16
- for repo in vampnet-music vampnet-percussion vampnet-choir vampnet-machines vampnet-n64 vampnet-opera vampnet-percussion
17
- do
18
- echo "repo: $repo"
19
- # get the model name from the repo
20
- model_name=$(echo $repo | cut -d'-' -f2)
21
- # if the model_name is music , set it to default
22
- if [ $model_name == "music" ]; then
23
- model_name="default"
24
- fi
25
- echo "model_name: $model_name"
26
- # remove the DEFAULT_MODEL file
27
- rm DEFAULT_MODEL
28
- # create a new DEFAULT_MODEL file with the model name
29
- echo $model_name > DEFAULT_MODEL
30
-
31
- # commit and push to the right remote
32
- git add DEFAULT_MODEL
33
- git commit -m "update DEFAULT_MODEL to $model_name"
34
- git remote remove $repo
35
- git remote add $repo https://huggingface.co/spaces/hugggof/$repo
36
- git push $repo main
37
- done
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/plots.py DELETED
@@ -1,43 +0,0 @@
1
- import matplotlib.pyplot as plt
2
- import seaborn as sns
3
- from pandas.api.types import CategoricalDtype
4
-
5
- def plot_metrics(metrics, condition_to_latex, title, color_palette):
6
- # Add a new column to your dataframe with the latex representation
7
- metrics['condition_latex'] = metrics['condition'].map(condition_to_latex)
8
-
9
- # Order condition_latex as per the condition_to_latex dictionary
10
- cat_type = CategoricalDtype(categories=condition_to_latex.values(), ordered=True)
11
- metrics['condition_latex'] = metrics['condition_latex'].astype(cat_type)
12
-
13
- # Compute mean and std for each condition for each metric
14
- grouped = metrics.groupby('condition_latex')[['mel', 'frechet']].agg(['mean', 'std'])
15
-
16
- fig, axs = plt.subplots(2, 1, figsize=(7, 5.25))
17
-
18
- # Set the main title for the figure
19
- fig.suptitle(title, fontsize=16)
20
-
21
- # Get color for each bar in the plot
22
- bar_colors = [color_palette[condition] for condition in grouped.index]
23
-
24
- # Plot mel
25
- sns.boxplot(x='condition_latex', y='mel', data=metrics, ax=axs[0], palette=color_palette, showfliers=False)
26
- axs[0].set_ylabel('Mel Spectrogram Loss \u2190')
27
- axs[0].set_xlabel('') # Remove x-axis label
28
- axs[0].set_xticklabels(grouped.index, rotation=0, ha='center')
29
-
30
- # Plot frechet
31
- axs[1].bar(grouped.index, grouped['frechet']['mean'], yerr=grouped['frechet']['std'], color=bar_colors)
32
- axs[1].set_ylabel('FAD \u2190')
33
- axs[1].set_xlabel('') # Remove x-axis label
34
- axs[1].set_xticklabels(grouped.index, rotation=0, ha='center')
35
-
36
- # Adjust the space between plots
37
- plt.subplots_adjust(hspace=0.1)
38
-
39
- # Remove any unnecessary space around the plot
40
- plt.tight_layout(rect=[0, 0, 1, 0.96])
41
-
42
- # Reduce the space between suptitle and the plot
43
- plt.subplots_adjust(top=0.92)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/remove_quiet_files.py DELETED
@@ -1,29 +0,0 @@
1
- # removes files with loudness below 24db
2
-
3
- from pathlib import Path
4
- import shutil
5
- import audiotools as at
6
- import argbind
7
-
8
- @argbind.bind(without_prefix=True)
9
- def remove_quiet_files(
10
- src_dir: Path = None,
11
- dest_dir: Path = None,
12
- min_loudness: float = -30,
13
- ):
14
- # copy src to dest
15
- dest_dir.mkdir(parents=True, exist_ok=True)
16
- shutil.copytree(src_dir, dest_dir, dirs_exist_ok=True)
17
-
18
- audio_files = at.util.find_audio(dest_dir)
19
- for audio_file in audio_files:
20
- sig = at.AudioSignal(audio_file)
21
- if sig.loudness() < min_loudness:
22
- audio_file.unlink()
23
- print(f"removed {audio_file}")
24
-
25
- if __name__ == "__main__":
26
- args = argbind.parse_args()
27
-
28
- with argbind.scope(args):
29
- remove_quiet_files()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/split.py DELETED
@@ -1,66 +0,0 @@
1
- from pathlib import Path
2
- import random
3
- import shutil
4
- import os
5
- import json
6
-
7
- import argbind
8
- from tqdm import tqdm
9
- from tqdm.contrib.concurrent import thread_map
10
-
11
- from audiotools.core import util
12
-
13
-
14
- @argbind.bind(without_prefix=True)
15
- def train_test_split(
16
- audio_folder: str = ".",
17
- test_size: float = 0.2,
18
- seed: int = 42,
19
- ):
20
- print(f"finding audio")
21
-
22
- audio_folder = Path(audio_folder)
23
- audio_files = util.find_audio(audio_folder)
24
- print(f"found {len(audio_files)} audio files")
25
-
26
- # split according to test_size
27
- n_test = int(len(audio_files) * test_size)
28
- n_train = len(audio_files) - n_test
29
-
30
- # shuffle
31
- random.seed(seed)
32
- random.shuffle(audio_files)
33
-
34
- train_files = audio_files[:n_train]
35
- test_files = audio_files[n_train:]
36
-
37
-
38
- print(f"Train files: {len(train_files)}")
39
- print(f"Test files: {len(test_files)}")
40
- continue_ = input("Continue [yn]? ") or "n"
41
-
42
- if continue_ != "y":
43
- return
44
-
45
- for split, files in (
46
- ("train", train_files), ("test", test_files)
47
- ):
48
- for file in tqdm(files):
49
- out_file = audio_folder.parent / f"{audio_folder.name}-{split}" / Path(file).name
50
- out_file.parent.mkdir(exist_ok=True, parents=True)
51
- try:
52
- os.symlink(file, out_file)
53
- except FileExistsError:
54
- print(f"File {out_file} already exists, skipping")
55
-
56
- # save split as json
57
- with open(Path(audio_folder) / f"{split}.json", "w") as f:
58
- json.dump([str(f) for f in files], f)
59
-
60
-
61
-
62
- if __name__ == "__main__":
63
- args = argbind.parse_args()
64
-
65
- with argbind.scope(args):
66
- train_test_split()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/split_long_audio_file.py DELETED
@@ -1,34 +0,0 @@
1
- from pathlib import Path
2
- import argbind
3
-
4
- import audiotools as at
5
- import tqdm
6
-
7
-
8
- @argbind.bind(without_prefix=True)
9
- def split_long_audio_file(
10
- file: str = None,
11
- max_chunk_size_s: int = 60*10
12
- ):
13
- file = Path(file)
14
- output_dir = file.parent / file.stem
15
- output_dir.mkdir()
16
-
17
- sig = at.AudioSignal(file)
18
-
19
- # split into chunks
20
- for i, sig in tqdm.tqdm(enumerate(sig.windows(
21
- window_duration=max_chunk_size_s, hop_duration=max_chunk_size_s/2,
22
- preprocess=True))
23
- ):
24
- sig.write(output_dir / f"{i}.wav")
25
-
26
- print(f"wrote {len(list(output_dir.glob('*.wav')))} files to {output_dir}")
27
-
28
- return output_dir
29
-
30
- if __name__ == "__main__":
31
- args = argbind.parse_args()
32
-
33
- with argbind.scope(args):
34
- split_long_audio_file()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/stage.py DELETED
@@ -1,30 +0,0 @@
1
- import os
2
- import subprocess
3
- from pathlib import Path
4
-
5
- import argbind
6
- import rich
7
- from audiotools.ml import Experiment
8
-
9
-
10
- @argbind.bind(without_prefix=True)
11
- def run(
12
- run_dir: str = os.getenv("PATH_TO_RUNS", "runs"),
13
- name: str = None,
14
- recent: bool = False,
15
- ):
16
- if recent:
17
- paths = sorted(Path(run_dir).iterdir(), key=os.path.getmtime)
18
- paths = [p.name for p in paths if p.is_dir()]
19
- if paths:
20
- name = paths[-1]
21
-
22
- with Experiment(run_dir, name) as exp:
23
- exp.snapshot()
24
- rich.print(f"Created a snapshot of {exp.parent_directory} at {exp.exp_dir}")
25
-
26
-
27
- if __name__ == "__main__":
28
- args = argbind.parse_args()
29
- with argbind.scope(args):
30
- run()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/visualize_embeddings.py DELETED
@@ -1,265 +0,0 @@
1
- """
2
- TODO: train a linear probe
3
- usage:
4
- python gtzan_embeddings.py --args.load conf/interface.yml --Interface.device cuda --path_to_audio /path/to/audio/labels --output_dir /path/to/output
5
- """
6
- from pathlib import Path
7
- from typing import List
8
-
9
- import audiotools as at
10
- from audiotools import AudioSignal
11
- import argbind
12
- import torch
13
- import numpy as np
14
- import zipfile
15
- import json
16
-
17
- from vampnet.interface import Interface
18
- import tqdm
19
-
20
- # bind the Interface to argbind
21
- Interface = argbind.bind(Interface)
22
-
23
- DEBUG = False
24
-
25
-
26
- def smart_plotly_export(fig, save_path: Path):
27
- img_format = save_path.suffix[1:]
28
- if img_format == "html":
29
- fig.write_html(save_path)
30
- elif img_format == 'bytes':
31
- return fig.to_image(format='png')
32
- #TODO: come back and make this prettier
33
- elif img_format == 'numpy':
34
- import io
35
- from PIL import Image
36
-
37
- def plotly_fig2array(fig):
38
- #convert Plotly fig to an array
39
- fig_bytes = fig.to_image(format="png", width=1200, height=700)
40
- buf = io.BytesIO(fig_bytes)
41
- img = Image.open(buf)
42
- return np.asarray(img)
43
-
44
- return plotly_fig2array(fig)
45
- elif img_format == 'jpeg' or 'png' or 'webp':
46
- fig.write_image(save_path)
47
- else:
48
- raise ValueError("invalid image format")
49
-
50
-
51
- def dim_reduce(annotated_embeddings, layer, output_dir, n_components=3, method="tsne"):
52
- """
53
- dimensionality reduction for visualization!
54
- saves an html plotly figure to save_path
55
- parameters:
56
- annotated_embeddings (list): the annotated enmbeddings to be reduced; embeddings have shape (samples, features)
57
- labels (list): list of labels for embedding
58
- save_path (str): path where u wanna save ur figure
59
- method (str): umap, tsne, or pca
60
- title (str): title for ur figure
61
- returns:
62
- proj (np.ndarray): projection vector with shape (samples, dimensions)
63
- """
64
- import pandas as pd
65
- import plotly.express as px
66
-
67
- fig_name = f"vampnet-embeddings-layer={layer}"
68
- fig_title = f"{fig_name}_{method}"
69
- save_path = (output_dir / fig_name).with_suffix(".html")
70
-
71
- if method == "umap":
72
- from umap import UMAP
73
- reducer = umap.UMAP(n_components=n_components)
74
- elif method == "tsne":
75
- from sklearn.manifold import TSNE
76
-
77
- reducer = TSNE(n_components=n_components)
78
- elif method == "pca":
79
- from sklearn.decomposition import PCA
80
-
81
- reducer = PCA(n_components=n_components)
82
- else:
83
- raise ValueError(f"invalid method: {method}")
84
-
85
- labels = [emb.label for emb in annotated_embeddings]
86
- names = [emb.filename for emb in annotated_embeddings]
87
- embs = [emb.embedding for emb in annotated_embeddings]
88
- embs_at_layer = np.stack(embs)[:, layer, :]
89
- projs = reducer.fit_transform(embs_at_layer)
90
-
91
- df = pd.DataFrame(
92
- {
93
- "label": labels,
94
- "name": names,
95
- "x": projs[:, 0],
96
- "y": projs[:, 1],
97
- }
98
- )
99
- if n_components == 2:
100
- fig = px.scatter(
101
- df, x="x", y="y", color="label", hover_name="name", title=fig_title,
102
- )
103
-
104
- elif n_components == 3:
105
- df['z'] = projs[:, 2]
106
- fig = px.scatter_3d(
107
- df, x="x", y="y", z="z", color="label", hover_name="name", title=fig_title
108
- )
109
- else:
110
- raise ValueError(f"can't plot {n_components} components")
111
-
112
- fig.update_traces(
113
- marker=dict(size=6, line=dict(width=1, color="DarkSlateGrey")),
114
- selector=dict(mode="markers"),
115
- )
116
-
117
- return smart_plotly_export(fig, save_path)
118
-
119
-
120
-
121
- # per JukeMIR, we want the emebddings from the middle layer?
122
- def vampnet_embed(sig: AudioSignal, interface: Interface, layer=10):
123
- with torch.inference_mode():
124
- # preprocess the signal
125
- sig = interface.preprocess(sig)
126
-
127
- # get the coarse vampnet model
128
- vampnet = interface.coarse
129
-
130
- # get the tokens
131
- z = interface.encode(sig)[:, :vampnet.n_codebooks, :]
132
- z_latents = vampnet.embedding.from_codes(z, interface.codec)
133
-
134
- # do a forward pass through the model, get the embeddings
135
- _z, embeddings = vampnet(z_latents, return_activations=True)
136
- # print(f"got embeddings with shape {embeddings.shape}")
137
- # [layer, batch, time, n_dims]
138
- # [20, 1, 600ish, 768]
139
-
140
-
141
- # squeeze batch dim (1 bc layer should be dim 0)
142
- assert embeddings.shape[1] == 1, f"expected batch dim to be 1, got {embeddings.shape[0]}"
143
- embeddings = embeddings.squeeze(1)
144
-
145
- num_layers = embeddings.shape[0]
146
- assert layer < num_layers, f"layer {layer} is out of bounds for model with {num_layers} layers"
147
-
148
- # do meanpooling over the time dimension
149
- embeddings = embeddings.mean(dim=-2)
150
- # [20, 768]
151
-
152
- # return the embeddings
153
- return embeddings
154
-
155
- from dataclasses import dataclass, fields
156
- @dataclass
157
- class AnnotatedEmbedding:
158
- label: str
159
- filename: str
160
- embedding: np.ndarray
161
-
162
- def save(self, path):
163
- """Save the Embedding object to a given path as a zip file."""
164
- with zipfile.ZipFile(path, 'w') as archive:
165
-
166
- # Save numpy array
167
- with archive.open('embedding.npy', 'w') as f:
168
- np.save(f, self.embedding)
169
-
170
- # Save non-numpy data as json
171
- non_numpy_data = {f.name: getattr(self, f.name) for f in fields(self) if f.name != 'embedding'}
172
- with archive.open('data.json', 'w') as f:
173
- f.write(json.dumps(non_numpy_data).encode('utf-8'))
174
-
175
- @classmethod
176
- def load(cls, path):
177
- """Load the Embedding object from a given zip path."""
178
- with zipfile.ZipFile(path, 'r') as archive:
179
-
180
- # Load numpy array
181
- with archive.open('embedding.npy') as f:
182
- embedding = np.load(f)
183
-
184
- # Load non-numpy data from json
185
- with archive.open('data.json') as f:
186
- data = json.loads(f.read().decode('utf-8'))
187
-
188
- return cls(embedding=embedding, **data)
189
-
190
-
191
- @argbind.bind(without_prefix=True)
192
- def main(
193
- path_to_audio: str = None,
194
- cache_dir: str = "./.emb_cache",
195
- output_dir: str = "./vampnet_embeddings",
196
- layers: List[int] = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19],
197
- method: str = "tsne",
198
- n_components: int = 2,
199
- ):
200
- path_to_audio = Path(path_to_audio)
201
- assert path_to_audio.exists(), f"{path_to_audio} does not exist"
202
-
203
- cache_dir = Path(cache_dir)
204
- output_dir = Path(output_dir)
205
- output_dir.mkdir(exist_ok=True, parents=True)
206
-
207
- # load our interface
208
- # argbind will automatically load the default config,
209
- interface = Interface()
210
-
211
- # we expect path_to_audio to consist of a folder for each label, so let's get the list of labels
212
- labels = [Path(x).name for x in path_to_audio.iterdir() if x.is_dir()]
213
- print(f"Found {len(labels)} labels")
214
- print(f"labels: {labels}")
215
-
216
- # collect audio files, labels, and embeddings
217
- annotated_embeddings = []
218
- for label in labels:
219
- audio_files = list(at.util.find_audio(path_to_audio / label))
220
- print(f"Found {len(audio_files)} audio files for label {label}")
221
-
222
- for audio_file in tqdm.tqdm(audio_files, desc=f"embedding label {label}"):
223
- # check if we have a cached embedding for this file
224
- cached_path = cache_dir / f"{label}_{audio_file.stem}.emb"
225
- if cached_path.exists():
226
- # if so, load it
227
- if DEBUG:
228
- print(f"loading cached embedding for {cached_path.stem}")
229
- embedding = AnnotatedEmbedding.load(cached_path)
230
- else:
231
- try:
232
- sig = AudioSignal(audio_file)
233
- except Exception as e:
234
- print(f"failed to load {audio_file.name} with error {e}")
235
- print(f"skipping {audio_file.name}")
236
- continue
237
-
238
- # gets the embedding
239
- emb = vampnet_embed(sig, interface).cpu().numpy()
240
-
241
- # create an embedding we can save/load
242
- embedding = AnnotatedEmbedding(
243
- label=label, filename=audio_file.name, embedding=emb
244
- )
245
-
246
- # cache the embeddings
247
- cached_path.parent.mkdir(exist_ok=True, parents=True)
248
- embedding.save(cached_path)
249
- annotated_embeddings.append(embedding)
250
-
251
- # now, let's do a dim reduction on the embeddings and visualize them.
252
- for layer in tqdm.tqdm(layers, desc="dim reduction"):
253
- dim_reduce(
254
- annotated_embeddings,
255
- layer,
256
- output_dir=output_dir,
257
- n_components=n_components,
258
- method=method,
259
- )
260
-
261
-
262
- if __name__ == "__main__":
263
- args = argbind.parse_args()
264
- with argbind.scope(args):
265
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/utils/xeno-canto-dl.py DELETED
@@ -1,234 +0,0 @@
1
- from xenopy import Query
2
-
3
-
4
- SPECIES = [
5
- "American Robin",
6
- "Northern Cardinal",
7
- "Mourning Dove",
8
- "American Crow",
9
- "Baltimore Oriole",
10
- "Blue Jay",
11
- "Eastern Bluebird",
12
- "House Finch",
13
- "American Goldfinch",
14
- "House Sparrow",
15
- "Song Sparrow",
16
- "Tufted Titmouse",
17
- "White-breasted Nuthatch",
18
- "European Starling",
19
- "American Redstart",
20
- "Red-winged Blackbird",
21
- "Brown-headed Cowbird",
22
- "Common Grackle",
23
- "Boat-tailed Grackle",
24
- "Common Yellowthroat",
25
- "Northern Mockingbird",
26
- "Carolina Wren",
27
- "Eastern Meadowlark",
28
- "Chipping Sparrow",
29
- "Tree Swallow",
30
- "Barn Swallow",
31
- "Cliff Swallow",
32
- "Pine Siskin",
33
- "Indigo Bunting",
34
- "Eastern Towhee",
35
- "Carolina Chickadee",
36
- "Great Crested Flycatcher",
37
- "Eastern Wood-Pewee",
38
- "Ovenbird",
39
- "Northern Flicker",
40
- "Red-eyed Vireo",
41
- "American Woodcock",
42
- "Eastern Phoebe",
43
- "Downy Woodpecker",
44
- "Scarlet Tanager",
45
- "Yellow Warbler",
46
- "White-eyed Vireo",
47
- "Common Loon",
48
- "White-throated Sparrow",
49
- "Yellow-throated Vireo",
50
- "Great Blue Heron",
51
- "Belted Kingfisher",
52
- "Pied-billed Grebe",
53
- "Wild Turkey",
54
- "Wood Thrush",
55
- "Rose-breasted Grosbeak",
56
- "Field Sparrow",
57
- "Hooded Warbler",
58
- "Northern Parula",
59
- "Chestnut-sided Warbler",
60
- "Blue-winged Warbler",
61
- "Red-bellied Woodpecker",
62
- "Yellow-billed Cuckoo",
63
- "Gray Catbird",
64
- "Northern Saw-whet Owl",
65
- "Osprey",
66
- "Common Nighthawk",
67
- "Broad-winged Hawk",
68
- "Black-throated Green Warbler",
69
- "Great Horned Owl",
70
- "Common Raven",
71
- "Barred Owl",
72
- "Canada Warbler",
73
- "Magnolia Warbler",
74
- "Black-and-white Warbler",
75
- "Eastern Kingbird",
76
- "Swainson's Thrush",
77
- "Worm-eating Warbler",
78
- "Prairie Warbler",
79
- "Baltimore Oriole",
80
- "Black-throated Blue Warbler",
81
- "Louisiana Waterthrush",
82
- "Blackburnian Warbler",
83
- "Black-capped Chickadee",
84
- "Cerulean Warbler",
85
- "Red-shouldered Hawk",
86
- "Cooper's Hawk",
87
- "Yellow-throated Warbler",
88
- "Blue-headed Vireo",
89
- "Blackpoll Warbler",
90
- "Ruffed Grouse",
91
- "Kentucky Warbler",
92
- "Hermit Thrush",
93
- "Cedar Waxwing",
94
- "Eastern Screech-Owl",
95
- "Northern Goshawk",
96
- "Green Heron",
97
- "Red-tailed Hawk",
98
- "Black Vulture",
99
- "Hairy Woodpecker",
100
- "Golden-crowned Kinglet",
101
- "Ruby-crowned Kinglet",
102
- "Bicknell's Thrush",
103
- "Blue-gray Gnatcatcher",
104
- "Veery",
105
- "Pileated Woodpecker",
106
- "Purple Finch",
107
- "White-crowned Sparrow",
108
- "Snow Bunting",
109
- "Pine Grosbeak",
110
- "American Tree Sparrow",
111
- "Dark-eyed Junco",
112
- "Snowy Owl",
113
- "White-winged Crossbill",
114
- "Red Crossbill",
115
- "Common Redpoll",
116
- "Northern Shrike",
117
- "Northern Harrier",
118
- "Rough-legged Hawk",
119
- "Long-eared Owl",
120
- "Evening Grosbeak",
121
- "Northern Pintail",
122
- "American Black Duck",
123
- "Mallard",
124
- "Canvasback",
125
- "Redhead",
126
- "Ring-necked Duck",
127
- "Greater Scaup",
128
- "Lesser Scaup",
129
- "Bufflehead",
130
- "Common Goldeneye",
131
- "Hooded Merganser",
132
- "Common Merganser",
133
- "Red-breasted Merganser",
134
- "Ruddy Duck",
135
- "Wood Duck",
136
- "Gadwall",
137
- "American Wigeon",
138
- "Northern Shoveler",
139
- "Green-winged Teal",
140
- "Blue-winged Teal",
141
- "Cinnamon Teal",
142
- "Ringed Teal",
143
- "Cape Teal",
144
- "Northern Fulmar",
145
- "Yellow-billed Loon",
146
- "Red-throated Loon",
147
- "Arctic Loon",
148
- "Pacific Loon",
149
- "Horned Grebe",
150
- "Red-necked Grebe",
151
- "Eared Grebe",
152
- "Western Grebe",
153
- "Clark's Grebe",
154
- "Double-crested Cormorant",
155
- "Pelagic Cormorant",
156
- "Great Cormorant",
157
- "American White Pelican",
158
- "Brown Pelican",
159
- "Brandt's Cormorant",
160
- "Least Bittern",
161
- "Great Egret",
162
- "Snowy Egret",
163
- "Little Blue Heron",
164
- "Tricolored Heron",
165
- "Reddish Egret",
166
- "Black-crowned Night-Heron",
167
- "Yellow-crowned Night-Heron",
168
- "White Ibis",
169
- "Glossy Ibis",
170
- "Roseate Spoonbill",
171
- "Wood Stork",
172
- "Black-bellied Whistling-Duck",
173
- "Fulvous Whistling-Duck",
174
- "Greater White-fronted Goose",
175
- "Snow Goose",
176
- "Ross's Goose",
177
- "Canada Goose",
178
- "Brant",
179
- "Mute Swan",
180
- "Tundra Swan",
181
- "Whooper Swan",
182
- "Sandhill Crane",
183
- "Black-necked Stilt",
184
- "American Avocet",
185
- "Northern Jacana",
186
- "Greater Yellowlegs",
187
- "Lesser Yellowlegs",
188
- "Willet",
189
- "Spotted Sandpiper",
190
- "Upland Sandpiper",
191
- "Whimbrel",
192
- "Long-billed Curlew",
193
- "Marbled Godwit",
194
- "Ruddy Turnstone",
195
- "Red Knot",
196
- "Sanderling",
197
- "Semipalmated Sandpiper",
198
- "Western Sandpiper",
199
- "Least Sandpiper",
200
- "White-rumped Sandpiper",
201
- "Baird's Sandpiper",
202
- "Pectoral Sandpiper",
203
- "Dunlin",
204
- "Buff-breasted Sandpiper",
205
- "Short-billed Dowitcher",
206
- "Long-billed Dowitcher",
207
- "Common Snipe",
208
- "American Woodcock",
209
- "Wilson's Phalarope",
210
- "Red-necked Phalarope",
211
- "Red Phalarope"
212
- ]
213
-
214
- from pathlib import Path
215
-
216
- def remove_spaces(s):
217
- return s.replace(" ", "")
218
-
219
- for species in SPECIES:
220
- if Path("/media/CHONK/hugo/xeno-canto-full/" + remove_spaces(species)).exists():
221
- continue
222
- try:
223
- q = Query(
224
- name=species, q="A", length="10-30",
225
- )
226
-
227
- # retrieve metadata
228
- metafiles = q.retrieve_meta(verbose=True)
229
- # retrieve recordings
230
- q.retrieve_recordings(multiprocess=True, nproc=10, attempts=10, outdir="/media/CHONK/hugo/xeno-canto-full/")
231
-
232
- except:
233
- print("Failed to download " + species)
234
- continue
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
token_telephone/tt.py DELETED
@@ -1,618 +0,0 @@
1
- from ttutil import hsv_to_rgb, dbg, log, set_debug, pow2db, db2pow
2
- from dataclasses import dataclass, field
3
- import os
4
- from pathlib import Path
5
- import random
6
- import time
7
- from threading import Thread
8
- import gc
9
- gc.disable()
10
-
11
- import sounddevice as sd
12
-
13
- from blessed import Terminal
14
-
15
- import numpy as np
16
- import torch
17
- from einops import rearrange
18
-
19
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
- # ~~~~~~ configs! ~~~~~~~~
21
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22
-
23
- MAX_LOUDNESS = -20
24
- MIN_LOUDNESS = -40
25
- COLS = 40
26
- ROWS = 13
27
-
28
- device = 'Scarlett 4i4 4th Gen'
29
- sample_rate = 48000
30
- num_channels = 4
31
- blocksize = 16384
32
-
33
- PROFILE = False
34
- DEBUG = False
35
- DEBUG_NO_VAMPNET = False
36
- set_debug(DEBUG)
37
-
38
- # if DEBUG:
39
- # import gc
40
- # # log when gc start and stops
41
- # gc.set_debug(gc.DEBUG_STATS)
42
-
43
- @dataclass
44
- class LoadState:
45
- t0: float = None
46
- loaded: bool = False
47
-
48
- load_state = LoadState()
49
-
50
- def on_random_color():
51
- def random_rgb_bg():
52
- return np.random.randint(0, 255), np.random.randint(0, 255), np.random.randint(0, 255)
53
- return term.on_color_rgb(*random_rgb_bg())
54
-
55
- # draw the intro screen before slow imports
56
- def color_tokenize_txt(text: str):
57
- # apply a random bg color to each letter
58
- return "".join(on_random_color()(letter) for letter in text)
59
-
60
- def color_tokenize_words(text: str):
61
- return " ".join(on_random_color()(word) for word in text.split(" "))
62
-
63
- def draw_intro_screen():
64
- global load_state
65
- load_state.t0 = time.time()
66
- avg_time = 20 # average loading time
67
-
68
- while not load_state.loaded:
69
- print(term.clear)
70
- print(term.move_xy(0, 1) + term.center(color_tokenize_words("hugo flores garcía")))
71
- print(term.move_xy(0, 3) + term.center(color_tokenize_words("and")))
72
- print(term.move_xy(0, 5) + term.center(color_tokenize_words("stephan moore")))
73
- print(term.move_xy(0, 7) + term.center(color_tokenize_words("present")))
74
- print(term.move_xy(0, 9) + term.center(term.bold(color_tokenize_txt("token telephone"))))
75
-
76
- # print(term.move_xy(0, 10) + term.center(color_tokenize_txt("loading ")), end="")
77
- # make a little loading bar
78
- elapsed = time.time() - load_state.t0
79
- num_dots = int((elapsed / avg_time) * 20)
80
- num_spaces = 20 - num_dots
81
- print(term.move_xy(0, 12) + term.center(color_tokenize_words("loading")))
82
- print(term.move_xy(0, 13) + term.center(color_tokenize_txt(f"[{'.' * num_dots}") + f"{' ' * num_spaces}]"))
83
- time.sleep(0.3)
84
-
85
- log(f"loading took {time.time() - load_state.t0} seconds")
86
- return
87
-
88
- # the program
89
- term = Terminal()
90
-
91
- # draw the intro screen on a background thread
92
- Thread(target=draw_intro_screen).start()
93
-
94
- # disable garbage collection
95
- from audiotools import AudioSignal
96
- from vamp_helper import load_interface, ez_variation
97
-
98
-
99
-
100
- # TODO:
101
- # still some quirks to work around recording time:
102
- # do we wanna stop recording and wait a full cycle before letting people record again?
103
- # how do we wanna balance the volume of a new input vs what's currently gonig on?
104
- # should people have to take turns in between new loops?
105
- # otherwise, we're doing great i think
106
- # we also need to add a crossfade. This means maybe cutting off the last 0.1 seconds of the loop, and the beginning 0.1
107
- # and use that to crossfade.
108
-
109
- # TODO: do I wanna train a diff model to swap every 2hrs or something?
110
- # how lond does model swapping take? how can I make it faster?
111
-
112
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
- # ~~~~~~ looper ~~~~~~~~
114
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
-
116
- @dataclass
117
- class State:
118
- # looper state
119
- feedback: float = 0.25
120
- duration: float = 5.0
121
- record_channel: int = 0
122
-
123
- loopbuf: np.ndarray = None # the main loop buffer. the token telephone audio is here
124
- looper_in: np.ndarray = None # a buffer that stores the audio that's being recorded
125
-
126
- buf_in: np.ndarray = None # the input block with audio samples in the audio callbac
127
- lookback_buf: np.ndarray = None # stores some lookback audio for when the threshold is passed, to propery capture transients
128
-
129
- recording: bool = False
130
- playing: bool = False
131
-
132
- # ramps
133
- record_ramp_in: bool = False
134
- record_ramp_out: bool = False
135
-
136
- # n_record_layers: int = 2 # number of times we'll record over before clearing
137
- # cur_rec_layer: int = 0
138
- recording_locked: bool = False
139
-
140
- rec_time: float = 0
141
- cur_hold_time: float = None
142
- pos: int = 0
143
- rms_db: float = float("-inf")
144
-
145
- trig_threshold_db = -25 # a more sane default is -20
146
- hold_seconds = 1.0
147
- rel_threshold_db = -40 # a more sane default is -30
148
-
149
- status: str = field(default=None)
150
-
151
- # token telephone configs
152
- z_buf: torch.Tensor = None
153
- input_ready = False
154
- input_channel = 0
155
- token_telephone_processing: bool = False
156
- num_telephone_chans = 4
157
- tt_cur_ch = 0
158
-
159
- def __post_init__(self):
160
- self.loopbuf = np.zeros((num_channels, int(self.duration * sample_rate)))
161
- self.looper_in = np.zeros((1, int(self.duration * sample_rate)))
162
-
163
- # hold 200ms of lookback to account for rising attacks.
164
- num_lookback_samples = max(int(sample_rate * 0.2), int(blocksize))
165
- log(f"num_lookback_samples {num_lookback_samples} ({num_lookback_samples / sample_rate} seconds)")
166
- self.lookback_buf = np.zeros((1, num_lookback_samples))
167
-
168
- self.buf_in = np.zeros((num_channels, blocksize))
169
-
170
-
171
-
172
- def check_if_record(st: State, ain: np.ndarray, on_release_callback=None):
173
- # get our rms value
174
- rms = pow2db(np.sqrt(np.mean(ain**2)))
175
- st.rms_db = rms
176
-
177
- # determine if we should ater the looper state
178
- # if we werent recording and we cross the trigger threshold
179
- # start recording
180
- # if not st.recording and rms > st.trig_threshold_db and not st.recording_locked:
181
- if not st.recording and rms > st.trig_threshold_db and not st.recording_locked:
182
- st.recording = True
183
- st.record_ramp_in = True
184
-
185
- # if we were recording and we cross the release threshold
186
- # begin the hold period
187
- if (st.recording and rms < st.rel_threshold_db) or st.rec_time > (st.duration-st.hold_seconds):
188
- # if we dont have a hold time, set it
189
- if st.cur_hold_time is None:
190
- st.cur_hold_time = time.time()
191
-
192
- # release if we have a hold time and we've held for the required time,
193
- if (time.time() - st.cur_hold_time) > st.hold_seconds:
194
- st.record_ramp_out = True
195
- st.rec_time = 0
196
- if on_release_callback is not None:
197
- st.input_ready = True
198
- on_release_callback(st)
199
- st.cur_hold_time = None
200
- else:
201
- pass
202
- else:
203
- st.cur_hold_time = None
204
-
205
-
206
- def launch_token_telephone(st: State):
207
- if interface is None:
208
- log("no interface loaded, can't do token telephone!")
209
- time.sleep(10)
210
- return
211
-
212
- # if we're already processing, do nothing
213
- if st.token_telephone_processing:
214
- return
215
- else:
216
- log("starting token telephone!")
217
- Thread(target=do_token_telephone, args=(st,)).start()
218
-
219
-
220
- def do_token_telephone(st: State,):
221
- st.token_telephone_processing = True
222
- while True:
223
- lrc = st.record_channel
224
- t0 = time.time()
225
- cur_ch = st.tt_cur_ch
226
-
227
- # if there was input ready, start back from the top.
228
- if st.input_ready:
229
- log(f"there was input ready, processing!")
230
- # NOTE: hugo, trying something new here. what happens if
231
- # we don't reset the channel when input is ready,
232
- # and instead let it come in anywhere in the cycle?
233
- # st.tt_cur_ch = 0 # uncomment to go back to reality
234
-
235
- # clear the lrc, reset for next record.
236
- st.input_ready = False
237
-
238
- # reocrd the channel that we'll be processing in and lock recording
239
- st.input_channel = cur_ch
240
- st.recording_locked = True
241
-
242
- # first, let's preprocess looper in
243
- sig_looper_in = AudioSignal(
244
- torch.from_numpy(st.looper_in).unsqueeze(0),
245
- sample_rate=sample_rate
246
- )
247
- sig_loopbuf_curch = AudioSignal(
248
- torch.from_numpy(st.loopbuf[cur_ch:cur_ch+1]).unsqueeze(0),
249
- sample_rate=sample_rate
250
- )
251
- # make sure looperin matches the midpoint in loudness
252
- ldns_mid = max(sig_loopbuf_curch.loudness(), sig_looper_in.loudness())
253
- sig_looper_in = sig_looper_in.normalize(ldns_mid)
254
- st.looper_in = sig_looper_in.samples.cpu().numpy().squeeze(0)
255
-
256
- st.loopbuf[cur_ch:cur_ch + 1] = (
257
- st.looper_in + st.loopbuf[cur_ch:cur_ch+1] * st.feedback
258
- )
259
- # also lower the volumes of the other channels
260
- for i in range(4):
261
- if i != cur_ch:
262
- st.loopbuf[i:i+1] = st.loopbuf[i:i+1] * 0.5 # -3dB
263
-
264
- st.looper_in = np.zeros_like(st.looper_in)
265
-
266
- loop_input = st.loopbuf[cur_ch:cur_ch+1]
267
-
268
- # ~~~ VAMPNET STUFF ~~~~
269
- sig = AudioSignal(
270
- torch.from_numpy(loop_input).unsqueeze(0),
271
- sample_rate=sample_rate
272
- )
273
- input_loudness = sig.loudness()
274
- log(f"INPUT loudness {input_loudness}")
275
- if input_loudness > MAX_LOUDNESS:
276
- log(f"input loudness {input_loudness} is over {MAX_LOUDNESS}!")
277
- sig = sig.normalize(MAX_LOUDNESS)
278
- elif input_loudness < MIN_LOUDNESS:
279
- log(f"input loudness {input_loudness} is under {MIN_LOUDNESS}!")
280
- sig = sig.normalize(MIN_LOUDNESS)
281
-
282
- sig = ez_variation(interface, sig)
283
- sig = sig.resample(sample_rate)
284
-
285
- # notify if we've gone over the loudness
286
- sig = sig.normalize(input_loudness)
287
- outloudness = sig.loudness()
288
- if outloudness > MAX_LOUDNESS:
289
- log(f"out loudness {sig.loudness()} is over {MAX_LOUDNESS}!")
290
- sig = sig.normalize(MAX_LOUDNESS)
291
- elif outloudness < MIN_LOUDNESS:
292
- log(f"out loudness {sig.loudness()} is under {MIN_LOUDNESS}!")
293
- sig = sig.normalize(MIN_LOUDNESS)
294
-
295
- # put it back in the loopbuf
296
- # write to the next channel
297
- # (TODO: instead of trimming to loopbuf.shape[1], maybe we can just have the loopbuf be the right size from init time.)
298
- cur_ch = (cur_ch + 1) % st.num_telephone_chans
299
- st.tt_cur_ch = cur_ch
300
- if False: # HUGO: is there a time where we want feedback?
301
- st.loopbuf[cur_ch:cur_ch+1] = (
302
- sig.samples.cpu().numpy().squeeze(0)[:, :st.loopbuf.shape[1]]
303
- + st.feedback * st.loopbuf[cur_ch:cur_ch+1]
304
- )
305
- else:
306
- st.loopbuf[cur_ch:cur_ch+1] = (
307
- sig.samples.cpu().numpy().squeeze(0)[:, :st.loopbuf.shape[1]]
308
- )
309
-
310
- log(f"output loudness {sig.loudness()}")
311
- log(f"telephone loop took {time.time() - t0} seconds... next channel {cur_ch}\n\n")
312
-
313
- # if we've made it back to the input channel, we can unlock the recording
314
- log(f"cur_ch {cur_ch} input_channel {st.input_channel}")
315
- if cur_ch == st.input_channel:
316
- st.recording_locked = False
317
- log(f"recording unlocked!")
318
-
319
-
320
- # unlock the recording if we've successfully written to all channels
321
- # if st.recording_locked and cur_ch == 0:
322
- # st.recording_locked = False
323
- # log(f"recording locked {st.recording_locked}")
324
-
325
- st.token_telephone_processing = False
326
- return
327
-
328
- # TODO: since we're using this really high threshold
329
- # we always need to record about 100ms in advance, to catch the beginning of the attacks.
330
-
331
- def looper_process_block(st, block: np.ndarray):
332
- lrc = st.record_channel
333
-
334
- # treat the lookback buffer as a circular buffer
335
- st.lookback_buf = np.roll(st.lookback_buf, block.shape[1], axis=1)
336
- st.lookback_buf[:, -block.shape[1]:] = block[lrc:lrc+1, :]
337
-
338
-
339
- # check if we need to record.
340
- if st.recording:
341
- start_i = (st.pos + block.shape[1]) - st.lookback_buf.shape[1]
342
- end_i = st.pos + st.lookback_buf.shape[1]
343
-
344
- indices = np.take(
345
- np.arange(st.loopbuf.shape[1]),
346
- np.arange(start_i, end_i),
347
- mode="wrap"
348
- )
349
- _audio_in = st.lookback_buf[:, :]
350
- # ramp in if we need to
351
- if st.record_ramp_in:
352
- _audio_in = _audio_in * np.linspace(0, 1, _audio_in.shape[1])
353
- st.record_ramp_in=False
354
-
355
- if st.record_ramp_out:
356
- _audio_in = _audio_in * np.linspace(1, 0, _audio_in.shape[1])
357
- st.record_ramp_out=False
358
- st.recording = False
359
-
360
- st.looper_in[:, indices] = (
361
- 0.9 * st.looper_in[:, indices] + _audio_in
362
- )
363
-
364
- # incremement the recording time
365
- st.rec_time += st.lookback_buf.shape[1] / sample_rate
366
-
367
- # check if we need to play
368
- crossfade_samples = int(0.1 * sample_rate)
369
- if st.playing:
370
- play_pos = (st.pos + block.shape[1]) % st.loopbuf.shape[1] # read one buffer ahead
371
- indices = np.arange(play_pos, play_pos + block.shape[1])
372
- block = st.loopbuf.take(indices, axis=1, mode="wrap")[:, :] # this doesn't have any crossfading. # TODO: this is still not working!
373
-
374
- # if we've recorded more than the loop size
375
- if st.rec_time > st.duration and st.recording:
376
- # play the loop
377
- play_pos = st.pos + block.shape[1] # read one buffer ahead
378
- indices = np.arange(play_pos, play_pos + block.shape[1])
379
-
380
- block[lrc:lrc] = st.looper_in.take(indices, axis=1, mode="wrap")[:, :]
381
-
382
- # advance looper state
383
- st.pos = (st.pos + block.shape[1]) % st.loopbuf.shape[1]
384
-
385
- return block
386
-
387
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
388
- # ~~~~~~ drawing ~~~~~~~~
389
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390
-
391
- def draw_rms_bar(st, x, y, width, height):
392
- rms_min = -50
393
- rms_max = -10
394
- rms = st.rms_db
395
- rms = max(rms, rms_min)
396
- threshold = st.trig_threshold_db
397
- rel_threshold = st.rel_threshold_db
398
-
399
- rms_block = int((rms - rms_min) / (rms_max - rms_min) * height)
400
- threshold_block = (threshold - rms_min) / (rms_max - rms_min) * height
401
- rel_threshold_block = (rel_threshold - rms_min) / (rms_max - rms_min) * height
402
-
403
- # draw the rms curve
404
- for i in range(rms_block, height+4):
405
- with term.location(x+4, y+height-i):
406
- print(term.clear_bol)
407
- for i in range(rms_block):
408
- rms_val = i * (rms_max - rms_min) / height + rms_min
409
- with term.location(x, y+height-2-i):
410
- if i < threshold_block:
411
- print(" " + term.on_green(f"*"))
412
- else:
413
- print(" " + term.on_red(f"*"))
414
-
415
- # at the very bottom of the bar, draw the rms value
416
- with term.location(x, y+height-1):
417
- print(f"{rms:.1f}dB")
418
- # print(f" rms")
419
-
420
-
421
- def draw_looper(st):
422
- x = 0
423
- y = 0
424
- width = COLS
425
- height = ROWS
426
-
427
- tt_refresh_every = 0.3
428
- if not hasattr(draw_looper, "last_draw"):
429
- draw_looper.last_draw = 0
430
- should_draw = True
431
- else:
432
- should_draw = (time.time() - draw_looper.last_draw) > tt_refresh_every
433
- if should_draw:
434
- draw_looper.last_draw = time.time()
435
-
436
-
437
- draw_rms_bar(st, x, y, width - 10, height)
438
-
439
- if should_draw:
440
- with term.location(width // 2-4, 1):
441
- for i, letter in enumerate("token telephone"):
442
- print(on_random_color()(letter), end="")
443
-
444
- # with term.location(ROWS-2, COLS // 2):
445
- # print(f"status {st.status}!!!")
446
-
447
-
448
- # if we're recording, draw a red unlderlined "rec" sign on the bottom right
449
- # with term.location(width-8, height-1):
450
- # if st.recording:
451
- # print(term.on_red("rec"))
452
- # else:
453
- # print(term.on_gray50("rec"))
454
-
455
- # # if we're playing draw a green underline "play" sign on the bottom right
456
- # with term.location(width-4, height-1):
457
- # if st.playing:
458
- # print(term.on_green("play"))
459
- # else:
460
- # print(term.on_gray50("play"))
461
-
462
-
463
- # draw the timeline at the bottom using ---
464
- with term.location(6, height):
465
- timeline = ["-"] * (width - 12)
466
- playhead = int((st.pos / st.loopbuf.shape[1]) * (width - 12))
467
- timeline[playhead] = "v"
468
- print("|"+"".join(timeline) + "|")
469
-
470
-
471
- # draw the main message at the very center:
472
- msg_loc = (width // 2, height // 2+1)
473
- _x, _y = msg_loc
474
- if not st.recording:
475
- if not st.recording_locked:
476
- print(term.move_xy(0, _y-1) + term.center("make a sound", width=width+5))
477
- print(term.move_xy(0, _y+0) + term.center("to", width=width+5))
478
- print(term.move_xy(0, _y+1) + term.center("record", width=width+5))
479
- else:
480
- # how many seconds left until we can record again?
481
- # how many more chs do we need to go through before we can record again?
482
- if st.tt_cur_ch < st.input_channel:
483
- chs_remaining = st.input_channel - st.tt_cur_ch
484
- else:
485
- chs_remaining = 4-st.tt_cur_ch + st.input_channel
486
- locked_time_remaining = chs_remaining * st.duration + st.duration - (st.pos / sample_rate)
487
- print(term.move_xy(0, _y-1) + term.center("please wait", width=width+5))
488
- print(term.move_xy(0, _y+0) + term.center(term.on_green(f"{locked_time_remaining:.1f}s"), width=width+5))
489
- print(term.move_xy(0, _y+1) + term.center("for your turn :)", width=width+5))
490
- else:
491
- print(term.move_xy(0, _y-1) + term.center(term.on_red("recording"), width=width+5))
492
- print(term.move_xy(0, _y+0) + term.center(f"{(st.duration) - st.rec_time:.1f}s left", width=width+5))
493
- print(term.move_xy(0, _y+1) + term.center("", width=width+5))
494
-
495
-
496
- # we'll draw channel 0 (1) on the bottom right corner
497
- # channel 1 (2) on the top right corner
498
- # channel 2 (3) on the top left corner
499
- # channel 3 (4) on the bottom left corner
500
- my = 3 # margin
501
- mx = 10
502
- locations = {
503
- 1: (width - mx, height - my),
504
- 2: (width - mx, 1+my),
505
- 3: (mx, 1+my),
506
- 4: (mx, height - my),
507
- }
508
- for i in range(1, 5):
509
- if should_draw:
510
- if st.tt_cur_ch == i - 1 and st.token_telephone_processing:
511
- x, y = locations[i]
512
- on_random_colors = lambda n: "".join(on_random_color()(" ") for _ in range(n))
513
- print(term.move_xy(x, y-1) + on_random_colors(5))
514
- print(term.move_xy(x, y) + on_random_color()(" ") + f" {i} " + on_random_color()(" "))
515
- print(term.move_xy(x, y+1) + on_random_colors(5))
516
- else:
517
- # same thing, but a gray instead of random colors
518
- x, y = locations[i]
519
- on_gray_colors = lambda n: "".join(term.on_gray50(" ") for _ in range(n))
520
- print(term.move_xy(x, y-1) + on_gray_colors(5))
521
- print(term.move_xy(x, y) + term.on_gray50(" ") + f" {i} " + term.on_gray50(" "))
522
- print(term.move_xy(x, y+1) + on_gray_colors(5))
523
-
524
-
525
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
526
- # ~~~~~~ live audio ~~~~~~~~
527
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
528
- def audio_init():
529
- sd.default.samplerate = sample_rate
530
- sd.default.device = device
531
-
532
- # ~~~~~~ the main audio callback ~~~~~~~~~
533
- def callback(st, indata, outdata, frames, _time, status):
534
- t0 = time.time()
535
- lrc = st.record_channel
536
-
537
- if status:
538
- log(f"status is {status}")
539
- st.status = status
540
-
541
- # log dtype, status, frames, time, max min
542
- # log(f"indata {indata.dtype} max {indata.max()} min {indata.min()} {status} {frames} {_time}")
543
-
544
-
545
- ain = rearrange(indata, 't n -> n t', n=num_channels)
546
-
547
- # convert audio to from int32 to float32
548
- ain = ain.astype(np.float32) / np.iinfo(np.int16).max
549
- buf_in = ain
550
-
551
- # if it's all zeros, we're not recording
552
- # so we can just pass it through
553
- if np.all(buf_in == 0):
554
- st.status = st.status + "no input"
555
- return
556
-
557
- st.buf_in = buf_in
558
- check_if_record(
559
- st, buf_in,
560
- on_release_callback=launch_token_telephone
561
- )
562
- buf_in = looper_process_block(st, buf_in)
563
-
564
- # pass our st.loopbuf to the output
565
- ain = buf_in
566
-
567
- # convert back to int32
568
- ain = (ain * np.iinfo(np.int16).max).astype(np.int16)
569
-
570
- outdata[:] = rearrange(ain, 'n t -> t n')
571
-
572
- # log(f"outdata {outdata.dtype} max {outdata.max()} min {outdata.min()} --- took {time.time() - t0} seconds")
573
-
574
-
575
-
576
- if DEBUG_NO_VAMPNET:
577
- interface=None
578
- else:
579
- interface = load_interface(model_choice="opera")
580
-
581
- load_state.loaded = True
582
-
583
- def main():
584
- if PROFILE:
585
- import yappi
586
- yappi.start()
587
-
588
- try:
589
- audio_init()
590
- st = State()
591
- st.playing = True
592
-
593
- from functools import partial
594
- cb = partial(callback, st)
595
-
596
- with term.fullscreen(), term.cbreak():
597
- with sd.Stream(channels=num_channels, callback=cb, blocksize=blocksize, prime_output_buffers_using_stream_callback=True, dtype=np.int16):
598
- while True:
599
- with term.hidden_cursor():
600
- if DEBUG:
601
- time.sleep(100)
602
- else:
603
- draw_looper(st)
604
-
605
- except KeyboardInterrupt:
606
- print(term.clear)
607
- if PROFILE:
608
- yappi.stop()
609
-
610
- # retrieve thread stats by their thread id (given by yappi)
611
- threads = yappi.get_thread_stats()
612
- for thread in threads:
613
- print(
614
- "Function stats for (%s) (%d)" % (thread.name, thread.id)
615
- ) # it is the Thread.__class__.__name__
616
- yappi.get_func_stats(ctx_id=thread.id).print_all()
617
-
618
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
token_telephone/ttutil.py DELETED
@@ -1,65 +0,0 @@
1
- import logging
2
- from pathlib import Path
3
- ROOT = Path(__file__).parent
4
-
5
- import numpy as np
6
- from queue import Queue
7
-
8
- # make a log file!!
9
- logfile= ROOT / "log.txt"
10
- if logfile.exists():
11
- logfile.unlink()
12
- logging.basicConfig(filename=logfile, level=logging.INFO, datefmt="%Y-%m-%d %H:%M:%S", format="%(asctime)s | %(levelname)s | %(message)s")
13
-
14
-
15
- def hsv_to_rgb(h, s, v):
16
- # from https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV
17
- c = v * s
18
- h_ = h / 60
19
- x = c * (1 - abs(h_ % 2 - 1))
20
- m = v - c
21
-
22
- if h_ < 1:
23
- r, g, b = c, x, 0
24
- elif h_ < 2:
25
- r, g, b = x, c, 0
26
- elif h_ < 3:
27
- r, g, b = 0, c, x
28
- elif h_ < 4:
29
- r, g, b = 0, x, c
30
- elif h_ < 5:
31
- r, g, b = x, 0, c
32
- else:
33
- r, g, b = c, 0, x
34
-
35
- return r + m, g + m, b + m
36
-
37
-
38
- def dbg(*args):
39
- print(" ".join(map(str, args)))
40
-
41
-
42
- # we'll want to log on a separate thread
43
- # so that we can log without blocking the main thread
44
-
45
- # make a queue for logging
46
- log_queue = Queue()
47
-
48
- # log to a file instead of the console
49
- def log(msg):
50
- # log_queue.put(msg)
51
- logging.info(msg)
52
- pass
53
-
54
- def set_debug(debug):
55
- if debug:
56
- # print log to console
57
- logging.getLogger().addHandler(logging.StreamHandler())
58
-
59
-
60
- def pow2db(x):
61
- return 10 * np.log10(x + 1e-6)
62
-
63
-
64
- def db2pow(x):
65
- return 10 ** (x / 10)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
token_telephone/vamp_helper.py DELETED
@@ -1,172 +0,0 @@
1
- from pathlib import Path
2
- import time
3
- import os
4
- from contextlib import contextmanager
5
- import random
6
-
7
- import numpy as np
8
- import audiotools as at
9
- from audiotools import AudioSignal
10
- import argbind
11
- import shutil
12
- import torch
13
- import yaml
14
-
15
-
16
- from vampnet.interface import Interface, signal_concat
17
- from vampnet import mask as pmask
18
-
19
- from ttutil import log
20
-
21
- # TODO: incorporate discord bot (if mem allows)
22
- # in a separate thread, send audio samples for listening
23
- # and send back the results
24
- # as well as the params for sampling
25
- # also a command that lets you clear the current signal
26
- # if you want to start over
27
-
28
-
29
- device = "cuda" if torch.cuda.is_available() else "cpu"
30
-
31
- VAMPNET_DIR = Path(".").resolve()
32
-
33
- @contextmanager
34
- def chdir(path):
35
- old_dir = os.getcwd()
36
- os.chdir(path)
37
- try:
38
- yield
39
- finally:
40
- os.chdir(old_dir)
41
-
42
- def load_interface(model_choice="default") -> Interface:
43
- with chdir(VAMPNET_DIR):
44
-
45
-
46
- # populate the model choices with any interface.yml files in the generated confs
47
- MODEL_CHOICES = {
48
- "default": {
49
- "Interface.coarse_ckpt": "models/vampnet/coarse.pth",
50
- "Interface.coarse2fine_ckpt": "models/vampnet/c2f.pth",
51
- "Interface.codec_ckpt": "models/vampnet/codec.pth",
52
- }
53
- }
54
- generated_confs = Path("conf/generated")
55
- for conf_file in generated_confs.glob("*/interface.yml"):
56
- with open(conf_file) as f:
57
- _conf = yaml.safe_load(f)
58
-
59
- # check if the coarse, c2f, and codec ckpts exist
60
- # otherwise, dont' add this model choice
61
- if not (
62
- Path(_conf["Interface.coarse_ckpt"]).exists() and
63
- Path(_conf["Interface.coarse2fine_ckpt"]).exists() and
64
- Path(_conf["Interface.codec_ckpt"]).exists()
65
- ):
66
- continue
67
-
68
- MODEL_CHOICES[conf_file.parent.name] = _conf
69
-
70
- interface = Interface(
71
- device=device,
72
- coarse_ckpt=MODEL_CHOICES[model_choice]["Interface.coarse_ckpt"],
73
- coarse2fine_ckpt=MODEL_CHOICES[model_choice]["Interface.coarse2fine_ckpt"],
74
- codec_ckpt=MODEL_CHOICES[model_choice]["Interface.codec_ckpt"],
75
- )
76
-
77
- interface.model_choices = MODEL_CHOICES
78
- interface.to("cuda" if torch.cuda.is_available() else "cpu")
79
- return interface
80
-
81
- def load_model(interface: Interface, model_choice: str):
82
- interface.reload(
83
- interface.model_choices[model_choice]["Interface.coarse_ckpt"],
84
- interface.model_choices[model_choice]["Interface.coarse2fine_ckpt"],
85
- )
86
-
87
- def ez_variation(
88
- interface,
89
- sig: AudioSignal,
90
- seed: int = None,
91
- model_choice: str = None,
92
- ):
93
- t0 = time.time()
94
-
95
- if seed is None:
96
- seed = int(torch.randint(0, 2**32, (1,)).item())
97
- at.util.seed(seed)
98
-
99
- # reload the model if necessary
100
- if model_choice is not None:
101
- load_model(interface, model_choice)
102
-
103
- # SAMPLING MASK PARAMS, hard code for now, we'll prob want a more preset-ey thing for the actual thin
104
- # we probably honestly just want to oscillate between the same 4 presets
105
- # in a predictable order such that they have a predictable outcome
106
- periodic_p = random.choice([3])
107
- n_mask_codebooks = 3
108
- sampletemp = random.choice([1.0,])
109
- dropout = random.choice([0.0, 0.0])
110
-
111
- top_p = None # NOTE: top p may be the culprit behind the collapse into single pitches.
112
-
113
- # parameters for the build_mask function
114
- build_mask_kwargs = dict(
115
- rand_mask_intensity=1.0,
116
- prefix_s=0.0,
117
- suffix_s=0.0,
118
- periodic_prompt=int(periodic_p),
119
- periodic_prompt2=int(periodic_p),
120
- periodic_prompt_width=1,
121
- _dropout=dropout,
122
- upper_codebook_mask=int(n_mask_codebooks),
123
- upper_codebook_mask_2=int(n_mask_codebooks),
124
- )
125
-
126
- # parameters for the vamp function
127
- vamp_kwargs = dict(
128
- temperature=sampletemp,
129
- typical_filtering=True,
130
- typical_mass=0.15,
131
- typical_min_tokens=64,
132
- top_p=top_p,
133
- seed=seed,
134
- sample_cutoff=1.0,
135
- )
136
-
137
- # save the mask as a txt file
138
- interface.set_chunk_size(10.0)
139
- sig, mask, codes = interface.vamp(
140
- sig,
141
- batch_size=1,
142
- feedback_steps=1,
143
- time_stretch_factor=1,
144
- build_mask_kwargs=build_mask_kwargs,
145
- vamp_kwargs=vamp_kwargs,
146
- return_mask=True,
147
- )
148
-
149
- log(f"vamp took {time.time() - t0} seconds")
150
- return sig
151
-
152
-
153
-
154
- def main():
155
- import tqdm
156
-
157
- interface = load_interface()
158
- sig = AudioSignal.excerpt("assets/example.wav", duration=7.0)
159
- sig = interface.preprocess(sig)
160
- sig.write('ttout/in.wav')
161
- insig = sig.clone()
162
-
163
- fdbk_every = 4
164
- fdbk = 0.5
165
-
166
- for i in tqdm.tqdm(range(1000)):
167
- sig = ez_variation(interface, sig, model_choice="orchestral")
168
- sig.write(f'ttout/out{i}.wav')
169
-
170
-
171
- if __name__ == "__main__":
172
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/.gitignore DELETED
@@ -1 +0,0 @@
1
- .gradio
 
 
unloop/_.md DELETED
@@ -1,73 +0,0 @@
1
- ## client side setup
2
- clone
3
- ```
4
- https://github.com/hugofloresgarcia/unsound-objects.git
5
- git checkout unloop
6
- ```
7
-
8
- install
9
- ```
10
- conda create -n unsound python=3.10
11
- conda activate unsound
12
- pip install -r requirements.txt
13
- ```
14
-
15
- ## server side setup
16
- ssh into malleus
17
- ```
18
- ssh bryan@malleus.cs.northwestern.edu -L 7860:localhost:7860
19
- ```
20
-
21
- then leave the malleus window open and start up a new local window
22
-
23
- (kindly ask hugo to launch the gradio on port 7860)
24
-
25
- you can verify that the gradio is running by opening `http://localhost:7860` on your browser
26
-
27
- ## launch the gradio server (vampnet)
28
- you have to run the gradio server running vampnet model.
29
- (on the remote machine)
30
- ```bash
31
- conda create -n vampnet python=3.10
32
- git clone https://github.com/huggingface.co/spaces/hugggof/vampnet-music.git
33
- pip install -e .
34
- CUDA_VISIBLE_DEVICES=0 python app.py
35
- ```
36
-
37
- ### launch the gradio server (s2s)
38
- you have to run the gradio server running audit model.
39
-
40
- (on the remote machine)
41
- ```bash
42
- conda create -n audit python=3.10
43
- cd audit
44
- pip install -r requirements.txt
45
- CUDA_VISIBLE_DEVICES=0 python scripts/text2sfx/demo.py ckpts/adobe-soda/checkpoints/seethara/text2sfx/25-02-18-256ch-8s/ --model latest_ema.pth
46
- ```
47
-
48
- or for audit-old
49
- ```
50
- CUDA_VISIBLE_DEVICES=0 python scripts/cdit/demos/voice2sfx.py ckpts/rms-centroid-ppg/latest.pth
51
- ```
52
-
53
- ## launch the client (laptop)
54
- then launch the client from your local terminal
55
- ```
56
- python client.py --vampnet_url <VAMPNET_URL> --s2s_url http://localhost:7860
57
- ```
58
-
59
- ## max setup
60
- Then...make sure you have installed (in Max)
61
- ```
62
- flucoma
63
- ```
64
-
65
- MAKE SURE YOU ARE RUNNING MAX 8. It is not compatible with Max 9.
66
-
67
- Now open up the right max patch `./max/sound-objects.maxpat`.
68
-
69
- ### text prompts
70
- NOTE: text prompts are from the list here
71
- https://universalcategorysystem.com/
72
- https://www.dropbox.com/scl/fo/lw1i20cgsm4edsvj3awn1/AP_ZhzG3LlpfFLbX309FbOU?dl=0&e=1&preview=UCS+v8.2.1+Full+List.xlsx&rlkey=wa2onzo0difpew1nze6odztlp
73
- *** HUGO make an empty 'audio' directory in the repo! ***
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/client.py DELETED
@@ -1,253 +0,0 @@
1
- import time
2
- from pathlib import Path
3
- import shutil
4
- import json
5
-
6
- import argbind
7
- import audiotools as at
8
- from gradio_client import Client, handle_file
9
- from pythonosc.osc_server import ThreadingOSCUDPServer
10
- from pythonosc.udp_client import SimpleUDPClient
11
- from pythonosc.dispatcher import Dispatcher
12
- import torch
13
-
14
- class Timer:
15
-
16
- def __init__(self):
17
- self.times = {}
18
-
19
- def tick(self, name: str):
20
- self.times[name] = time.time()
21
-
22
- def tock(self, name: str):
23
- toc = time.time() - self.times[name]
24
- print(f"{name} took {toc} seconds")
25
- return toc
26
-
27
- def __str__(self):
28
- return str(self.times)
29
-
30
- timer = Timer()
31
-
32
- DOWNLOADS_DIR = ".gradio"
33
-
34
- def clear_file(file):
35
- file = Path(file)
36
- if file.exists():
37
- file.unlink()
38
-
39
-
40
- class OSCManager:
41
-
42
- def __init__(
43
- self,
44
- ip: str,
45
- s_port: str,
46
- r_port: str,
47
- process_fn: callable,
48
- # param_change_callback: callable = None
49
- ):
50
- self.ip = ip
51
- self.s_port = s_port
52
- self.r_port = r_port
53
-
54
- # register the process_fn
55
- self.process_fn = process_fn
56
-
57
- print(f"will send to {ip}:{s_port}")
58
- self.client = SimpleUDPClient(ip, s_port)
59
-
60
-
61
- def start_server(self,):
62
- dispatcher = Dispatcher()
63
- dispatcher.map("/process", self.process_fn)
64
-
65
- def send_heartbeat(_, *args):
66
- # print("Received heartbeat")
67
- self.client.send_message("/heartbeat", "pong")
68
-
69
- dispatcher.map("/heartbeat", lambda a, *r: send_heartbeat(a, *r))
70
-
71
- dispatcher.map("/cleanup", lambda a, *r: clear_file(r[0]))
72
-
73
- dispatcher.set_default_handler(lambda a, *r: print(a, r))
74
-
75
- server = ThreadingOSCUDPServer((self.ip, self.r_port), dispatcher)
76
- print(f"Serving on {server.server_address}")
77
- server.serve_forever()
78
-
79
- def error(self, msg: str):
80
- self.client.send_message("/error", msg)
81
-
82
- def log(self, msg: str):
83
- self.client.send_message("/log", msg)
84
-
85
-
86
- class GradioOSCClient:
87
-
88
- def __init__(self,
89
- ip: str,
90
- s_port: int, r_port: int,
91
- vampnet_url: str = None, # url for vampnet
92
- ):
93
- self.osc_manager = OSCManager(
94
- ip=ip, s_port=s_port, r_port=r_port,
95
- process_fn=self.process,
96
- )
97
-
98
- self.clients = {}
99
- if vampnet_url is not None:
100
- self.clients["vampnet"] = Client(src=vampnet_url, download_files=DOWNLOADS_DIR)
101
-
102
- assert len(self.clients) > 0, "At least one client must be specified!"
103
-
104
- self.batch_size = 2# TODO: automatically get batch size from client.
105
-
106
- self.osc_manager.log("hello from gradio client!")
107
-
108
- self.inf_idx = 0
109
-
110
-
111
- def param_changed(self, param_name, new_value):
112
- print(f"Parameter {param_name} changed to {new_value}")
113
-
114
- def vampnet_process(self, address: str, *args):
115
- client = self.clients["vampnet"]
116
-
117
- # query id --- audiofile ---- model_choice --- periodic --- drop --- seed
118
- query_id = args[0]
119
- client_type = args[1]
120
- audio_path = Path(args[2])
121
- model_choice = args[3]
122
- periodic_p = args[4]
123
- dropout = args[5]
124
- seed = args[6]
125
- looplength_ms = args[7]
126
- typical_filter = args[8]
127
- typical_mass = args[9]
128
- typical_min_tokens = args[10]
129
- upper_codebook_mask = args[11]
130
- onset_mask_width = args[12]
131
- sampling_steps = args[13]
132
- temperature = args[14]
133
- top_p = args[15]
134
- beat_mask_ms = args[16]
135
- num_feedback_steps = args[17]
136
-
137
- if not audio_path.exists():
138
- print(f"File {audio_path} does not exist")
139
- self.osc_manager.error(f"File {audio_path} does not exist")
140
- return
141
-
142
- sig = at.AudioSignal(audio_path)
143
- sig.to_mono()
144
- sig.sample_rate = 48000 # HOT PATCH (FIXME IN MAX: sample rate is being forced to 48k)
145
-
146
- # grab the looplength only
147
- # TODO: although I added this,
148
- # the max patch is still configured to crop anything past the looplength off
149
- # so we'll have to change that in order to make an effect.
150
- end_sample = int((looplength_ms * sig.sample_rate) / 1000)
151
-
152
- # grab the remainder of the waveform
153
- num_cut_samples = sig.samples.shape[-1] - end_sample
154
- cut_wav = sig.samples[..., -num_cut_samples:]
155
-
156
- sig.samples = sig.samples[..., :end_sample]
157
- # write the file back
158
- sig.write(audio_path)
159
-
160
- timer.tick("predict")
161
- print(f"Processing {address} with args {args}")
162
- # breakpoint()
163
- job = client.submit(
164
- input_audio=handle_file(audio_path),
165
- sampletemp=temperature,
166
- top_p=top_p,
167
- periodic_p=periodic_p,
168
- dropout=dropout,
169
- stretch_factor=1,
170
- onset_mask_width=onset_mask_width,
171
- typical_filtering=bool(typical_filter),
172
- typical_mass=typical_mass,
173
- typical_min_tokens=typical_min_tokens,
174
- seed=seed,
175
- model_choice=model_choice,
176
- n_mask_codebooks=upper_codebook_mask,
177
- pitch_shift_amt=0,
178
- sample_cutoff=1.0,
179
- sampling_steps=sampling_steps,
180
- beat_mask_ms=int(beat_mask_ms),
181
- num_feedback_steps=num_feedback_steps,
182
- api_name="/vamp_1"
183
- )
184
-
185
- while not job.done():
186
- time.sleep(0.1)
187
- self.osc_manager.client.send_message("/progress", [query_id, str(job.status().code)])
188
-
189
- result = job.result()
190
- # audio_file = result
191
- # audio_files = [audio_file] * self.batch_size
192
- audio_files = list(result[:self.batch_size])
193
- # if each file is missing a .wav at the end, add it
194
- first_audio = audio_files[0]
195
- if not first_audio.endswith(".wav"):
196
- for audio_file in set(audio_files):
197
- if not audio_file.endswith(".wav"):
198
- shutil.move(audio_file, f"{audio_file}.wav")
199
- audio_file = f"{audio_file}.wav"
200
- audio_files = [f"{audio}.wav" for audio in audio_files if not audio.endswith(".wav")]
201
-
202
- for audio_file in audio_files:
203
- # load the file, add the cut samples back
204
- sig = at.AudioSignal(audio_file)
205
- sig.resample(48000)
206
- sig.samples = torch.cat([sig.samples, cut_wav], dim=-1)
207
- sig.write(audio_file)
208
- seed = result[-1]
209
-
210
- timer.tock("predict")
211
-
212
- # send a message that the process is done
213
- self.osc_manager.log(f"query {query_id} has been processed")
214
- self.osc_manager.client.send_message("/process-result", [query_id] + audio_files)
215
-
216
-
217
- def process(self, address: str, *args):
218
- query_id = args[0]
219
- client_type = args[1]
220
- audio_path = Path(args[2])
221
-
222
- if client_type == "vampnet":
223
- self.vampnet_process(address, *args)
224
- return
225
- elif client_type == "sketch2sound":
226
- self.process_s2s(address, *args)
227
- return
228
- else:
229
- raise ValueError(f"Unknown client type {client_type}")
230
-
231
- def gradio_main(
232
- vampnet_url: str = None
233
- ):
234
- system = GradioOSCClient(
235
- vampnet_url=vampnet_url,
236
- ip="127.0.0.1", s_port=8003, r_port=8001,
237
- )
238
-
239
- system.osc_manager.start_server()
240
-
241
-
242
- if __name__ == "__main__":
243
- try:
244
- gradio_main = argbind.bind(gradio_main, without_prefix=True)
245
-
246
- args = argbind.parse_args()
247
- with argbind.scope(args):
248
- gradio_main()
249
-
250
- except Exception as e:
251
- import shutil
252
- shutil.rmtree(DOWNLOADS_DIR, ignore_errors=True)
253
- raise e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/choose_from_list.js DELETED
@@ -1,7 +0,0 @@
1
- subdivs = [0.125, 0.25, 0.5, 1, 2, 4];
2
- subdivs = subdivs.map(function(x) { return x; });
3
-
4
- function bang() {
5
- var i = Math.floor(Math.random() * subdivs.length);
6
- outlet(0, subdivs[i]);
7
- }
 
 
 
 
 
 
 
 
unloop/max/click.maxpat DELETED
@@ -1,551 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "id" : "obj-323",
44
- "maxclass" : "newobj",
45
- "numinlets" : 2,
46
- "numoutlets" : 1,
47
- "outlettype" : [ "" ],
48
- "patching_rect" : [ 129.751264274120331, 104.0, 32.0, 22.0 ],
49
- "text" : "gate"
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "id" : "obj-321",
56
- "maxclass" : "newobj",
57
- "numinlets" : 2,
58
- "numoutlets" : 1,
59
- "outlettype" : [ "" ],
60
- "patching_rect" : [ 59.239391028881073, 100.0, 32.0, 22.0 ],
61
- "text" : "gate"
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "format" : 6,
68
- "id" : "obj-319",
69
- "maxclass" : "flonum",
70
- "numinlets" : 1,
71
- "numoutlets" : 2,
72
- "outlettype" : [ "", "bang" ],
73
- "parameter_enable" : 0,
74
- "patching_rect" : [ 108.0, 266.418817639350891, 50.0, 22.0 ]
75
- }
76
-
77
- }
78
- , {
79
- "box" : {
80
- "id" : "obj-317",
81
- "maxclass" : "newobj",
82
- "numinlets" : 1,
83
- "numoutlets" : 2,
84
- "outlettype" : [ "bang", "bang" ],
85
- "patching_rect" : [ 129.751264274120331, 135.0, 32.0, 22.0 ],
86
- "text" : "t b b"
87
- }
88
-
89
- }
90
- , {
91
- "box" : {
92
- "id" : "obj-316",
93
- "maxclass" : "newobj",
94
- "numinlets" : 1,
95
- "numoutlets" : 2,
96
- "outlettype" : [ "bang", "bang" ],
97
- "patching_rect" : [ 59.239391028881073, 129.0, 32.0, 22.0 ],
98
- "text" : "t b b"
99
- }
100
-
101
- }
102
- , {
103
- "box" : {
104
- "id" : "obj-311",
105
- "maxclass" : "message",
106
- "numinlets" : 2,
107
- "numoutlets" : 1,
108
- "outlettype" : [ "" ],
109
- "patching_rect" : [ 150.735043168067932, 223.683774471282959, 29.5, 22.0 ],
110
- "text" : "600"
111
- }
112
-
113
- }
114
- , {
115
- "box" : {
116
- "id" : "obj-310",
117
- "maxclass" : "message",
118
- "numinlets" : 2,
119
- "numoutlets" : 1,
120
- "outlettype" : [ "" ],
121
- "patching_rect" : [ 108.0, 223.683774471282959, 29.5, 22.0 ],
122
- "text" : "400"
123
- }
124
-
125
- }
126
- , {
127
- "box" : {
128
- "id" : "obj-307",
129
- "maxclass" : "newobj",
130
- "numinlets" : 1,
131
- "numoutlets" : 1,
132
- "outlettype" : [ "" ],
133
- "patching_rect" : [ 579.222337603569031, 292.05984354019165, 77.0, 22.0 ],
134
- "text" : "loadmess 80"
135
- }
136
-
137
- }
138
- , {
139
- "box" : {
140
- "id" : "obj-284",
141
- "maxclass" : "newobj",
142
- "numinlets" : 2,
143
- "numoutlets" : 1,
144
- "outlettype" : [ "int" ],
145
- "patching_rect" : [ 509.991567671298981, 297.188048720359802, 29.5, 22.0 ],
146
- "text" : "* 8"
147
- }
148
-
149
- }
150
- , {
151
- "box" : {
152
- "id" : "obj-286",
153
- "maxclass" : "newobj",
154
- "numinlets" : 4,
155
- "numoutlets" : 1,
156
- "outlettype" : [ "signal" ],
157
- "patching_rect" : [ 451.871908962726593, 353.598305702209473, 106.0, 22.0 ],
158
- "text" : "reson~ 1. 100. 10."
159
- }
160
-
161
- }
162
- , {
163
- "box" : {
164
- "id" : "obj-281",
165
- "maxclass" : "newobj",
166
- "numinlets" : 2,
167
- "numoutlets" : 1,
168
- "outlettype" : [ "signal" ],
169
- "patching_rect" : [ 50.0, 432.230785131454468, 40.0, 22.0 ],
170
- "text" : "*~ 40."
171
- }
172
-
173
- }
174
- , {
175
- "box" : {
176
- "format" : 6,
177
- "id" : "obj-279",
178
- "maxclass" : "flonum",
179
- "numinlets" : 1,
180
- "numoutlets" : 2,
181
- "outlettype" : [ "", "bang" ],
182
- "parameter_enable" : 0,
183
- "patching_rect" : [ 579.222337603569031, 319.410271167755127, 50.0, 22.0 ]
184
- }
185
-
186
- }
187
- , {
188
- "box" : {
189
- "id" : "obj-272",
190
- "maxclass" : "newobj",
191
- "numinlets" : 2,
192
- "numoutlets" : 1,
193
- "outlettype" : [ "int" ],
194
- "patching_rect" : [ 380.795777916908264, 300.606852173805237, 29.5, 22.0 ],
195
- "text" : "* 4"
196
- }
197
-
198
- }
199
- , {
200
- "box" : {
201
- "id" : "obj-275",
202
- "maxclass" : "newobj",
203
- "numinlets" : 4,
204
- "numoutlets" : 1,
205
- "outlettype" : [ "signal" ],
206
- "patching_rect" : [ 322.795777916908264, 356.66199141740799, 106.0, 22.0 ],
207
- "text" : "reson~ 1. 100. 10."
208
- }
209
-
210
- }
211
- , {
212
- "box" : {
213
- "id" : "obj-264",
214
- "maxclass" : "newobj",
215
- "numinlets" : 2,
216
- "numoutlets" : 1,
217
- "outlettype" : [ "int" ],
218
- "patching_rect" : [ 247.598402619361877, 300.606852173805237, 29.5, 22.0 ],
219
- "text" : "* 2"
220
- }
221
-
222
- }
223
- , {
224
- "box" : {
225
- "id" : "obj-259",
226
- "maxclass" : "newobj",
227
- "numinlets" : 4,
228
- "numoutlets" : 1,
229
- "outlettype" : [ "signal" ],
230
- "patching_rect" : [ 189.47874391078949, 356.66199141740799, 106.0, 22.0 ],
231
- "text" : "reson~ 1. 100. 10."
232
- }
233
-
234
- }
235
- , {
236
- "box" : {
237
- "id" : "obj-200",
238
- "maxclass" : "newobj",
239
- "numinlets" : 1,
240
- "numoutlets" : 1,
241
- "outlettype" : [ "signal" ],
242
- "patching_rect" : [ 50.0, 266.418817639350891, 39.0, 22.0 ],
243
- "text" : "click~"
244
- }
245
-
246
- }
247
- , {
248
- "box" : {
249
- "id" : "obj-4",
250
- "maxclass" : "newobj",
251
- "numinlets" : 4,
252
- "numoutlets" : 1,
253
- "outlettype" : [ "signal" ],
254
- "patching_rect" : [ 50.0, 356.66199141740799, 106.0, 22.0 ],
255
- "text" : "reson~ 1. 100. 10."
256
- }
257
-
258
- }
259
- , {
260
- "box" : {
261
- "comment" : "1 enables click, 0 disables.",
262
- "id" : "obj-324",
263
- "index" : 1,
264
- "maxclass" : "inlet",
265
- "numinlets" : 0,
266
- "numoutlets" : 1,
267
- "outlettype" : [ "int" ],
268
- "patching_rect" : [ 59.239391028881073, 40.0, 30.0, 30.0 ]
269
- }
270
-
271
- }
272
- , {
273
- "box" : {
274
- "comment" : "bang for beat",
275
- "id" : "obj-325",
276
- "index" : 2,
277
- "maxclass" : "inlet",
278
- "numinlets" : 0,
279
- "numoutlets" : 1,
280
- "outlettype" : [ "bang" ],
281
- "patching_rect" : [ 104.239391028881073, 40.0, 30.0, 30.0 ]
282
- }
283
-
284
- }
285
- , {
286
- "box" : {
287
- "comment" : "bang for downbeat",
288
- "id" : "obj-326",
289
- "index" : 3,
290
- "maxclass" : "inlet",
291
- "numinlets" : 0,
292
- "numoutlets" : 1,
293
- "outlettype" : [ "bang" ],
294
- "patching_rect" : [ 175.239391028881073, 40.0, 30.0, 30.0 ]
295
- }
296
-
297
- }
298
- , {
299
- "box" : {
300
- "comment" : "signal out",
301
- "id" : "obj-327",
302
- "index" : 1,
303
- "maxclass" : "outlet",
304
- "numinlets" : 1,
305
- "numoutlets" : 0,
306
- "patching_rect" : [ 49.999889028881171, 514.23083500000007, 30.0, 30.0 ]
307
- }
308
-
309
- }
310
- ],
311
- "lines" : [ {
312
- "patchline" : {
313
- "destination" : [ "obj-259", 0 ],
314
- "order" : 1,
315
- "source" : [ "obj-200", 0 ]
316
- }
317
-
318
- }
319
- , {
320
- "patchline" : {
321
- "destination" : [ "obj-275", 0 ],
322
- "order" : 0,
323
- "source" : [ "obj-200", 0 ]
324
- }
325
-
326
- }
327
- , {
328
- "patchline" : {
329
- "destination" : [ "obj-4", 0 ],
330
- "order" : 2,
331
- "source" : [ "obj-200", 0 ]
332
- }
333
-
334
- }
335
- , {
336
- "patchline" : {
337
- "destination" : [ "obj-281", 0 ],
338
- "source" : [ "obj-259", 0 ]
339
- }
340
-
341
- }
342
- , {
343
- "patchline" : {
344
- "destination" : [ "obj-259", 2 ],
345
- "source" : [ "obj-264", 0 ]
346
- }
347
-
348
- }
349
- , {
350
- "patchline" : {
351
- "destination" : [ "obj-275", 2 ],
352
- "source" : [ "obj-272", 0 ]
353
- }
354
-
355
- }
356
- , {
357
- "patchline" : {
358
- "destination" : [ "obj-281", 0 ],
359
- "source" : [ "obj-275", 0 ]
360
- }
361
-
362
- }
363
- , {
364
- "patchline" : {
365
- "destination" : [ "obj-259", 3 ],
366
- "order" : 2,
367
- "source" : [ "obj-279", 0 ]
368
- }
369
-
370
- }
371
- , {
372
- "patchline" : {
373
- "destination" : [ "obj-275", 3 ],
374
- "order" : 1,
375
- "source" : [ "obj-279", 0 ]
376
- }
377
-
378
- }
379
- , {
380
- "patchline" : {
381
- "destination" : [ "obj-286", 3 ],
382
- "order" : 0,
383
- "source" : [ "obj-279", 0 ]
384
- }
385
-
386
- }
387
- , {
388
- "patchline" : {
389
- "destination" : [ "obj-4", 3 ],
390
- "order" : 3,
391
- "source" : [ "obj-279", 0 ]
392
- }
393
-
394
- }
395
- , {
396
- "patchline" : {
397
- "destination" : [ "obj-327", 0 ],
398
- "source" : [ "obj-281", 0 ]
399
- }
400
-
401
- }
402
- , {
403
- "patchline" : {
404
- "destination" : [ "obj-286", 2 ],
405
- "source" : [ "obj-284", 0 ]
406
- }
407
-
408
- }
409
- , {
410
- "patchline" : {
411
- "destination" : [ "obj-281", 0 ],
412
- "source" : [ "obj-286", 0 ]
413
- }
414
-
415
- }
416
- , {
417
- "patchline" : {
418
- "destination" : [ "obj-279", 0 ],
419
- "source" : [ "obj-307", 0 ]
420
- }
421
-
422
- }
423
- , {
424
- "patchline" : {
425
- "destination" : [ "obj-319", 0 ],
426
- "source" : [ "obj-310", 0 ]
427
- }
428
-
429
- }
430
- , {
431
- "patchline" : {
432
- "destination" : [ "obj-319", 0 ],
433
- "source" : [ "obj-311", 0 ]
434
- }
435
-
436
- }
437
- , {
438
- "patchline" : {
439
- "destination" : [ "obj-200", 0 ],
440
- "source" : [ "obj-316", 1 ]
441
- }
442
-
443
- }
444
- , {
445
- "patchline" : {
446
- "destination" : [ "obj-310", 0 ],
447
- "source" : [ "obj-316", 0 ]
448
- }
449
-
450
- }
451
- , {
452
- "patchline" : {
453
- "destination" : [ "obj-200", 0 ],
454
- "source" : [ "obj-317", 0 ]
455
- }
456
-
457
- }
458
- , {
459
- "patchline" : {
460
- "destination" : [ "obj-311", 0 ],
461
- "source" : [ "obj-317", 1 ]
462
- }
463
-
464
- }
465
- , {
466
- "patchline" : {
467
- "destination" : [ "obj-264", 0 ],
468
- "order" : 2,
469
- "source" : [ "obj-319", 0 ]
470
- }
471
-
472
- }
473
- , {
474
- "patchline" : {
475
- "destination" : [ "obj-272", 0 ],
476
- "order" : 1,
477
- "source" : [ "obj-319", 0 ]
478
- }
479
-
480
- }
481
- , {
482
- "patchline" : {
483
- "destination" : [ "obj-284", 0 ],
484
- "order" : 0,
485
- "source" : [ "obj-319", 0 ]
486
- }
487
-
488
- }
489
- , {
490
- "patchline" : {
491
- "destination" : [ "obj-4", 2 ],
492
- "order" : 3,
493
- "source" : [ "obj-319", 0 ]
494
- }
495
-
496
- }
497
- , {
498
- "patchline" : {
499
- "destination" : [ "obj-316", 0 ],
500
- "source" : [ "obj-321", 0 ]
501
- }
502
-
503
- }
504
- , {
505
- "patchline" : {
506
- "destination" : [ "obj-317", 0 ],
507
- "source" : [ "obj-323", 0 ]
508
- }
509
-
510
- }
511
- , {
512
- "patchline" : {
513
- "destination" : [ "obj-321", 0 ],
514
- "order" : 1,
515
- "source" : [ "obj-324", 0 ]
516
- }
517
-
518
- }
519
- , {
520
- "patchline" : {
521
- "destination" : [ "obj-323", 0 ],
522
- "order" : 0,
523
- "source" : [ "obj-324", 0 ]
524
- }
525
-
526
- }
527
- , {
528
- "patchline" : {
529
- "destination" : [ "obj-321", 1 ],
530
- "source" : [ "obj-325", 0 ]
531
- }
532
-
533
- }
534
- , {
535
- "patchline" : {
536
- "destination" : [ "obj-323", 1 ],
537
- "source" : [ "obj-326", 0 ]
538
- }
539
-
540
- }
541
- , {
542
- "patchline" : {
543
- "destination" : [ "obj-281", 0 ],
544
- "source" : [ "obj-4", 0 ]
545
- }
546
-
547
- }
548
- ]
549
- }
550
-
551
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/dry-wet.maxpat DELETED
@@ -1,282 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 84.0, 131.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "id" : "obj-154",
44
- "maxclass" : "newobj",
45
- "numinlets" : 1,
46
- "numoutlets" : 1,
47
- "outlettype" : [ "" ],
48
- "patching_rect" : [ 163.354036390781403, 177.018632590770721, 39.0, 22.0 ],
49
- "presentation" : 1,
50
- "presentation_rect" : [ 1469.090271848838711, 2039.0, 39.0, 22.0 ],
51
- "text" : "atodb"
52
- }
53
-
54
- }
55
- , {
56
- "box" : {
57
- "id" : "obj-156",
58
- "lastchannelcount" : 0,
59
- "maxclass" : "live.gain~",
60
- "numinlets" : 2,
61
- "numoutlets" : 5,
62
- "outlettype" : [ "signal", "signal", "", "float", "list" ],
63
- "parameter_enable" : 1,
64
- "patching_rect" : [ 133.0, 223.0, 48.0, 136.0 ],
65
- "presentation" : 1,
66
- "presentation_rect" : [ 1469.090271848838711, 2101.0, 48.0, 136.0 ],
67
- "saved_attribute_attributes" : {
68
- "valueof" : {
69
- "parameter_longname" : "live.gain~[26]",
70
- "parameter_mmax" : 6.0,
71
- "parameter_mmin" : -70.0,
72
- "parameter_modmode" : 0,
73
- "parameter_shortname" : "live.gain~",
74
- "parameter_type" : 0,
75
- "parameter_unitstyle" : 4
76
- }
77
-
78
- }
79
- ,
80
- "varname" : "live.gain~[1]"
81
- }
82
-
83
- }
84
- , {
85
- "box" : {
86
- "id" : "obj-157",
87
- "maxclass" : "newobj",
88
- "numinlets" : 2,
89
- "numoutlets" : 1,
90
- "outlettype" : [ "float" ],
91
- "patching_rect" : [ 163.354036390781403, 140.37267005443573, 29.5, 22.0 ],
92
- "presentation" : 1,
93
- "presentation_rect" : [ 1469.090271848838711, 2009.0, 29.5, 22.0 ],
94
- "text" : "!- 1."
95
- }
96
-
97
- }
98
- , {
99
- "box" : {
100
- "id" : "obj-158",
101
- "maxclass" : "newobj",
102
- "numinlets" : 6,
103
- "numoutlets" : 1,
104
- "outlettype" : [ "" ],
105
- "patching_rect" : [ 61.0, 100.0, 90.0, 22.0 ],
106
- "presentation" : 1,
107
- "presentation_rect" : [ 1397.090271848838711, 1978.0, 94.0, 22.0 ],
108
- "text" : "scale 0. 1. 1. 0."
109
- }
110
-
111
- }
112
- , {
113
- "box" : {
114
- "id" : "obj-160",
115
- "maxclass" : "newobj",
116
- "numinlets" : 1,
117
- "numoutlets" : 1,
118
- "outlettype" : [ "" ],
119
- "patching_rect" : [ 50.0, 168.944098472595215, 39.0, 22.0 ],
120
- "presentation" : 1,
121
- "presentation_rect" : [ 1386.090271848838711, 2039.0, 39.0, 22.0 ],
122
- "text" : "atodb"
123
- }
124
-
125
- }
126
- , {
127
- "box" : {
128
- "id" : "obj-162",
129
- "lastchannelcount" : 0,
130
- "maxclass" : "live.gain~",
131
- "numinlets" : 2,
132
- "numoutlets" : 5,
133
- "outlettype" : [ "signal", "signal", "", "float", "list" ],
134
- "parameter_enable" : 1,
135
- "patching_rect" : [ 50.0, 223.0, 48.0, 136.0 ],
136
- "presentation" : 1,
137
- "presentation_rect" : [ 1386.090271848838711, 2101.0, 48.0, 136.0 ],
138
- "saved_attribute_attributes" : {
139
- "valueof" : {
140
- "parameter_longname" : "live.gain~[25]",
141
- "parameter_mmax" : 6.0,
142
- "parameter_mmin" : -70.0,
143
- "parameter_modmode" : 0,
144
- "parameter_shortname" : "live.gain~",
145
- "parameter_type" : 0,
146
- "parameter_unitstyle" : 4
147
- }
148
-
149
- }
150
- ,
151
- "varname" : "live.gain~"
152
- }
153
-
154
- }
155
- , {
156
- "box" : {
157
- "comment" : "dry",
158
- "id" : "obj-216",
159
- "index" : 1,
160
- "maxclass" : "inlet",
161
- "numinlets" : 0,
162
- "numoutlets" : 1,
163
- "outlettype" : [ "signal" ],
164
- "patching_rect" : [ 25.000060151161279, 40.0, 30.0, 30.0 ]
165
- }
166
-
167
- }
168
- , {
169
- "box" : {
170
- "comment" : "mix",
171
- "id" : "obj-223",
172
- "index" : 3,
173
- "maxclass" : "inlet",
174
- "numinlets" : 0,
175
- "numoutlets" : 1,
176
- "outlettype" : [ "" ],
177
- "patching_rect" : [ 313.0, 40.0, 30.0, 30.0 ]
178
- }
179
-
180
- }
181
- , {
182
- "box" : {
183
- "comment" : "wet",
184
- "id" : "obj-227",
185
- "index" : 2,
186
- "maxclass" : "inlet",
187
- "numinlets" : 0,
188
- "numoutlets" : 1,
189
- "outlettype" : [ "signal" ],
190
- "patching_rect" : [ 133.0, 44.0, 30.0, 30.0 ]
191
- }
192
-
193
- }
194
- , {
195
- "box" : {
196
- "comment" : "",
197
- "id" : "obj-230",
198
- "index" : 1,
199
- "maxclass" : "outlet",
200
- "numinlets" : 1,
201
- "numoutlets" : 0,
202
- "patching_rect" : [ 50.0, 419.0, 30.0, 30.0 ]
203
- }
204
-
205
- }
206
- ],
207
- "lines" : [ {
208
- "patchline" : {
209
- "destination" : [ "obj-156", 0 ],
210
- "source" : [ "obj-154", 0 ]
211
- }
212
-
213
- }
214
- , {
215
- "patchline" : {
216
- "destination" : [ "obj-230", 0 ],
217
- "source" : [ "obj-156", 0 ]
218
- }
219
-
220
- }
221
- , {
222
- "patchline" : {
223
- "destination" : [ "obj-154", 0 ],
224
- "source" : [ "obj-157", 0 ]
225
- }
226
-
227
- }
228
- , {
229
- "patchline" : {
230
- "destination" : [ "obj-157", 0 ],
231
- "order" : 0,
232
- "source" : [ "obj-158", 0 ]
233
- }
234
-
235
- }
236
- , {
237
- "patchline" : {
238
- "destination" : [ "obj-160", 0 ],
239
- "order" : 1,
240
- "source" : [ "obj-158", 0 ]
241
- }
242
-
243
- }
244
- , {
245
- "patchline" : {
246
- "destination" : [ "obj-162", 0 ],
247
- "source" : [ "obj-160", 0 ]
248
- }
249
-
250
- }
251
- , {
252
- "patchline" : {
253
- "destination" : [ "obj-230", 0 ],
254
- "source" : [ "obj-162", 0 ]
255
- }
256
-
257
- }
258
- , {
259
- "patchline" : {
260
- "destination" : [ "obj-162", 0 ],
261
- "source" : [ "obj-216", 0 ]
262
- }
263
-
264
- }
265
- , {
266
- "patchline" : {
267
- "destination" : [ "obj-158", 0 ],
268
- "source" : [ "obj-223", 0 ]
269
- }
270
-
271
- }
272
- , {
273
- "patchline" : {
274
- "destination" : [ "obj-156", 0 ],
275
- "source" : [ "obj-227", 0 ]
276
- }
277
-
278
- }
279
- ]
280
- }
281
-
282
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/environ.json DELETED
@@ -1,391 +0,0 @@
1
- {
2
- "pattrstorage" : {
3
- "name" : "environ",
4
- "slots" : {
5
- "1" : {
6
- "id" : 1,
7
- "data" : {
8
- "live.gain~" : [ -22.080297807457285 ],
9
- "dur_ms[2]" : [ ],
10
- "mc.live.gain~[1]" : [ ],
11
- "dur_ms[1]" : [ ],
12
- "mc.live.gain~" : [ ],
13
- "lfo[1]::lfofreq" : [ 0.01 ],
14
- "lfo[1]::lfomax" : [ 30.0 ],
15
- "lfo[1]::lfomin" : [ 0.1 ],
16
- "lfo[1]::lfosync" : [ 0 ],
17
- "lfo[1]::lfowave" : [ 1 ],
18
- "lfo[1]::toggle" : [ 1 ],
19
- "lfo[3]::lfofreq" : [ 0.5 ],
20
- "lfo[3]::lfomax" : [ 1000.0 ],
21
- "lfo[3]::lfomin" : [ 100.0 ],
22
- "lfo[3]::lfosync" : [ 0 ],
23
- "lfo[3]::lfowave" : [ 5 ],
24
- "lfo[3]::toggle" : [ 1 ],
25
- "patternclock::loop" : [ 512 ],
26
- "patternclock::regen" : [ 0.0 ],
27
- "patternclock::rskip" : [ 0.485826771653543 ],
28
- "patternclock::tempo" : [ "4n" ],
29
- "patternclock::toggle" : [ 1 ],
30
- "patternclock[1]::loop" : [ 512 ],
31
- "patternclock[1]::regen" : [ 0.0 ],
32
- "patternclock[1]::rskip" : [ 0.795275590551181 ],
33
- "patternclock[1]::tempo" : [ "4n" ],
34
- "patternclock[1]::toggle" : [ 1 ],
35
- "basic-seq::seq-key" : [ 60.0 ],
36
- "basic-seq::seq-notes" : [ "0 4 2 7 5 9" ],
37
- "lfo[9]::lfofreq" : [ 0.322726627789502 ],
38
- "lfo[9]::lfomax" : [ 60.0 ],
39
- "lfo[9]::lfomin" : [ 50.0 ],
40
- "lfo[9]::lfosync" : [ 0 ],
41
- "lfo[9]::lfowave" : [ 4 ],
42
- "lfo[9]::toggle" : [ 1 ],
43
- "dimensynth-gui::attack" : [ 0.053124792475848 ],
44
- "dimensynth-gui::cwo-delay" : [ 155.381300762601285 ],
45
- "dimensynth-gui::cwo-feedback" : [ 0.802913385826772 ],
46
- "dimensynth-gui::cwo-freq" : [ 16.834453468907526 ],
47
- "dimensynth-gui::cwo-sideband" : [ 0.5 ],
48
- "dimensynth-gui::decay" : [ 1115.397287487219273 ],
49
- "dimensynth-gui::freq" : [ 499.999999999999886 ],
50
- "dimensynth-gui::gain" : [ -8.275590551181157 ],
51
- "dimensynth-gui::interp" : [ 0.522283464566928 ],
52
- "dimensynth-gui::outgain" : [ -8.275590551181157 ],
53
- "dimensynth-gui::release" : [ 135.817358126579933 ],
54
- "dimensynth-gui::reson" : [ 0.623385826771653 ],
55
- "dimensynth-gui::sustain" : [ 0.490701756169608 ],
56
- "dimensynth-gui::vibamt" : [ 0.1 ],
57
- "dimensynth-gui::vibfreq" : [ 7.343913385826769 ],
58
- "patternclock[2]::loop" : [ 512 ],
59
- "patternclock[2]::regen" : [ 0.0 ],
60
- "patternclock[2]::rskip" : [ 0.1 ],
61
- "patternclock[2]::tempo" : [ "4n" ],
62
- "patternclock[2]::toggle" : [ 1 ],
63
- "basic-seq[2]::seq-key" : [ 60.0 ],
64
- "basic-seq[2]::seq-notes" : [ "0 4 2 7 5 9" ],
65
- "lfo[2]::lfofreq" : [ 0.01 ],
66
- "lfo[2]::lfomax" : [ 60.0 ],
67
- "lfo[2]::lfomin" : [ 50.0 ],
68
- "lfo[2]::lfosync" : [ 0 ],
69
- "lfo[2]::lfowave" : [ 1 ],
70
- "lfo[2]::toggle" : [ 1 ],
71
- "dimensynth-gui[1]::attack" : [ 0.053124792475848 ],
72
- "dimensynth-gui[1]::cwo-delay" : [ 155.381300762601285 ],
73
- "dimensynth-gui[1]::cwo-feedback" : [ 0.802913385826772 ],
74
- "dimensynth-gui[1]::cwo-freq" : [ 16.834453468907526 ],
75
- "dimensynth-gui[1]::cwo-sideband" : [ 0.5 ],
76
- "dimensynth-gui[1]::decay" : [ 1115.397287487219273 ],
77
- "dimensynth-gui[1]::freq" : [ 499.999999999999886 ],
78
- "dimensynth-gui[1]::gain" : [ -8.275590551181157 ],
79
- "dimensynth-gui[1]::interp" : [ 0.522283464566928 ],
80
- "dimensynth-gui[1]::outgain" : [ -8.275590551181157 ],
81
- "dimensynth-gui[1]::release" : [ 135.817358126579933 ],
82
- "dimensynth-gui[1]::reson" : [ 0.623385826771653 ],
83
- "dimensynth-gui[1]::sustain" : [ 0.490701756169608 ],
84
- "dimensynth-gui[1]::vibamt" : [ 0.1 ],
85
- "dimensynth-gui[1]::vibfreq" : [ 7.343913385826769 ],
86
- "patternclock[3]::loop" : [ 512 ],
87
- "patternclock[3]::regen" : [ 0.0 ],
88
- "patternclock[3]::rskip" : [ 0.1 ],
89
- "patternclock[3]::tempo" : [ "4n" ],
90
- "patternclock[3]::toggle" : [ 1 ],
91
- "basic-seq[1]::seq-key" : [ 60.0 ],
92
- "basic-seq[1]::seq-notes" : [ "0 4 2 7 5 9" ],
93
- "lfo[4]::lfofreq" : [ 0.01 ],
94
- "lfo[4]::lfomax" : [ 60.0 ],
95
- "lfo[4]::lfomin" : [ 50.0 ],
96
- "lfo[4]::lfosync" : [ 0 ],
97
- "lfo[4]::lfowave" : [ 1 ],
98
- "lfo[4]::toggle" : [ 1 ],
99
- "dimensynth-gui[2]::attack" : [ 0.053124792475848 ],
100
- "dimensynth-gui[2]::cwo-delay" : [ 155.381300762601285 ],
101
- "dimensynth-gui[2]::cwo-feedback" : [ 0.802913385826772 ],
102
- "dimensynth-gui[2]::cwo-freq" : [ 16.834453468907526 ],
103
- "dimensynth-gui[2]::cwo-sideband" : [ 0.5 ],
104
- "dimensynth-gui[2]::decay" : [ 1115.397287487219273 ],
105
- "dimensynth-gui[2]::freq" : [ 499.999999999999886 ],
106
- "dimensynth-gui[2]::gain" : [ -8.275590551181157 ],
107
- "dimensynth-gui[2]::interp" : [ 0.522283464566928 ],
108
- "dimensynth-gui[2]::outgain" : [ -8.275590551181157 ],
109
- "dimensynth-gui[2]::release" : [ 135.817358126579933 ],
110
- "dimensynth-gui[2]::reson" : [ 0.623385826771653 ],
111
- "dimensynth-gui[2]::sustain" : [ 0.490701756169608 ],
112
- "dimensynth-gui[2]::vibamt" : [ 0.1 ],
113
- "dimensynth-gui[2]::vibfreq" : [ 7.343913385826769 ],
114
- "lfo[5]::lfofreq" : [ 0.01 ],
115
- "lfo[5]::lfomax" : [ 1.0 ],
116
- "lfo[5]::lfomin" : [ 0.0 ],
117
- "lfo[5]::lfosync" : [ 0 ],
118
- "lfo[5]::lfowave" : [ 1 ],
119
- "lfo[5]::toggle" : [ 1 ],
120
- "lfo::lfofreq" : [ ],
121
- "lfo::lfomax" : [ ],
122
- "lfo::lfomin" : [ ],
123
- "lfo::lfosync" : [ ],
124
- "lfo::lfowave" : [ ],
125
- "lfo::toggle" : [ ],
126
- "lfo[11]::lfofreq" : [ ],
127
- "lfo[11]::lfomax" : [ ],
128
- "lfo[11]::lfomin" : [ ],
129
- "lfo[11]::lfosync" : [ ],
130
- "lfo[11]::lfowave" : [ ],
131
- "lfo[11]::toggle" : [ ],
132
- "patternclock[5]::loop" : [ ],
133
- "patternclock[5]::regen" : [ ],
134
- "patternclock[5]::rskip" : [ ],
135
- "patternclock[5]::tempo" : [ ],
136
- "patternclock[5]::toggle" : [ ],
137
- "cakelayer-ui::dur" : [ ],
138
- "cakelayer-ui::env" : [ ],
139
- "cakelayer-ui::number" : [ ],
140
- "cakelayer-ui::number[1]" : [ ],
141
- "cakelayer-ui::pos" : [ ],
142
- "cakelayer-ui::pshift" : [ ],
143
- "cakelayer-ui::spray" : [ ],
144
- "lfo[10]::lfofreq" : [ ],
145
- "lfo[10]::lfomax" : [ ],
146
- "lfo[10]::lfomin" : [ ],
147
- "lfo[10]::lfosync" : [ ],
148
- "lfo[10]::lfowave" : [ ],
149
- "lfo[10]::toggle" : [ ],
150
- "lfo[8]::lfofreq" : [ ],
151
- "lfo[8]::lfomax" : [ ],
152
- "lfo[8]::lfomin" : [ ],
153
- "lfo[8]::lfosync" : [ ],
154
- "lfo[8]::lfowave" : [ ],
155
- "lfo[8]::toggle" : [ ],
156
- "lfo[7]::lfofreq" : [ ],
157
- "lfo[7]::lfomax" : [ ],
158
- "lfo[7]::lfomin" : [ ],
159
- "lfo[7]::lfosync" : [ ],
160
- "lfo[7]::lfowave" : [ ],
161
- "lfo[7]::toggle" : [ ],
162
- "patternclock[4]::loop" : [ ],
163
- "patternclock[4]::regen" : [ ],
164
- "patternclock[4]::rskip" : [ ],
165
- "patternclock[4]::tempo" : [ ],
166
- "patternclock[4]::toggle" : [ ],
167
- "cakelayer-ui[1]::dur" : [ ],
168
- "cakelayer-ui[1]::env" : [ ],
169
- "cakelayer-ui[1]::number" : [ ],
170
- "cakelayer-ui[1]::number[1]" : [ ],
171
- "cakelayer-ui[1]::pos" : [ ],
172
- "cakelayer-ui[1]::pshift" : [ ],
173
- "cakelayer-ui[1]::spray" : [ ],
174
- "lfo[6]::lfofreq" : [ ],
175
- "lfo[6]::lfomax" : [ ],
176
- "lfo[6]::lfomin" : [ ],
177
- "lfo[6]::lfosync" : [ ],
178
- "lfo[6]::lfowave" : [ ],
179
- "lfo[6]::toggle" : [ ],
180
- "lfo[12]::lfofreq" : [ ],
181
- "lfo[12]::lfomax" : [ ],
182
- "lfo[12]::lfomin" : [ ],
183
- "lfo[12]::lfosync" : [ ],
184
- "lfo[12]::lfowave" : [ ],
185
- "lfo[12]::toggle" : [ ],
186
- "lfo[13]::lfofreq" : [ ],
187
- "lfo[13]::lfomax" : [ ],
188
- "lfo[13]::lfomin" : [ ],
189
- "lfo[13]::lfosync" : [ ],
190
- "lfo[13]::lfowave" : [ ],
191
- "lfo[13]::toggle" : [ ]
192
- }
193
-
194
- }
195
- ,
196
- "3" : {
197
- "id" : 3,
198
- "data" : {
199
- "live.gain~" : [ -22.080297807457285 ],
200
- "dur_ms[2]" : [ 0.0 ],
201
- "mc.live.gain~[1]" : [ 0.0 ],
202
- "dur_ms[1]" : [ 0.0 ],
203
- "mc.live.gain~" : [ -2.763346551852102 ],
204
- "lfo[1]::lfofreq" : [ 0.322726627789502 ],
205
- "lfo[1]::lfomax" : [ 1.0 ],
206
- "lfo[1]::lfomin" : [ 0.0 ],
207
- "lfo[1]::lfosync" : [ 0 ],
208
- "lfo[1]::lfowave" : [ 4 ],
209
- "lfo[1]::toggle" : [ 1 ],
210
- "lfo[3]::lfofreq" : [ 0.322726627789502 ],
211
- "lfo[3]::lfomax" : [ 800.0 ],
212
- "lfo[3]::lfomin" : [ 200.0 ],
213
- "lfo[3]::lfosync" : [ 0 ],
214
- "lfo[3]::lfowave" : [ 4 ],
215
- "lfo[3]::toggle" : [ 0 ],
216
- "patternclock::loop" : [ 8 ],
217
- "patternclock::regen" : [ 0.0 ],
218
- "patternclock::rskip" : [ 0.194488188976378 ],
219
- "patternclock::tempo" : [ "4n" ],
220
- "patternclock::toggle" : [ 0 ],
221
- "patternclock[1]::loop" : [ 512 ],
222
- "patternclock[1]::regen" : [ 0.0 ],
223
- "patternclock[1]::rskip" : [ 0.493700787401575 ],
224
- "patternclock[1]::tempo" : [ "1n" ],
225
- "patternclock[1]::toggle" : [ 1 ],
226
- "basic-seq::seq-key" : [ 60.0 ],
227
- "basic-seq::seq-notes" : [ "0 4 2 7 5 9" ],
228
- "lfo[9]::lfofreq" : [ 0.322726627789502 ],
229
- "lfo[9]::lfomax" : [ 70.0 ],
230
- "lfo[9]::lfomin" : [ 40.0 ],
231
- "lfo[9]::lfosync" : [ 0 ],
232
- "lfo[9]::lfowave" : [ 4 ],
233
- "lfo[9]::toggle" : [ 0 ],
234
- "dimensynth-gui::attack" : [ 10.0 ],
235
- "dimensynth-gui::cwo-delay" : [ 155.381300762601285 ],
236
- "dimensynth-gui::cwo-feedback" : [ 0.802913385826772 ],
237
- "dimensynth-gui::cwo-freq" : [ 16.834453468907526 ],
238
- "dimensynth-gui::cwo-sideband" : [ 0.625984251968504 ],
239
- "dimensynth-gui::decay" : [ 113.394636070258258 ],
240
- "dimensynth-gui::freq" : [ 499.999999999999886 ],
241
- "dimensynth-gui::gain" : [ -8.275590551181157 ],
242
- "dimensynth-gui::interp" : [ 0.522283464566928 ],
243
- "dimensynth-gui::outgain" : [ -8.275590551181157 ],
244
- "dimensynth-gui::release" : [ 100.0 ],
245
- "dimensynth-gui::reson" : [ 0.623385826771653 ],
246
- "dimensynth-gui::sustain" : [ 0.619824565649974 ],
247
- "dimensynth-gui::vibamt" : [ 0.1 ],
248
- "dimensynth-gui::vibfreq" : [ 7.343913385826769 ],
249
- "patternclock[2]::loop" : [ 8 ],
250
- "patternclock[2]::regen" : [ 0.0 ],
251
- "patternclock[2]::rskip" : [ 0.283464566929134 ],
252
- "patternclock[2]::tempo" : [ "4n" ],
253
- "patternclock[2]::toggle" : [ 0 ],
254
- "basic-seq[2]::seq-key" : [ 60.0 ],
255
- "basic-seq[2]::seq-notes" : [ "0 4 2 7 5 9" ],
256
- "lfo[2]::lfofreq" : [ 0.322726627789502 ],
257
- "lfo[2]::lfomax" : [ 500.0 ],
258
- "lfo[2]::lfomin" : [ 509.0 ],
259
- "lfo[2]::lfosync" : [ 0 ],
260
- "lfo[2]::lfowave" : [ 4 ],
261
- "lfo[2]::toggle" : [ 0 ],
262
- "dimensynth-gui[1]::attack" : [ 10.0 ],
263
- "dimensynth-gui[1]::cwo-delay" : [ 155.381300762601285 ],
264
- "dimensynth-gui[1]::cwo-feedback" : [ 0.802913385826772 ],
265
- "dimensynth-gui[1]::cwo-freq" : [ 16.834453468907526 ],
266
- "dimensynth-gui[1]::cwo-sideband" : [ 0.625984251968504 ],
267
- "dimensynth-gui[1]::decay" : [ 189.512213117701407 ],
268
- "dimensynth-gui[1]::freq" : [ 499.999999999999886 ],
269
- "dimensynth-gui[1]::gain" : [ -8.275590551181157 ],
270
- "dimensynth-gui[1]::interp" : [ 0.522283464566928 ],
271
- "dimensynth-gui[1]::outgain" : [ -8.275590551181157 ],
272
- "dimensynth-gui[1]::release" : [ 157.589078697424071 ],
273
- "dimensynth-gui[1]::reson" : [ 0.623385826771653 ],
274
- "dimensynth-gui[1]::sustain" : [ 0.619824565649974 ],
275
- "dimensynth-gui[1]::vibamt" : [ 0.1 ],
276
- "dimensynth-gui[1]::vibfreq" : [ 7.343913385826769 ],
277
- "patternclock[3]::loop" : [ 8 ],
278
- "patternclock[3]::regen" : [ 0.0 ],
279
- "patternclock[3]::rskip" : [ 0.118110236220472 ],
280
- "patternclock[3]::tempo" : [ "4n" ],
281
- "patternclock[3]::toggle" : [ 0 ],
282
- "basic-seq[1]::seq-key" : [ 60.0 ],
283
- "basic-seq[1]::seq-notes" : [ "0 4 2 7 5 9" ],
284
- "lfo[4]::lfofreq" : [ 0.322726627789502 ],
285
- "lfo[4]::lfomax" : [ 50.0 ],
286
- "lfo[4]::lfomin" : [ 50.0 ],
287
- "lfo[4]::lfosync" : [ 0 ],
288
- "lfo[4]::lfowave" : [ 4 ],
289
- "lfo[4]::toggle" : [ 0 ],
290
- "dimensynth-gui[2]::attack" : [ 10.0 ],
291
- "dimensynth-gui[2]::cwo-delay" : [ 155.381300762601285 ],
292
- "dimensynth-gui[2]::cwo-feedback" : [ 0.802913385826772 ],
293
- "dimensynth-gui[2]::cwo-freq" : [ 16.834453468907526 ],
294
- "dimensynth-gui[2]::cwo-sideband" : [ 0.625984251968504 ],
295
- "dimensynth-gui[2]::decay" : [ 58.478874083615899 ],
296
- "dimensynth-gui[2]::freq" : [ 499.999999999999886 ],
297
- "dimensynth-gui[2]::gain" : [ -8.275590551181157 ],
298
- "dimensynth-gui[2]::interp" : [ 0.522283464566928 ],
299
- "dimensynth-gui[2]::outgain" : [ -8.275590551181157 ],
300
- "dimensynth-gui[2]::release" : [ 197.356350725103312 ],
301
- "dimensynth-gui[2]::reson" : [ 0.623385826771653 ],
302
- "dimensynth-gui[2]::sustain" : [ 0.684385970390157 ],
303
- "dimensynth-gui[2]::vibamt" : [ 0.1 ],
304
- "dimensynth-gui[2]::vibfreq" : [ 7.343913385826769 ],
305
- "lfo[5]::lfofreq" : [ 0.322726627789502 ],
306
- "lfo[5]::lfomax" : [ 1.0 ],
307
- "lfo[5]::lfomin" : [ 0.0 ],
308
- "lfo[5]::lfosync" : [ 0 ],
309
- "lfo[5]::lfowave" : [ 4 ],
310
- "lfo[5]::toggle" : [ 1 ],
311
- "lfo::lfofreq" : [ 0.2 ],
312
- "lfo::lfomax" : [ 1.0 ],
313
- "lfo::lfomin" : [ 0.0 ],
314
- "lfo::lfosync" : [ 0 ],
315
- "lfo::lfowave" : [ 2 ],
316
- "lfo::toggle" : [ 0 ],
317
- "lfo[11]::lfofreq" : [ 2.0 ],
318
- "lfo[11]::lfomax" : [ 800.0 ],
319
- "lfo[11]::lfomin" : [ 300.0 ],
320
- "lfo[11]::lfosync" : [ 0 ],
321
- "lfo[11]::lfowave" : [ 5 ],
322
- "lfo[11]::toggle" : [ 0 ],
323
- "patternclock[5]::loop" : [ 512 ],
324
- "patternclock[5]::regen" : [ 0.0 ],
325
- "patternclock[5]::rskip" : [ 0.351968503937008 ],
326
- "patternclock[5]::tempo" : [ "16n" ],
327
- "patternclock[5]::toggle" : [ 1 ],
328
- "cakelayer-ui::dur" : [ 1330.04875022813053 ],
329
- "cakelayer-ui::env" : [ 0.496062992125984 ],
330
- "cakelayer-ui::number" : [ 1330.04875022813053 ],
331
- "cakelayer-ui::number[1]" : [ -12.0 ],
332
- "cakelayer-ui::pos" : [ 0.582597235011068 ],
333
- "cakelayer-ui::pshift" : [ -12.0 ],
334
- "cakelayer-ui::spray" : [ 0.102362204724409 ],
335
- "lfo[10]::lfofreq" : [ 0.2 ],
336
- "lfo[10]::lfomax" : [ 1.0 ],
337
- "lfo[10]::lfomin" : [ 0.0 ],
338
- "lfo[10]::lfosync" : [ 0 ],
339
- "lfo[10]::lfowave" : [ 2 ],
340
- "lfo[10]::toggle" : [ 0 ],
341
- "lfo[8]::lfofreq" : [ 2.0 ],
342
- "lfo[8]::lfomax" : [ 800.0 ],
343
- "lfo[8]::lfomin" : [ 300.0 ],
344
- "lfo[8]::lfosync" : [ 0 ],
345
- "lfo[8]::lfowave" : [ 5 ],
346
- "lfo[8]::toggle" : [ 0 ],
347
- "lfo[7]::lfofreq" : [ 2.0 ],
348
- "lfo[7]::lfomax" : [ 1.0 ],
349
- "lfo[7]::lfomin" : [ 0.0 ],
350
- "lfo[7]::lfosync" : [ 0 ],
351
- "lfo[7]::lfowave" : [ 1 ],
352
- "lfo[7]::toggle" : [ 0 ],
353
- "patternclock[4]::loop" : [ 512 ],
354
- "patternclock[4]::regen" : [ 0.0 ],
355
- "patternclock[4]::rskip" : [ 0.1 ],
356
- "patternclock[4]::tempo" : [ "4n" ],
357
- "patternclock[4]::toggle" : [ 1 ],
358
- "cakelayer-ui[1]::dur" : [ 1191.605441045505586 ],
359
- "cakelayer-ui[1]::env" : [ 0.496062992125984 ],
360
- "cakelayer-ui[1]::number" : [ 1191.605441045505586 ],
361
- "cakelayer-ui[1]::number[1]" : [ 12.0 ],
362
- "cakelayer-ui[1]::pos" : [ 0.839060223709629 ],
363
- "cakelayer-ui[1]::pshift" : [ 12.0 ],
364
- "cakelayer-ui[1]::spray" : [ 0.102362204724409 ],
365
- "lfo[6]::lfofreq" : [ 0.322726627789502 ],
366
- "lfo[6]::lfomax" : [ 2.0 ],
367
- "lfo[6]::lfomin" : [ -2.0 ],
368
- "lfo[6]::lfosync" : [ 0 ],
369
- "lfo[6]::lfowave" : [ 4 ],
370
- "lfo[6]::toggle" : [ 0 ],
371
- "lfo[12]::lfofreq" : [ 0.311365245459736 ],
372
- "lfo[12]::lfomax" : [ 2400.0 ],
373
- "lfo[12]::lfomin" : [ 100.0 ],
374
- "lfo[12]::lfosync" : [ 0 ],
375
- "lfo[12]::lfowave" : [ 4 ],
376
- "lfo[12]::toggle" : [ 0 ],
377
- "lfo[13]::lfofreq" : [ 0.489015340083276 ],
378
- "lfo[13]::lfomax" : [ 1.0 ],
379
- "lfo[13]::lfomin" : [ 0.0 ],
380
- "lfo[13]::lfosync" : [ 0 ],
381
- "lfo[13]::lfowave" : [ 1 ],
382
- "lfo[13]::toggle" : [ 1 ]
383
- }
384
-
385
- }
386
-
387
- }
388
-
389
- }
390
-
391
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/panner-cleat.maxpat DELETED
@@ -1,327 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "id" : "obj-3",
44
- "maxclass" : "newobj",
45
- "numinlets" : 4,
46
- "numoutlets" : 0,
47
- "patching_rect" : [ 364.666666666666629, 337.068983197212219, 75.0, 22.0 ],
48
- "text" : "dac~ 1 2 3 4"
49
- }
50
-
51
- }
52
- , {
53
- "box" : {
54
- "id" : "obj-2",
55
- "maxclass" : "newobj",
56
- "numinlets" : 3,
57
- "numoutlets" : 4,
58
- "outlettype" : [ "signal", "signal", "signal", "signal" ],
59
- "patching_rect" : [ 369.0, 305.0, 62.0, 22.0 ],
60
- "text" : "quadpan~"
61
- }
62
-
63
- }
64
- , {
65
- "box" : {
66
- "id" : "obj-211",
67
- "maxclass" : "newobj",
68
- "numinlets" : 2,
69
- "numoutlets" : 0,
70
- "patching_rect" : [ 112.0, 336.89655339717865, 55.0, 22.0 ],
71
- "text" : "dac~ 1 2"
72
- }
73
-
74
- }
75
- , {
76
- "box" : {
77
- "id" : "obj-200",
78
- "maxclass" : "newobj",
79
- "numinlets" : 6,
80
- "numoutlets" : 1,
81
- "outlettype" : [ "" ],
82
- "patching_rect" : [ 229.5, 225.0, 114.0, 22.0 ],
83
- "text" : "scale 0. 1000. -1. 1."
84
- }
85
-
86
- }
87
- , {
88
- "box" : {
89
- "id" : "obj-198",
90
- "maxclass" : "newobj",
91
- "numinlets" : 4,
92
- "numoutlets" : 2,
93
- "outlettype" : [ "signal", "signal" ],
94
- "patching_rect" : [ 112.0, 305.0, 50.5, 22.0 ],
95
- "text" : "pan2"
96
- }
97
-
98
- }
99
- , {
100
- "box" : {
101
- "id" : "obj-194",
102
- "maxclass" : "newobj",
103
- "numinlets" : 1,
104
- "numoutlets" : 2,
105
- "outlettype" : [ "float", "float" ],
106
- "patching_rect" : [ 229.5, 174.0, 74.0, 22.0 ],
107
- "text" : "unpack 0. 0."
108
- }
109
-
110
- }
111
- , {
112
- "box" : {
113
- "color" : [ 0.2, 0.0, 0.8, 1.0 ],
114
- "id" : "obj-193",
115
- "maxclass" : "newobj",
116
- "numinlets" : 0,
117
- "numoutlets" : 1,
118
- "outlettype" : [ "" ],
119
- "patching_rect" : [ 112.0, 186.0, 92.0, 22.0 ],
120
- "text" : "r panner-choice"
121
- }
122
-
123
- }
124
- , {
125
- "box" : {
126
- "id" : "obj-185",
127
- "maxclass" : "newobj",
128
- "numinlets" : 2,
129
- "numoutlets" : 3,
130
- "outlettype" : [ "signal", "signal", "signal" ],
131
- "patching_rect" : [ 112.0, 217.0, 49.0, 22.0 ],
132
- "text" : "gate~ 3"
133
- }
134
-
135
- }
136
- , {
137
- "box" : {
138
- "id" : "obj-184",
139
- "maxclass" : "newobj",
140
- "numinlets" : 3,
141
- "numoutlets" : 0,
142
- "patching_rect" : [ 221.5, 305.0, 59.0, 22.0 ],
143
- "text" : "16panner"
144
- }
145
-
146
- }
147
- , {
148
- "box" : {
149
- "id" : "obj-43",
150
- "maxclass" : "newobj",
151
- "numinlets" : 2,
152
- "numoutlets" : 2,
153
- "outlettype" : [ "", "" ],
154
- "patching_rect" : [ 229.5, 128.0, 51.0, 22.0 ],
155
- "text" : "route xy"
156
- }
157
-
158
- }
159
- , {
160
- "box" : {
161
- "comment" : "",
162
- "id" : "obj-213",
163
- "index" : 1,
164
- "maxclass" : "inlet",
165
- "numinlets" : 0,
166
- "numoutlets" : 1,
167
- "outlettype" : [ "signal" ],
168
- "patching_rect" : [ 142.0, 76.0, 30.0, 30.0 ]
169
- }
170
-
171
- }
172
- , {
173
- "box" : {
174
- "comment" : "",
175
- "id" : "obj-214",
176
- "index" : 2,
177
- "maxclass" : "inlet",
178
- "numinlets" : 0,
179
- "numoutlets" : 1,
180
- "outlettype" : [ "" ],
181
- "patching_rect" : [ 229.5, 76.0, 30.0, 30.0 ]
182
- }
183
-
184
- }
185
- ],
186
- "lines" : [ {
187
- "patchline" : {
188
- "destination" : [ "obj-184", 0 ],
189
- "source" : [ "obj-185", 1 ]
190
- }
191
-
192
- }
193
- , {
194
- "patchline" : {
195
- "destination" : [ "obj-198", 0 ],
196
- "source" : [ "obj-185", 0 ]
197
- }
198
-
199
- }
200
- , {
201
- "patchline" : {
202
- "destination" : [ "obj-2", 0 ],
203
- "source" : [ "obj-185", 2 ]
204
- }
205
-
206
- }
207
- , {
208
- "patchline" : {
209
- "destination" : [ "obj-185", 0 ],
210
- "source" : [ "obj-193", 0 ]
211
- }
212
-
213
- }
214
- , {
215
- "patchline" : {
216
- "destination" : [ "obj-184", 2 ],
217
- "order" : 1,
218
- "source" : [ "obj-194", 1 ]
219
- }
220
-
221
- }
222
- , {
223
- "patchline" : {
224
- "destination" : [ "obj-184", 1 ],
225
- "order" : 1,
226
- "source" : [ "obj-194", 0 ]
227
- }
228
-
229
- }
230
- , {
231
- "patchline" : {
232
- "destination" : [ "obj-2", 2 ],
233
- "order" : 0,
234
- "source" : [ "obj-194", 1 ]
235
- }
236
-
237
- }
238
- , {
239
- "patchline" : {
240
- "destination" : [ "obj-2", 1 ],
241
- "order" : 0,
242
- "source" : [ "obj-194", 0 ]
243
- }
244
-
245
- }
246
- , {
247
- "patchline" : {
248
- "destination" : [ "obj-200", 0 ],
249
- "order" : 2,
250
- "source" : [ "obj-194", 0 ]
251
- }
252
-
253
- }
254
- , {
255
- "patchline" : {
256
- "destination" : [ "obj-211", 1 ],
257
- "source" : [ "obj-198", 1 ]
258
- }
259
-
260
- }
261
- , {
262
- "patchline" : {
263
- "destination" : [ "obj-211", 0 ],
264
- "source" : [ "obj-198", 0 ]
265
- }
266
-
267
- }
268
- , {
269
- "patchline" : {
270
- "destination" : [ "obj-3", 3 ],
271
- "source" : [ "obj-2", 3 ]
272
- }
273
-
274
- }
275
- , {
276
- "patchline" : {
277
- "destination" : [ "obj-3", 2 ],
278
- "source" : [ "obj-2", 2 ]
279
- }
280
-
281
- }
282
- , {
283
- "patchline" : {
284
- "destination" : [ "obj-3", 1 ],
285
- "source" : [ "obj-2", 1 ]
286
- }
287
-
288
- }
289
- , {
290
- "patchline" : {
291
- "destination" : [ "obj-3", 0 ],
292
- "source" : [ "obj-2", 0 ]
293
- }
294
-
295
- }
296
- , {
297
- "patchline" : {
298
- "destination" : [ "obj-198", 1 ],
299
- "source" : [ "obj-200", 0 ]
300
- }
301
-
302
- }
303
- , {
304
- "patchline" : {
305
- "destination" : [ "obj-185", 1 ],
306
- "source" : [ "obj-213", 0 ]
307
- }
308
-
309
- }
310
- , {
311
- "patchline" : {
312
- "destination" : [ "obj-43", 0 ],
313
- "source" : [ "obj-214", 0 ]
314
- }
315
-
316
- }
317
- , {
318
- "patchline" : {
319
- "destination" : [ "obj-194", 0 ],
320
- "source" : [ "obj-43", 0 ]
321
- }
322
-
323
- }
324
- ]
325
- }
326
-
327
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/pan~.maxpat DELETED
@@ -1,283 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 664.0, 441.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "id" : "obj-2",
44
- "maxclass" : "newobj",
45
- "numinlets" : 2,
46
- "numoutlets" : 1,
47
- "outlettype" : [ "signal" ],
48
- "patching_rect" : [ 241.0, 273.0, 29.5, 22.0 ],
49
- "text" : "*~"
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "id" : "obj-1",
56
- "maxclass" : "newobj",
57
- "numinlets" : 2,
58
- "numoutlets" : 1,
59
- "outlettype" : [ "signal" ],
60
- "patching_rect" : [ 160.0, 273.0, 29.5, 22.0 ],
61
- "text" : "*~"
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "comment" : "right signal",
68
- "id" : "obj-28",
69
- "index" : 2,
70
- "maxclass" : "outlet",
71
- "numinlets" : 1,
72
- "numoutlets" : 0,
73
- "patching_rect" : [ 241.0, 316.0, 30.0, 30.0 ]
74
- }
75
-
76
- }
77
- , {
78
- "box" : {
79
- "comment" : "left signal",
80
- "id" : "obj-27",
81
- "index" : 1,
82
- "maxclass" : "outlet",
83
- "numinlets" : 1,
84
- "numoutlets" : 0,
85
- "patching_rect" : [ 160.0, 316.0, 30.0, 30.0 ]
86
- }
87
-
88
- }
89
- , {
90
- "box" : {
91
- "id" : "obj-26",
92
- "maxclass" : "newobj",
93
- "numinlets" : 2,
94
- "numoutlets" : 1,
95
- "outlettype" : [ "signal" ],
96
- "patching_rect" : [ 160.0, 230.0, 43.0, 22.0 ],
97
- "text" : "cycle~"
98
- }
99
-
100
- }
101
- , {
102
- "box" : {
103
- "id" : "obj-25",
104
- "maxclass" : "newobj",
105
- "numinlets" : 2,
106
- "numoutlets" : 1,
107
- "outlettype" : [ "signal" ],
108
- "patching_rect" : [ 241.0, 230.0, 43.0, 22.0 ],
109
- "text" : "cycle~"
110
- }
111
-
112
- }
113
- , {
114
- "box" : {
115
- "id" : "obj-24",
116
- "maxclass" : "newobj",
117
- "numinlets" : 2,
118
- "numoutlets" : 1,
119
- "outlettype" : [ "signal" ],
120
- "patching_rect" : [ 265.0, 182.0, 49.0, 22.0 ],
121
- "text" : "+~ 0.75"
122
- }
123
-
124
- }
125
- , {
126
- "box" : {
127
- "id" : "obj-23",
128
- "maxclass" : "newobj",
129
- "numinlets" : 2,
130
- "numoutlets" : 1,
131
- "outlettype" : [ "signal" ],
132
- "patching_rect" : [ 184.0, 151.0, 37.0, 22.0 ],
133
- "text" : "*~ #1"
134
- }
135
-
136
- }
137
- , {
138
- "box" : {
139
- "id" : "obj-22",
140
- "maxclass" : "newobj",
141
- "numinlets" : 1,
142
- "numoutlets" : 1,
143
- "outlettype" : [ "signal" ],
144
- "patching_rect" : [ 184.0, 111.0, 58.0, 22.0 ],
145
- "text" : "sig~ 0.25"
146
- }
147
-
148
- }
149
- , {
150
- "box" : {
151
- "id" : "obj-11",
152
- "maxclass" : "comment",
153
- "numinlets" : 1,
154
- "numoutlets" : 0,
155
- "patching_rect" : [ 183.0, 8.0, 60.0, 20.0 ],
156
- "text" : "pan"
157
- }
158
-
159
- }
160
- , {
161
- "box" : {
162
- "id" : "obj-10",
163
- "maxclass" : "comment",
164
- "numinlets" : 1,
165
- "numoutlets" : 0,
166
- "patching_rect" : [ 124.0, 8.0, 60.0, 20.0 ],
167
- "text" : "audio"
168
- }
169
-
170
- }
171
- , {
172
- "box" : {
173
- "comment" : "pan value (0...1)",
174
- "id" : "obj-8",
175
- "index" : 2,
176
- "maxclass" : "inlet",
177
- "numinlets" : 0,
178
- "numoutlets" : 1,
179
- "outlettype" : [ "float" ],
180
- "patching_rect" : [ 198.0, 33.0, 30.0, 30.0 ]
181
- }
182
-
183
- }
184
- , {
185
- "box" : {
186
- "comment" : "mono audio in",
187
- "id" : "obj-7",
188
- "index" : 1,
189
- "maxclass" : "inlet",
190
- "numinlets" : 0,
191
- "numoutlets" : 1,
192
- "outlettype" : [ "signal" ],
193
- "patching_rect" : [ 134.0, 33.0, 30.0, 30.0 ]
194
- }
195
-
196
- }
197
- ],
198
- "lines" : [ {
199
- "patchline" : {
200
- "destination" : [ "obj-27", 0 ],
201
- "source" : [ "obj-1", 0 ]
202
- }
203
-
204
- }
205
- , {
206
- "patchline" : {
207
- "destination" : [ "obj-28", 0 ],
208
- "source" : [ "obj-2", 0 ]
209
- }
210
-
211
- }
212
- , {
213
- "patchline" : {
214
- "destination" : [ "obj-23", 0 ],
215
- "source" : [ "obj-22", 0 ]
216
- }
217
-
218
- }
219
- , {
220
- "patchline" : {
221
- "destination" : [ "obj-24", 0 ],
222
- "order" : 0,
223
- "source" : [ "obj-23", 0 ]
224
- }
225
-
226
- }
227
- , {
228
- "patchline" : {
229
- "destination" : [ "obj-26", 1 ],
230
- "order" : 1,
231
- "source" : [ "obj-23", 0 ]
232
- }
233
-
234
- }
235
- , {
236
- "patchline" : {
237
- "destination" : [ "obj-25", 1 ],
238
- "source" : [ "obj-24", 0 ]
239
- }
240
-
241
- }
242
- , {
243
- "patchline" : {
244
- "destination" : [ "obj-2", 0 ],
245
- "source" : [ "obj-25", 0 ]
246
- }
247
-
248
- }
249
- , {
250
- "patchline" : {
251
- "destination" : [ "obj-1", 0 ],
252
- "source" : [ "obj-26", 0 ]
253
- }
254
-
255
- }
256
- , {
257
- "patchline" : {
258
- "destination" : [ "obj-1", 1 ],
259
- "order" : 1,
260
- "source" : [ "obj-7", 0 ]
261
- }
262
-
263
- }
264
- , {
265
- "patchline" : {
266
- "destination" : [ "obj-2", 1 ],
267
- "order" : 0,
268
- "source" : [ "obj-7", 0 ]
269
- }
270
-
271
- }
272
- , {
273
- "patchline" : {
274
- "destination" : [ "obj-23", 1 ],
275
- "midpoints" : [ 207.5, 96.0, 252.0, 96.0, 252.0, 147.0, 211.5, 147.0 ],
276
- "source" : [ "obj-8", 0 ]
277
- }
278
-
279
- }
280
- ]
281
- }
282
-
283
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/path.maxpat DELETED
@@ -1,698 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 9,
6
- "minor" : 0,
7
- "revision" : 1,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 1000.0, 780.0 ],
14
- "gridsize" : [ 15.0, 15.0 ],
15
- "boxes" : [ {
16
- "box" : {
17
- "id" : "obj-6",
18
- "maxclass" : "button",
19
- "numinlets" : 1,
20
- "numoutlets" : 1,
21
- "outlettype" : [ "bang" ],
22
- "parameter_enable" : 0,
23
- "patching_rect" : [ 464.5, 82.0, 24.0, 24.0 ]
24
- }
25
-
26
- }
27
- , {
28
- "box" : {
29
- "id" : "obj-1",
30
- "maxclass" : "newobj",
31
- "numinlets" : 2,
32
- "numoutlets" : 2,
33
- "outlettype" : [ "", "" ],
34
- "patching_rect" : [ 464.5, 60.0, 65.0, 22.0 ],
35
- "text" : "route clear"
36
- }
37
-
38
- }
39
- , {
40
- "box" : {
41
- "id" : "obj-3",
42
- "maxclass" : "newobj",
43
- "numinlets" : 2,
44
- "numoutlets" : 1,
45
- "outlettype" : [ "bang" ],
46
- "patching_rect" : [ 207.000073671340942, 354.0, 119.0, 22.0 ],
47
- "text" : "metro 500 @active 1"
48
- }
49
-
50
- }
51
- , {
52
- "box" : {
53
- "id" : "obj-2",
54
- "maxclass" : "button",
55
- "numinlets" : 1,
56
- "numoutlets" : 1,
57
- "outlettype" : [ "bang" ],
58
- "parameter_enable" : 0,
59
- "patching_rect" : [ 558.0, 315.0, 24.0, 24.0 ]
60
- }
61
-
62
- }
63
- , {
64
- "box" : {
65
- "id" : "obj-68",
66
- "maxclass" : "message",
67
- "numinlets" : 2,
68
- "numoutlets" : 1,
69
- "outlettype" : [ "" ],
70
- "patching_rect" : [ 462.0, 350.518528401851654, 35.0, 22.0 ],
71
- "text" : "clear"
72
- }
73
-
74
- }
75
- , {
76
- "box" : {
77
- "id" : "obj-173",
78
- "maxclass" : "newobj",
79
- "numinlets" : 2,
80
- "numoutlets" : 1,
81
- "outlettype" : [ "float" ],
82
- "patching_rect" : [ 162.0, 522.518528401851654, 29.5, 22.0 ],
83
- "text" : "* 2."
84
- }
85
-
86
- }
87
- , {
88
- "box" : {
89
- "id" : "obj-172",
90
- "maxclass" : "newobj",
91
- "numinlets" : 2,
92
- "numoutlets" : 1,
93
- "outlettype" : [ "float" ],
94
- "patching_rect" : [ 230.000073432922363, 522.518528401851654, 29.5, 22.0 ],
95
- "text" : "* 2."
96
- }
97
-
98
- }
99
- , {
100
- "box" : {
101
- "id" : "obj-162",
102
- "maxclass" : "newobj",
103
- "numinlets" : 2,
104
- "numoutlets" : 2,
105
- "outlettype" : [ "", "" ],
106
- "patching_rect" : [ 142.0, 734.518528401851654, 47.0, 22.0 ],
107
- "text" : "zl.join"
108
- }
109
-
110
- }
111
- , {
112
- "box" : {
113
- "id" : "obj-158",
114
- "maxclass" : "newobj",
115
- "numinlets" : 1,
116
- "numoutlets" : 2,
117
- "outlettype" : [ "bang", "" ],
118
- "patching_rect" : [ 162.0, 670.518528401851654, 29.5, 22.0 ],
119
- "text" : "t b l"
120
- }
121
-
122
- }
123
- , {
124
- "box" : {
125
- "id" : "obj-150",
126
- "linecount" : 3,
127
- "maxclass" : "comment",
128
- "numinlets" : 1,
129
- "numoutlets" : 0,
130
- "patching_rect" : [ 50.0, 686.518528401851654, 75.0, 47.0 ],
131
- "text" : "object number (in ambisonics)"
132
- }
133
-
134
- }
135
- , {
136
- "box" : {
137
- "id" : "obj-148",
138
- "maxclass" : "message",
139
- "numinlets" : 2,
140
- "numoutlets" : 1,
141
- "outlettype" : [ "" ],
142
- "patching_rect" : [ 142.0, 698.518528401851654, 29.5, 22.0 ],
143
- "text" : "#1"
144
- }
145
-
146
- }
147
- , {
148
- "box" : {
149
- "id" : "obj-137",
150
- "linecount" : 3,
151
- "maxclass" : "comment",
152
- "numinlets" : 1,
153
- "numoutlets" : 0,
154
- "patching_rect" : [ 298.0, 262.518528401851654, 98.0, 47.0 ],
155
- "text" : "a lookup table-based panning system"
156
- }
157
-
158
- }
159
- , {
160
- "box" : {
161
- "id" : "obj-136",
162
- "linecount" : 4,
163
- "maxclass" : "comment",
164
- "numinlets" : 1,
165
- "numoutlets" : 0,
166
- "patching_rect" : [ 434.0, 490.518528401851654, 57.0, 60.0 ],
167
- "text" : "interp time between points"
168
- }
169
-
170
- }
171
- , {
172
- "box" : {
173
- "id" : "obj-134",
174
- "maxclass" : "newobj",
175
- "numinlets" : 1,
176
- "numoutlets" : 4,
177
- "outlettype" : [ "", "", "", "" ],
178
- "patching_rect" : [ 514.0, 378.518528401851654, 95.0, 22.0 ],
179
- "saved_object_attributes" : {
180
- "embed" : 0,
181
- "precision" : 6
182
- }
183
- ,
184
- "text" : "coll #1-positions"
185
- }
186
-
187
- }
188
- , {
189
- "box" : {
190
- "id" : "obj-133",
191
- "maxclass" : "message",
192
- "numinlets" : 2,
193
- "numoutlets" : 1,
194
- "outlettype" : [ "" ],
195
- "patching_rect" : [ 482.0, 426.518528401851654, 50.0, 22.0 ],
196
- "text" : "41"
197
- }
198
-
199
- }
200
- , {
201
- "box" : {
202
- "id" : "obj-131",
203
- "maxclass" : "message",
204
- "numinlets" : 2,
205
- "numoutlets" : 1,
206
- "outlettype" : [ "" ],
207
- "patching_rect" : [ 558.0, 351.0, 41.0, 22.0 ],
208
- "text" : "length"
209
- }
210
-
211
- }
212
- , {
213
- "box" : {
214
- "id" : "obj-119",
215
- "maxclass" : "newobj",
216
- "numinlets" : 2,
217
- "numoutlets" : 1,
218
- "outlettype" : [ "" ],
219
- "patching_rect" : [ 238.000073671340942, 558.518551051616669, 74.0, 22.0 ],
220
- "text" : "pack 0. 500."
221
- }
222
-
223
- }
224
- , {
225
- "box" : {
226
- "id" : "obj-117",
227
- "maxclass" : "newobj",
228
- "numinlets" : 2,
229
- "numoutlets" : 1,
230
- "outlettype" : [ "" ],
231
- "patching_rect" : [ 162.0, 558.518528401851654, 74.0, 22.0 ],
232
- "text" : "pack 0. 500."
233
- }
234
-
235
- }
236
- , {
237
- "box" : {
238
- "format" : 6,
239
- "id" : "obj-108",
240
- "maxclass" : "flonum",
241
- "numinlets" : 1,
242
- "numoutlets" : 2,
243
- "outlettype" : [ "", "bang" ],
244
- "parameter_enable" : 0,
245
- "patching_rect" : [ 378.0, 522.518528401851654, 50.0, 22.0 ]
246
- }
247
-
248
- }
249
- , {
250
- "box" : {
251
- "id" : "obj-106",
252
- "maxclass" : "newobj",
253
- "numinlets" : 3,
254
- "numoutlets" : 1,
255
- "outlettype" : [ "" ],
256
- "patching_rect" : [ 166.00007152557373, 634.51855331659317, 74.0, 22.0 ],
257
- "text" : "pack 0. 0. 0."
258
- }
259
-
260
- }
261
- , {
262
- "box" : {
263
- "id" : "obj-105",
264
- "maxclass" : "newobj",
265
- "numinlets" : 3,
266
- "numoutlets" : 2,
267
- "outlettype" : [ "", "bang" ],
268
- "patching_rect" : [ 238.000073671340942, 586.518551886081696, 57.0, 22.0 ],
269
- "text" : "line 0. 20"
270
- }
271
-
272
- }
273
- , {
274
- "box" : {
275
- "id" : "obj-103",
276
- "maxclass" : "newobj",
277
- "numinlets" : 3,
278
- "numoutlets" : 2,
279
- "outlettype" : [ "", "bang" ],
280
- "patching_rect" : [ 162.0, 586.518551886081696, 57.0, 22.0 ],
281
- "text" : "line 0. 20"
282
- }
283
-
284
- }
285
- , {
286
- "box" : {
287
- "id" : "obj-102",
288
- "maxclass" : "newobj",
289
- "numinlets" : 1,
290
- "numoutlets" : 2,
291
- "outlettype" : [ "float", "float" ],
292
- "patching_rect" : [ 162.0, 498.518528401851654, 74.0, 22.0 ],
293
- "text" : "unpack 0. 0."
294
- }
295
-
296
- }
297
- , {
298
- "box" : {
299
- "id" : "obj-99",
300
- "maxclass" : "newobj",
301
- "numinlets" : 1,
302
- "numoutlets" : 1,
303
- "outlettype" : [ "" ],
304
- "patching_rect" : [ 142.0, 766.518528401851654, 74.0, 22.0 ],
305
- "text" : "prepend xyz"
306
- }
307
-
308
- }
309
- , {
310
- "box" : {
311
- "id" : "obj-96",
312
- "maxclass" : "message",
313
- "numinlets" : 2,
314
- "numoutlets" : 1,
315
- "outlettype" : [ "" ],
316
- "patching_rect" : [ 246.0, 426.518528401851654, 35.0, 22.0 ],
317
- "text" : "open"
318
- }
319
-
320
- }
321
- , {
322
- "box" : {
323
- "id" : "obj-81",
324
- "maxclass" : "newobj",
325
- "numinlets" : 5,
326
- "numoutlets" : 4,
327
- "outlettype" : [ "int", "", "", "int" ],
328
- "patching_rect" : [ 162.0, 426.518528401851654, 65.0, 22.0 ],
329
- "text" : "counter 25"
330
- }
331
-
332
- }
333
- , {
334
- "box" : {
335
- "id" : "obj-77",
336
- "maxclass" : "newobj",
337
- "numinlets" : 1,
338
- "numoutlets" : 4,
339
- "outlettype" : [ "", "", "", "" ],
340
- "patching_rect" : [ 162.0, 467.089956223964691, 95.0, 22.0 ],
341
- "saved_object_attributes" : {
342
- "embed" : 0,
343
- "precision" : 6
344
- }
345
- ,
346
- "text" : "coll #1-positions"
347
- }
348
-
349
- }
350
- , {
351
- "box" : {
352
- "id" : "obj-76",
353
- "maxclass" : "button",
354
- "numinlets" : 1,
355
- "numoutlets" : 1,
356
- "outlettype" : [ "bang" ],
357
- "parameter_enable" : 0,
358
- "patching_rect" : [ 162.0, 377.518528401851654, 24.0, 24.0 ]
359
- }
360
-
361
- }
362
- , {
363
- "box" : {
364
- "id" : "obj-74",
365
- "maxclass" : "newobj",
366
- "numinlets" : 1,
367
- "numoutlets" : 2,
368
- "outlettype" : [ "float", "float" ],
369
- "patching_rect" : [ 146.0, 244.755107223987579, 29.5, 22.0 ],
370
- "text" : "t f f"
371
- }
372
-
373
- }
374
- , {
375
- "box" : {
376
- "id" : "obj-72",
377
- "maxclass" : "newobj",
378
- "numinlets" : 2,
379
- "numoutlets" : 1,
380
- "outlettype" : [ "" ],
381
- "patching_rect" : [ 134.0, 306.518528401851654, 32.0, 22.0 ],
382
- "text" : "gate"
383
- }
384
-
385
- }
386
- , {
387
- "box" : {
388
- "id" : "obj-71",
389
- "maxclass" : "newobj",
390
- "numinlets" : 2,
391
- "numoutlets" : 1,
392
- "outlettype" : [ "int" ],
393
- "patching_rect" : [ 162.0, 278.518528401851654, 36.0, 22.0 ],
394
- "text" : "> 0.8"
395
- }
396
-
397
- }
398
- , {
399
- "box" : {
400
- "id" : "obj-60",
401
- "maxclass" : "newobj",
402
- "numinlets" : 1,
403
- "numoutlets" : 2,
404
- "outlettype" : [ "", "" ],
405
- "patching_rect" : [ 146.0, 214.518528401851654, 108.0, 22.0 ],
406
- "text" : "fluid.onsetfeature~"
407
- }
408
-
409
- }
410
- , {
411
- "box" : {
412
- "comment" : "",
413
- "id" : "obj-90",
414
- "index" : 1,
415
- "maxclass" : "inlet",
416
- "numinlets" : 0,
417
- "numoutlets" : 1,
418
- "outlettype" : [ "" ],
419
- "patching_rect" : [ 464.5, 10.0, 30.0, 30.0 ]
420
- }
421
-
422
- }
423
- , {
424
- "box" : {
425
- "comment" : "",
426
- "id" : "obj-93",
427
- "index" : 1,
428
- "maxclass" : "outlet",
429
- "numinlets" : 1,
430
- "numoutlets" : 0,
431
- "patching_rect" : [ 142.0, 848.518528401851654, 30.0, 30.0 ]
432
- }
433
-
434
- }
435
- ],
436
- "lines" : [ {
437
- "patchline" : {
438
- "destination" : [ "obj-134", 0 ],
439
- "order" : 1,
440
- "source" : [ "obj-1", 1 ]
441
- }
442
-
443
- }
444
- , {
445
- "patchline" : {
446
- "destination" : [ "obj-2", 0 ],
447
- "order" : 0,
448
- "source" : [ "obj-1", 1 ]
449
- }
450
-
451
- }
452
- , {
453
- "patchline" : {
454
- "destination" : [ "obj-6", 0 ],
455
- "source" : [ "obj-1", 0 ]
456
- }
457
-
458
- }
459
- , {
460
- "patchline" : {
461
- "destination" : [ "obj-172", 0 ],
462
- "source" : [ "obj-102", 1 ]
463
- }
464
-
465
- }
466
- , {
467
- "patchline" : {
468
- "destination" : [ "obj-173", 0 ],
469
- "source" : [ "obj-102", 0 ]
470
- }
471
-
472
- }
473
- , {
474
- "patchline" : {
475
- "destination" : [ "obj-106", 0 ],
476
- "source" : [ "obj-103", 0 ]
477
- }
478
-
479
- }
480
- , {
481
- "patchline" : {
482
- "destination" : [ "obj-106", 1 ],
483
- "source" : [ "obj-105", 0 ]
484
- }
485
-
486
- }
487
- , {
488
- "patchline" : {
489
- "destination" : [ "obj-158", 0 ],
490
- "source" : [ "obj-106", 0 ]
491
- }
492
-
493
- }
494
- , {
495
- "patchline" : {
496
- "destination" : [ "obj-117", 1 ],
497
- "order" : 1,
498
- "source" : [ "obj-108", 0 ]
499
- }
500
-
501
- }
502
- , {
503
- "patchline" : {
504
- "destination" : [ "obj-119", 1 ],
505
- "order" : 0,
506
- "source" : [ "obj-108", 0 ]
507
- }
508
-
509
- }
510
- , {
511
- "patchline" : {
512
- "destination" : [ "obj-103", 0 ],
513
- "source" : [ "obj-117", 0 ]
514
- }
515
-
516
- }
517
- , {
518
- "patchline" : {
519
- "destination" : [ "obj-105", 0 ],
520
- "source" : [ "obj-119", 0 ]
521
- }
522
-
523
- }
524
- , {
525
- "patchline" : {
526
- "destination" : [ "obj-134", 0 ],
527
- "source" : [ "obj-131", 0 ]
528
- }
529
-
530
- }
531
- , {
532
- "patchline" : {
533
- "destination" : [ "obj-133", 1 ],
534
- "order" : 0,
535
- "source" : [ "obj-134", 0 ]
536
- }
537
-
538
- }
539
- , {
540
- "patchline" : {
541
- "destination" : [ "obj-81", 4 ],
542
- "order" : 1,
543
- "source" : [ "obj-134", 0 ]
544
- }
545
-
546
- }
547
- , {
548
- "patchline" : {
549
- "destination" : [ "obj-162", 0 ],
550
- "source" : [ "obj-148", 0 ]
551
- }
552
-
553
- }
554
- , {
555
- "patchline" : {
556
- "destination" : [ "obj-148", 0 ],
557
- "source" : [ "obj-158", 0 ]
558
- }
559
-
560
- }
561
- , {
562
- "patchline" : {
563
- "destination" : [ "obj-162", 1 ],
564
- "source" : [ "obj-158", 1 ]
565
- }
566
-
567
- }
568
- , {
569
- "patchline" : {
570
- "destination" : [ "obj-99", 0 ],
571
- "source" : [ "obj-162", 0 ]
572
- }
573
-
574
- }
575
- , {
576
- "patchline" : {
577
- "destination" : [ "obj-119", 0 ],
578
- "source" : [ "obj-172", 0 ]
579
- }
580
-
581
- }
582
- , {
583
- "patchline" : {
584
- "destination" : [ "obj-117", 0 ],
585
- "source" : [ "obj-173", 0 ]
586
- }
587
-
588
- }
589
- , {
590
- "patchline" : {
591
- "destination" : [ "obj-131", 0 ],
592
- "source" : [ "obj-2", 0 ]
593
- }
594
-
595
- }
596
- , {
597
- "patchline" : {
598
- "destination" : [ "obj-76", 0 ],
599
- "source" : [ "obj-3", 0 ]
600
- }
601
-
602
- }
603
- , {
604
- "patchline" : {
605
- "destination" : [ "obj-68", 0 ],
606
- "source" : [ "obj-6", 0 ]
607
- }
608
-
609
- }
610
- , {
611
- "patchline" : {
612
- "destination" : [ "obj-74", 0 ],
613
- "source" : [ "obj-60", 0 ]
614
- }
615
-
616
- }
617
- , {
618
- "patchline" : {
619
- "destination" : [ "obj-134", 0 ],
620
- "source" : [ "obj-68", 0 ]
621
- }
622
-
623
- }
624
- , {
625
- "patchline" : {
626
- "destination" : [ "obj-72", 0 ],
627
- "source" : [ "obj-71", 0 ]
628
- }
629
-
630
- }
631
- , {
632
- "patchline" : {
633
- "destination" : [ "obj-76", 0 ],
634
- "source" : [ "obj-72", 0 ]
635
- }
636
-
637
- }
638
- , {
639
- "patchline" : {
640
- "destination" : [ "obj-71", 0 ],
641
- "source" : [ "obj-74", 1 ]
642
- }
643
-
644
- }
645
- , {
646
- "patchline" : {
647
- "destination" : [ "obj-72", 1 ],
648
- "source" : [ "obj-74", 0 ]
649
- }
650
-
651
- }
652
- , {
653
- "patchline" : {
654
- "destination" : [ "obj-81", 0 ],
655
- "source" : [ "obj-76", 0 ]
656
- }
657
-
658
- }
659
- , {
660
- "patchline" : {
661
- "destination" : [ "obj-102", 0 ],
662
- "source" : [ "obj-77", 0 ]
663
- }
664
-
665
- }
666
- , {
667
- "patchline" : {
668
- "destination" : [ "obj-77", 0 ],
669
- "source" : [ "obj-81", 0 ]
670
- }
671
-
672
- }
673
- , {
674
- "patchline" : {
675
- "destination" : [ "obj-1", 0 ],
676
- "source" : [ "obj-90", 0 ]
677
- }
678
-
679
- }
680
- , {
681
- "patchline" : {
682
- "destination" : [ "obj-77", 0 ],
683
- "source" : [ "obj-96", 0 ]
684
- }
685
-
686
- }
687
- , {
688
- "patchline" : {
689
- "destination" : [ "obj-93", 0 ],
690
- "source" : [ "obj-99", 0 ]
691
- }
692
-
693
- }
694
- ],
695
- "originid" : "pat-2332"
696
- }
697
-
698
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/paths.js DELETED
@@ -1,109 +0,0 @@
1
- var pathModes = ["off", "wander", "circle", "bounce"];
2
-
3
- // Define state object
4
- var state = {
5
- coords: [],
6
- coordidx: 0,
7
- mode: "off"
8
- };
9
-
10
- // init with a random
11
- setPath("random");
12
-
13
- // the space ranges from -1 to 1 in x and y, z must always be 0
14
- function bang() {
15
- // TODO: emit next xyz coordinate in path
16
- if (state.coords.length > 0) {
17
- outlet(0, state.coords[state.coordidx]);
18
- state.coordidx = (state.coordidx + 1) % state.coords.length;
19
- }
20
- else {
21
- post("no path to follow\n");
22
- }
23
- }
24
-
25
- function setPath(mode) {
26
- if (pathModes.indexOf(mode) >= 0) {
27
- state.mode = mode;
28
- }
29
- state.mode = mode;
30
-
31
- // generate points for the pathe
32
- if (state.mode == "circle") {
33
- // circle around in a random direction
34
- state.coords = [];
35
- var numPoints = Math.round(Math.random() * 100);
36
- var angle = Math.random() * 2 * Math.PI;
37
-
38
- var direction = Math.random() < 0.5 ? 1 : -1;
39
- for (var i = 0; i < numPoints; i++) {
40
- state.coords.push([Math.cos(angle), Math.sin(angle), 0]);
41
- angle += 2 * Math.PI / numPoints * direction;
42
- }
43
- }
44
- else if (state.mode == "wander") {
45
- // wander around in brownian motion
46
- state.coords = [];
47
- var numPoints = Math.round(Math.random() * 100);
48
- // var x = 0;
49
- // var y = 0;
50
- // pick a random starting point within -1 and 1
51
- var x = Math.random() * 2 - 1;
52
- var y = Math.random() * 2 - 1;
53
- for (var i = 0; i < numPoints; i++) {
54
- x += Math.random() * 0.2 - 0.1; // TODO: this 0.1 controls wander amt
55
- y += Math.random() * 0.2 - 0.1;
56
-
57
- // clamp to -1 to 1
58
- x = Math.min(1, Math.max(-1, x));
59
- y = Math.min(1, Math.max(-1, y));
60
- state.coords.push([x, y, 0]);
61
- }
62
- }
63
- else if (state.mode == "bounce") {
64
- // bounce around two points
65
- state.coords = [];
66
- var numPoints = 2;
67
- var x = 0;
68
- var y = 0;
69
-
70
- // pick two random quadrants to place the point in
71
- quads = {
72
- 1: [1, 1],
73
- 2: [-1, 1],
74
- 3: [-1, -1],
75
- 4: [1, -1]
76
- }
77
- var quadindices = [1, 2, 3, 4];
78
- // scramble quadindices
79
- quadindices.sort(function(a, b) { return Math.random() - 0.5; });
80
- var quadidx1 = quadindices.pop();
81
- var quadidx2 = quadindices.pop();
82
- var quad1 = quads[quadidx1];
83
- var quad2 = quads[quadidx2];
84
- // post("quad1: " + quad1 + " quad2: " + quad2);
85
-
86
- // pick point 1, a random point in the range (0, 1), then scale by the quad
87
- var x1 = Math.random() * quad1[0];
88
- var y1 = Math.random() * quad1[1];
89
-
90
- // pick point 2, a random point in the range (0, 1), then scale by the quad
91
- var x2 = Math.random() * quad2[0];
92
- var y2 = Math.random() * quad2[1];
93
-
94
- // generate the path
95
- state.coords.push([x1, y1, 0]);
96
- state.coords.push([x2, y2, 0]);
97
- }
98
- else if (state.mode == "random") {
99
- state.coords = [];
100
- var numPoints = Math.round(Math.random() * 100) + 4;
101
- for (var i = 0; i < numPoints; i++) {
102
- state.coords.push([Math.random() * 2 - 1, Math.random() * 2 - 1, 0]);
103
- }
104
- // post("random now has " + state.coords.length + " points\n");
105
- }
106
- else {
107
- post("unknown path mode");
108
- }
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/randint.maxpat DELETED
@@ -1,115 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "comment" : "",
44
- "id" : "obj-4",
45
- "index" : 1,
46
- "maxclass" : "outlet",
47
- "numinlets" : 1,
48
- "numoutlets" : 0,
49
- "patching_rect" : [ 56.0, 199.0, 30.0, 30.0 ]
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "id" : "obj-3",
56
- "maxclass" : "newobj",
57
- "numinlets" : 2,
58
- "numoutlets" : 1,
59
- "outlettype" : [ "" ],
60
- "patching_rect" : [ 56.0, 127.0, 63.0, 22.0 ],
61
- "text" : "random 1."
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "comment" : "bang for a random number",
68
- "id" : "obj-2",
69
- "index" : 1,
70
- "maxclass" : "inlet",
71
- "numinlets" : 0,
72
- "numoutlets" : 1,
73
- "outlettype" : [ "bang" ],
74
- "patching_rect" : [ 56.0, 77.0, 30.0, 30.0 ]
75
- }
76
-
77
- }
78
- , {
79
- "box" : {
80
- "id" : "obj-1",
81
- "maxclass" : "newobj",
82
- "numinlets" : 6,
83
- "numoutlets" : 1,
84
- "outlettype" : [ "" ],
85
- "patching_rect" : [ 56.0, 159.0, 130.0, 22.0 ],
86
- "text" : "scale 0. 1. #1 #2 #3"
87
- }
88
-
89
- }
90
- ],
91
- "lines" : [ {
92
- "patchline" : {
93
- "destination" : [ "obj-4", 0 ],
94
- "source" : [ "obj-1", 0 ]
95
- }
96
-
97
- }
98
- , {
99
- "patchline" : {
100
- "destination" : [ "obj-3", 0 ],
101
- "source" : [ "obj-2", 0 ]
102
- }
103
-
104
- }
105
- , {
106
- "patchline" : {
107
- "destination" : [ "obj-1", 0 ],
108
- "source" : [ "obj-3", 0 ]
109
- }
110
-
111
- }
112
- ]
113
- }
114
-
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/randrange.maxpat DELETED
@@ -1,117 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "comment" : "",
44
- "id" : "obj-4",
45
- "index" : 0,
46
- "maxclass" : "outlet",
47
- "numinlets" : 1,
48
- "numoutlets" : 0,
49
- "patching_rect" : [ 77.0, 218.0, 30.0, 30.0 ]
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "id" : "obj-3",
56
- "maxclass" : "newobj",
57
- "numinlets" : 6,
58
- "numoutlets" : 1,
59
- "outlettype" : [ "" ],
60
- "patching_rect" : [ 77.0, 177.0, 97.0, 22.0 ],
61
- "text" : "scale 0. 1. #1 #2"
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "id" : "obj-2",
68
- "maxclass" : "newobj",
69
- "numinlets" : 2,
70
- "numoutlets" : 1,
71
- "outlettype" : [ "" ],
72
- "patching_rect" : [ 77.0, 137.0, 63.0, 22.0 ],
73
- "text" : "random 1."
74
- }
75
-
76
- }
77
- , {
78
- "box" : {
79
- "comment" : "",
80
- "id" : "obj-1",
81
- "index" : 0,
82
- "maxclass" : "inlet",
83
- "numinlets" : 0,
84
- "numoutlets" : 1,
85
- "outlettype" : [ "" ],
86
- "patching_rect" : [ 77.0, 88.0, 30.0, 30.0 ]
87
- }
88
-
89
- }
90
- ],
91
- "lines" : [ {
92
- "patchline" : {
93
- "destination" : [ "obj-2", 0 ],
94
- "source" : [ "obj-1", 0 ]
95
- }
96
-
97
- }
98
- , {
99
- "patchline" : {
100
- "destination" : [ "obj-3", 0 ],
101
- "source" : [ "obj-2", 0 ]
102
- }
103
-
104
- }
105
- , {
106
- "patchline" : {
107
- "destination" : [ "obj-4", 0 ],
108
- "source" : [ "obj-3", 0 ]
109
- }
110
-
111
- }
112
- ],
113
- "dependency_cache" : [ ],
114
- "autosave" : 0
115
- }
116
-
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/three-unloops.maxpat DELETED
@@ -1,728 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 9,
6
- "minor" : 0,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 34.0, 87.0, 1612.0, 929.0 ],
14
- "gridsize" : [ 15.0, 15.0 ],
15
- "boxes" : [ {
16
- "box" : {
17
- "id" : "obj-18",
18
- "maxclass" : "message",
19
- "numinlets" : 2,
20
- "numoutlets" : 1,
21
- "outlettype" : [ "" ],
22
- "patching_rect" : [ 1045.0, 739.0, 132.0, 22.0 ],
23
- "presentation_linecount" : 3,
24
- "text" : "text supermetroid"
25
- }
26
-
27
- }
28
- , {
29
- "box" : {
30
- "id" : "obj-17",
31
- "maxclass" : "message",
32
- "numinlets" : 2,
33
- "numoutlets" : 1,
34
- "outlettype" : [ "" ],
35
- "patching_rect" : [ 622.0, 739.0, 132.0, 22.0 ],
36
- "presentation_linecount" : 3,
37
- "text" : "text supermetroid"
38
- }
39
-
40
- }
41
- , {
42
- "box" : {
43
- "id" : "obj-16",
44
- "maxclass" : "message",
45
- "numinlets" : 2,
46
- "numoutlets" : 1,
47
- "outlettype" : [ "" ],
48
- "patching_rect" : [ 260.0, 739.0, 132.0, 22.0 ],
49
- "text" : "text supermetroid"
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "id" : "obj-12",
56
- "maxclass" : "toggle",
57
- "numinlets" : 1,
58
- "numoutlets" : 1,
59
- "outlettype" : [ "int" ],
60
- "parameter_enable" : 0,
61
- "patching_rect" : [ 678.0, 72.0, 24.0, 24.0 ]
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "id" : "obj-10",
68
- "maxclass" : "toggle",
69
- "numinlets" : 1,
70
- "numoutlets" : 1,
71
- "outlettype" : [ "int" ],
72
- "parameter_enable" : 0,
73
- "patching_rect" : [ 809.0, 107.0, 24.0, 24.0 ]
74
- }
75
-
76
- }
77
- , {
78
- "box" : {
79
- "id" : "obj-6",
80
- "maxclass" : "comment",
81
- "numinlets" : 1,
82
- "numoutlets" : 0,
83
- "patching_rect" : [ 1137.0, 138.0, 150.0, 20.0 ],
84
- "text" : "infinite radio mode"
85
- }
86
-
87
- }
88
- , {
89
- "box" : {
90
- "id" : "obj-4",
91
- "maxclass" : "message",
92
- "numinlets" : 2,
93
- "numoutlets" : 1,
94
- "outlettype" : [ "" ],
95
- "patching_rect" : [ 1025.0, 137.0, 110.0, 22.0 ],
96
- "presentation_linecount" : 2,
97
- "text" : "vampnet periodic 0"
98
- }
99
-
100
- }
101
- , {
102
- "box" : {
103
- "bgmode" : 0,
104
- "border" : 0,
105
- "clickthrough" : 0,
106
- "enablehscroll" : 0,
107
- "enablevscroll" : 0,
108
- "id" : "obj-3",
109
- "lockeddragscroll" : 0,
110
- "lockedsize" : 0,
111
- "maxclass" : "bpatcher",
112
- "name" : "unloop-bpatcher.maxpat",
113
- "numinlets" : 2,
114
- "numoutlets" : 2,
115
- "offset" : [ 0.0, 0.0 ],
116
- "outlettype" : [ "signal", "" ],
117
- "patching_rect" : [ 876.0, 243.0, 301.0, 461.0 ],
118
- "viewvisibility" : 1
119
- }
120
-
121
- }
122
- , {
123
- "box" : {
124
- "bgmode" : 0,
125
- "border" : 0,
126
- "clickthrough" : 0,
127
- "enablehscroll" : 0,
128
- "enablevscroll" : 0,
129
- "id" : "obj-2",
130
- "lockeddragscroll" : 0,
131
- "lockedsize" : 0,
132
- "maxclass" : "bpatcher",
133
- "name" : "unloop-bpatcher.maxpat",
134
- "numinlets" : 2,
135
- "numoutlets" : 2,
136
- "offset" : [ 0.0, 0.0 ],
137
- "outlettype" : [ "signal", "" ],
138
- "patching_rect" : [ 463.0, 243.0, 301.0, 461.0 ],
139
- "viewvisibility" : 1
140
- }
141
-
142
- }
143
- , {
144
- "box" : {
145
- "bgmode" : 0,
146
- "border" : 0,
147
- "clickthrough" : 0,
148
- "enablehscroll" : 0,
149
- "enablevscroll" : 0,
150
- "id" : "obj-1",
151
- "lockeddragscroll" : 0,
152
- "lockedsize" : 0,
153
- "maxclass" : "bpatcher",
154
- "name" : "unloop-bpatcher.maxpat",
155
- "numinlets" : 2,
156
- "numoutlets" : 2,
157
- "offset" : [ 0.0, 0.0 ],
158
- "outlettype" : [ "signal", "" ],
159
- "patching_rect" : [ 91.0, 243.0, 301.0, 461.0 ],
160
- "viewvisibility" : 1
161
- }
162
-
163
- }
164
- , {
165
- "box" : {
166
- "id" : "obj-33",
167
- "maxclass" : "comment",
168
- "numinlets" : 1,
169
- "numoutlets" : 0,
170
- "patching_rect" : [ 478.0, 76.0, 150.0, 20.0 ],
171
- "text" : "play/stop the playhead"
172
- }
173
-
174
- }
175
- , {
176
- "box" : {
177
- "id" : "obj-32",
178
- "linecount" : 2,
179
- "maxclass" : "comment",
180
- "numinlets" : 1,
181
- "numoutlets" : 0,
182
- "patching_rect" : [ 634.5, 35.0, 129.0, 33.0 ],
183
- "text" : "record into all bufs simultaneously"
184
- }
185
-
186
- }
187
- , {
188
- "box" : {
189
- "id" : "obj-31",
190
- "linecount" : 3,
191
- "maxclass" : "comment",
192
- "numinlets" : 1,
193
- "numoutlets" : 0,
194
- "patching_rect" : [ 773.0, 45.0, 150.0, 47.0 ],
195
- "text" : "start generation \n(make sure client is running!) "
196
- }
197
-
198
- }
199
- , {
200
- "box" : {
201
- "id" : "obj-30",
202
- "maxclass" : "comment",
203
- "numinlets" : 1,
204
- "numoutlets" : 0,
205
- "patching_rect" : [ 985.0, 103.0, 150.0, 20.0 ],
206
- "text" : "choose model option 14"
207
- }
208
-
209
- }
210
- , {
211
- "box" : {
212
- "id" : "obj-28",
213
- "maxclass" : "newobj",
214
- "numinlets" : 1,
215
- "numoutlets" : 1,
216
- "outlettype" : [ "bang" ],
217
- "patching_rect" : [ 916.0, 102.0, 58.0, 22.0 ],
218
- "text" : "loadbang"
219
- }
220
-
221
- }
222
- , {
223
- "box" : {
224
- "id" : "obj-26",
225
- "maxclass" : "message",
226
- "numinlets" : 2,
227
- "numoutlets" : 1,
228
- "outlettype" : [ "" ],
229
- "patching_rect" : [ 916.0, 137.0, 101.0, 22.0 ],
230
- "text" : "vampnet model 1"
231
- }
232
-
233
- }
234
- , {
235
- "box" : {
236
- "id" : "obj-21",
237
- "maxclass" : "message",
238
- "numinlets" : 2,
239
- "numoutlets" : 1,
240
- "outlettype" : [ "" ],
241
- "patching_rect" : [ 809.0, 143.0, 45.0, 22.0 ],
242
- "text" : "gen $1"
243
- }
244
-
245
- }
246
- , {
247
- "box" : {
248
- "id" : "obj-15",
249
- "maxclass" : "message",
250
- "numinlets" : 2,
251
- "numoutlets" : 1,
252
- "outlettype" : [ "" ],
253
- "patching_rect" : [ 678.0, 112.0, 42.0, 22.0 ],
254
- "text" : "rec $1"
255
- }
256
-
257
- }
258
- , {
259
- "box" : {
260
- "id" : "obj-14",
261
- "maxclass" : "newobj",
262
- "numinlets" : 1,
263
- "numoutlets" : 1,
264
- "outlettype" : [ "" ],
265
- "patcher" : {
266
- "fileversion" : 1,
267
- "appversion" : {
268
- "major" : 9,
269
- "minor" : 0,
270
- "revision" : 5,
271
- "architecture" : "x64",
272
- "modernui" : 1
273
- }
274
- ,
275
- "classnamespace" : "box",
276
- "rect" : [ 84.0, 131.0, 1000.0, 780.0 ],
277
- "gridsize" : [ 15.0, 15.0 ],
278
- "boxes" : [ {
279
- "box" : {
280
- "comment" : "",
281
- "id" : "obj-2",
282
- "index" : 1,
283
- "maxclass" : "outlet",
284
- "numinlets" : 1,
285
- "numoutlets" : 0,
286
- "patching_rect" : [ 31.0, 145.0, 30.0, 30.0 ]
287
- }
288
-
289
- }
290
- , {
291
- "box" : {
292
- "comment" : "",
293
- "id" : "obj-1",
294
- "index" : 1,
295
- "maxclass" : "inlet",
296
- "numinlets" : 0,
297
- "numoutlets" : 1,
298
- "outlettype" : [ "" ],
299
- "patching_rect" : [ 31.0, 20.0, 30.0, 30.0 ]
300
- }
301
-
302
- }
303
- ],
304
- "lines" : [ {
305
- "patchline" : {
306
- "destination" : [ "obj-2", 0 ],
307
- "source" : [ "obj-1", 0 ]
308
- }
309
-
310
- }
311
- ],
312
- "originid" : "pat-6"
313
- }
314
- ,
315
- "patching_rect" : [ 572.0, 184.0, 44.0, 22.0 ],
316
- "text" : "p pass"
317
- }
318
-
319
- }
320
- , {
321
- "box" : {
322
- "id" : "obj-8",
323
- "maxclass" : "message",
324
- "numinlets" : 2,
325
- "numoutlets" : 1,
326
- "outlettype" : [ "" ],
327
- "patching_rect" : [ 534.0, 112.0, 31.0, 22.0 ],
328
- "text" : "stop"
329
- }
330
-
331
- }
332
- , {
333
- "box" : {
334
- "id" : "obj-7",
335
- "maxclass" : "message",
336
- "numinlets" : 2,
337
- "numoutlets" : 1,
338
- "outlettype" : [ "" ],
339
- "patching_rect" : [ 500.0, 112.0, 31.0, 22.0 ],
340
- "text" : "play"
341
- }
342
-
343
- }
344
- , {
345
- "box" : {
346
- "id" : "obj-5",
347
- "maxclass" : "newobj",
348
- "numinlets" : 2,
349
- "numoutlets" : 0,
350
- "patching_rect" : [ 533.0, 750.0, 55.0, 22.0 ],
351
- "text" : "dac~ 1 2"
352
- }
353
-
354
- }
355
- ],
356
- "lines" : [ {
357
- "patchline" : {
358
- "destination" : [ "obj-16", 1 ],
359
- "source" : [ "obj-1", 1 ]
360
- }
361
-
362
- }
363
- , {
364
- "patchline" : {
365
- "destination" : [ "obj-5", 0 ],
366
- "source" : [ "obj-1", 0 ]
367
- }
368
-
369
- }
370
- , {
371
- "patchline" : {
372
- "destination" : [ "obj-21", 0 ],
373
- "source" : [ "obj-10", 0 ]
374
- }
375
-
376
- }
377
- , {
378
- "patchline" : {
379
- "destination" : [ "obj-15", 0 ],
380
- "source" : [ "obj-12", 0 ]
381
- }
382
-
383
- }
384
- , {
385
- "patchline" : {
386
- "destination" : [ "obj-1", 0 ],
387
- "order" : 2,
388
- "source" : [ "obj-14", 0 ]
389
- }
390
-
391
- }
392
- , {
393
- "patchline" : {
394
- "destination" : [ "obj-2", 0 ],
395
- "order" : 1,
396
- "source" : [ "obj-14", 0 ]
397
- }
398
-
399
- }
400
- , {
401
- "patchline" : {
402
- "destination" : [ "obj-3", 0 ],
403
- "order" : 0,
404
- "source" : [ "obj-14", 0 ]
405
- }
406
-
407
- }
408
- , {
409
- "patchline" : {
410
- "destination" : [ "obj-14", 0 ],
411
- "source" : [ "obj-15", 0 ]
412
- }
413
-
414
- }
415
- , {
416
- "patchline" : {
417
- "destination" : [ "obj-17", 1 ],
418
- "source" : [ "obj-2", 1 ]
419
- }
420
-
421
- }
422
- , {
423
- "patchline" : {
424
- "destination" : [ "obj-5", 1 ],
425
- "order" : 0,
426
- "source" : [ "obj-2", 0 ]
427
- }
428
-
429
- }
430
- , {
431
- "patchline" : {
432
- "destination" : [ "obj-5", 0 ],
433
- "order" : 1,
434
- "source" : [ "obj-2", 0 ]
435
- }
436
-
437
- }
438
- , {
439
- "patchline" : {
440
- "destination" : [ "obj-14", 0 ],
441
- "source" : [ "obj-21", 0 ]
442
- }
443
-
444
- }
445
- , {
446
- "patchline" : {
447
- "destination" : [ "obj-14", 0 ],
448
- "source" : [ "obj-26", 0 ]
449
- }
450
-
451
- }
452
- , {
453
- "patchline" : {
454
- "destination" : [ "obj-26", 0 ],
455
- "order" : 1,
456
- "source" : [ "obj-28", 0 ]
457
- }
458
-
459
- }
460
- , {
461
- "patchline" : {
462
- "destination" : [ "obj-4", 0 ],
463
- "order" : 0,
464
- "source" : [ "obj-28", 0 ]
465
- }
466
-
467
- }
468
- , {
469
- "patchline" : {
470
- "destination" : [ "obj-18", 1 ],
471
- "source" : [ "obj-3", 1 ]
472
- }
473
-
474
- }
475
- , {
476
- "patchline" : {
477
- "destination" : [ "obj-5", 1 ],
478
- "source" : [ "obj-3", 0 ]
479
- }
480
-
481
- }
482
- , {
483
- "patchline" : {
484
- "destination" : [ "obj-14", 0 ],
485
- "source" : [ "obj-4", 0 ]
486
- }
487
-
488
- }
489
- , {
490
- "patchline" : {
491
- "destination" : [ "obj-14", 0 ],
492
- "source" : [ "obj-7", 0 ]
493
- }
494
-
495
- }
496
- , {
497
- "patchline" : {
498
- "destination" : [ "obj-14", 0 ],
499
- "source" : [ "obj-8", 0 ]
500
- }
501
-
502
- }
503
- ],
504
- "originid" : "pat-4",
505
- "parameters" : {
506
- "obj-1::obj-1124" : [ "morph", "dry/wet", 0 ],
507
- "obj-1::obj-1125" : [ "level[8]", "level", 0 ],
508
- "obj-1::obj-1128" : [ "gain[4]", "gain", 0 ],
509
- "obj-1::obj-1140" : [ "overdub", "overdub", 0 ],
510
- "obj-1::obj-117" : [ "live.drop", "live.drop", 0 ],
511
- "obj-1::obj-1230" : [ "speed[2]", "speed+", 0 ],
512
- "obj-1::obj-171" : [ "toggle[2]", "toggle[30]", 0 ],
513
- "obj-1::obj-295" : [ "button[1]", "button[1]", 0 ],
514
- "obj-1::obj-316" : [ "toggle[3]", "toggle[3]", 0 ],
515
- "obj-1::obj-424::obj-12" : [ "number[8]", "number[2]", 0 ],
516
- "obj-1::obj-424::obj-13" : [ "number[9]", "number[3]", 0 ],
517
- "obj-1::obj-424::obj-15" : [ "number[2]", "number[2]", 0 ],
518
- "obj-1::obj-424::obj-19" : [ "number[3]", "number[3]", 0 ],
519
- "obj-1::obj-424::obj-20" : [ "number", "number", 0 ],
520
- "obj-1::obj-424::obj-23" : [ "number[4]", "number[3]", 0 ],
521
- "obj-1::obj-424::obj-26" : [ "number[5]", "number[3]", 0 ],
522
- "obj-1::obj-424::obj-28" : [ "number[6]", "number[2]", 0 ],
523
- "obj-1::obj-424::obj-30" : [ "number[7]", "number[2]", 0 ],
524
- "obj-1::obj-424::obj-347" : [ "periodic", "periodic", 0 ],
525
- "obj-1::obj-424::obj-349" : [ "drop", "drop", 0 ],
526
- "obj-1::obj-424::obj-8" : [ "toggle", "toggle", 0 ],
527
- "obj-1::obj-54" : [ "lpf", "lpf", 0 ],
528
- "obj-1::obj-55" : [ "tapelength", "length", 0 ],
529
- "obj-1::obj-76" : [ "hpf", "hpf", 0 ],
530
- "obj-1::obj-91::obj-156" : [ "live.gain~[26]", "live.gain~", 0 ],
531
- "obj-1::obj-91::obj-162" : [ "live.gain~[25]", "live.gain~", 0 ],
532
- "obj-2::obj-1124" : [ "morph[1]", "dry/wet", 0 ],
533
- "obj-2::obj-1125" : [ "level[1]", "level", 0 ],
534
- "obj-2::obj-1128" : [ "gain[5]", "gain", 0 ],
535
- "obj-2::obj-1140" : [ "overdub[1]", "overdub", 0 ],
536
- "obj-2::obj-117" : [ "live.drop[1]", "live.drop", 0 ],
537
- "obj-2::obj-1230" : [ "speed[3]", "speed+", 0 ],
538
- "obj-2::obj-171" : [ "toggle[6]", "toggle[30]", 0 ],
539
- "obj-2::obj-295" : [ "button[2]", "button[1]", 0 ],
540
- "obj-2::obj-316" : [ "toggle[5]", "toggle[3]", 0 ],
541
- "obj-2::obj-424::obj-12" : [ "number[13]", "number[2]", 0 ],
542
- "obj-2::obj-424::obj-13" : [ "number[10]", "number[3]", 0 ],
543
- "obj-2::obj-424::obj-15" : [ "number[18]", "number[2]", 0 ],
544
- "obj-2::obj-424::obj-19" : [ "number[16]", "number[3]", 0 ],
545
- "obj-2::obj-424::obj-20" : [ "number[17]", "number", 0 ],
546
- "obj-2::obj-424::obj-23" : [ "number[15]", "number[3]", 0 ],
547
- "obj-2::obj-424::obj-26" : [ "number[12]", "number[3]", 0 ],
548
- "obj-2::obj-424::obj-28" : [ "number[14]", "number[2]", 0 ],
549
- "obj-2::obj-424::obj-30" : [ "number[11]", "number[2]", 0 ],
550
- "obj-2::obj-424::obj-347" : [ "periodic[1]", "periodic", 0 ],
551
- "obj-2::obj-424::obj-349" : [ "drop[1]", "drop", 0 ],
552
- "obj-2::obj-424::obj-8" : [ "toggle[4]", "toggle", 0 ],
553
- "obj-2::obj-54" : [ "lpf[1]", "lpf", 0 ],
554
- "obj-2::obj-55" : [ "tapelength[1]", "length", 0 ],
555
- "obj-2::obj-76" : [ "hpf[1]", "hpf", 0 ],
556
- "obj-2::obj-91::obj-156" : [ "live.gain~[2]", "live.gain~", 0 ],
557
- "obj-2::obj-91::obj-162" : [ "live.gain~[1]", "live.gain~", 0 ],
558
- "obj-3::obj-1124" : [ "morph[2]", "dry/wet", 0 ],
559
- "obj-3::obj-1125" : [ "level[2]", "level", 0 ],
560
- "obj-3::obj-1128" : [ "gain[6]", "gain", 0 ],
561
- "obj-3::obj-1140" : [ "overdub[2]", "overdub", 0 ],
562
- "obj-3::obj-117" : [ "live.drop[2]", "live.drop", 0 ],
563
- "obj-3::obj-1230" : [ "speed[4]", "speed+", 0 ],
564
- "obj-3::obj-171" : [ "toggle[9]", "toggle[30]", 0 ],
565
- "obj-3::obj-295" : [ "button[3]", "button[1]", 0 ],
566
- "obj-3::obj-316" : [ "toggle[8]", "toggle[3]", 0 ],
567
- "obj-3::obj-424::obj-12" : [ "number[26]", "number[2]", 0 ],
568
- "obj-3::obj-424::obj-13" : [ "number[24]", "number[3]", 0 ],
569
- "obj-3::obj-424::obj-15" : [ "number[21]", "number[2]", 0 ],
570
- "obj-3::obj-424::obj-19" : [ "number[19]", "number[3]", 0 ],
571
- "obj-3::obj-424::obj-20" : [ "number[25]", "number", 0 ],
572
- "obj-3::obj-424::obj-23" : [ "number[23]", "number[3]", 0 ],
573
- "obj-3::obj-424::obj-26" : [ "number[27]", "number[3]", 0 ],
574
- "obj-3::obj-424::obj-28" : [ "number[22]", "number[2]", 0 ],
575
- "obj-3::obj-424::obj-30" : [ "number[20]", "number[2]", 0 ],
576
- "obj-3::obj-424::obj-347" : [ "periodic[2]", "periodic", 0 ],
577
- "obj-3::obj-424::obj-349" : [ "drop[2]", "drop", 0 ],
578
- "obj-3::obj-424::obj-8" : [ "toggle[7]", "toggle", 0 ],
579
- "obj-3::obj-54" : [ "lpf[2]", "lpf", 0 ],
580
- "obj-3::obj-55" : [ "tapelength[2]", "length", 0 ],
581
- "obj-3::obj-76" : [ "hpf[2]", "hpf", 0 ],
582
- "obj-3::obj-91::obj-156" : [ "live.gain~[3]", "live.gain~", 0 ],
583
- "obj-3::obj-91::obj-162" : [ "live.gain~[4]", "live.gain~", 0 ],
584
- "parameterbanks" : {
585
- "0" : {
586
- "index" : 0,
587
- "name" : "",
588
- "parameters" : [ "-", "-", "-", "-", "-", "-", "-", "-" ]
589
- }
590
-
591
- }
592
- ,
593
- "parameter_overrides" : {
594
- "obj-2::obj-1124" : {
595
- "parameter_longname" : "morph[1]"
596
- }
597
- ,
598
- "obj-2::obj-1125" : {
599
- "parameter_longname" : "level[1]"
600
- }
601
- ,
602
- "obj-2::obj-1128" : {
603
- "parameter_longname" : "gain[5]"
604
- }
605
- ,
606
- "obj-2::obj-1140" : {
607
- "parameter_longname" : "overdub[1]"
608
- }
609
- ,
610
- "obj-2::obj-117" : {
611
- "parameter_longname" : "live.drop[1]"
612
- }
613
- ,
614
- "obj-2::obj-1230" : {
615
- "parameter_longname" : "speed[3]"
616
- }
617
- ,
618
- "obj-2::obj-424::obj-347" : {
619
- "parameter_longname" : "periodic[1]"
620
- }
621
- ,
622
- "obj-2::obj-424::obj-349" : {
623
- "parameter_longname" : "drop[1]"
624
- }
625
- ,
626
- "obj-2::obj-54" : {
627
- "parameter_longname" : "lpf[1]"
628
- }
629
- ,
630
- "obj-2::obj-55" : {
631
- "parameter_longname" : "tapelength[1]"
632
- }
633
- ,
634
- "obj-2::obj-76" : {
635
- "parameter_longname" : "hpf[1]"
636
- }
637
- ,
638
- "obj-2::obj-91::obj-156" : {
639
- "parameter_longname" : "live.gain~[2]"
640
- }
641
- ,
642
- "obj-2::obj-91::obj-162" : {
643
- "parameter_longname" : "live.gain~[1]"
644
- }
645
- ,
646
- "obj-3::obj-1124" : {
647
- "parameter_longname" : "morph[2]"
648
- }
649
- ,
650
- "obj-3::obj-1125" : {
651
- "parameter_longname" : "level[2]"
652
- }
653
- ,
654
- "obj-3::obj-1128" : {
655
- "parameter_longname" : "gain[6]"
656
- }
657
- ,
658
- "obj-3::obj-1140" : {
659
- "parameter_longname" : "overdub[2]"
660
- }
661
- ,
662
- "obj-3::obj-117" : {
663
- "parameter_longname" : "live.drop[2]"
664
- }
665
- ,
666
- "obj-3::obj-1230" : {
667
- "parameter_longname" : "speed[4]"
668
- }
669
- ,
670
- "obj-3::obj-424::obj-347" : {
671
- "parameter_longname" : "periodic[2]"
672
- }
673
- ,
674
- "obj-3::obj-424::obj-349" : {
675
- "parameter_longname" : "drop[2]"
676
- }
677
- ,
678
- "obj-3::obj-54" : {
679
- "parameter_longname" : "lpf[2]"
680
- }
681
- ,
682
- "obj-3::obj-55" : {
683
- "parameter_longname" : "tapelength[2]"
684
- }
685
- ,
686
- "obj-3::obj-76" : {
687
- "parameter_longname" : "hpf[2]"
688
- }
689
- ,
690
- "obj-3::obj-91::obj-156" : {
691
- "parameter_longname" : "live.gain~[3]"
692
- }
693
- ,
694
- "obj-3::obj-91::obj-162" : {
695
- "parameter_longname" : "live.gain~[4]"
696
- }
697
-
698
- }
699
- ,
700
- "inherited_shortname" : 1
701
- }
702
- ,
703
- "dependency_cache" : [ {
704
- "name" : "dry-wet.maxpat",
705
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
706
- "patcherrelativepath" : ".",
707
- "type" : "JSON",
708
- "implicit" : 1
709
- }
710
- , {
711
- "name" : "unloop-bpatcher.maxpat",
712
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
713
- "patcherrelativepath" : ".",
714
- "type" : "JSON",
715
- "implicit" : 1
716
- }
717
- , {
718
- "name" : "vampnet-ui.maxpat",
719
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
720
- "patcherrelativepath" : ".",
721
- "type" : "JSON",
722
- "implicit" : 1
723
- }
724
- ],
725
- "autosave" : 0
726
- }
727
-
728
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/two-gate.maxpat DELETED
@@ -1,184 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 8,
6
- "minor" : 6,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
14
- "bglocked" : 0,
15
- "openinpresentation" : 0,
16
- "default_fontsize" : 12.0,
17
- "default_fontface" : 0,
18
- "default_fontname" : "Arial",
19
- "gridonopen" : 1,
20
- "gridsize" : [ 15.0, 15.0 ],
21
- "gridsnaponopen" : 1,
22
- "objectsnaponopen" : 1,
23
- "statusbarvisible" : 2,
24
- "toolbarvisible" : 1,
25
- "lefttoolbarpinned" : 0,
26
- "toptoolbarpinned" : 0,
27
- "righttoolbarpinned" : 0,
28
- "bottomtoolbarpinned" : 0,
29
- "toolbars_unpinned_last_save" : 0,
30
- "tallnewobj" : 0,
31
- "boxanimatetime" : 200,
32
- "enablehscroll" : 1,
33
- "enablevscroll" : 1,
34
- "devicewidth" : 0.0,
35
- "description" : "",
36
- "digest" : "",
37
- "tags" : "",
38
- "style" : "",
39
- "subpatcher_template" : "",
40
- "assistshowspatchername" : 0,
41
- "boxes" : [ {
42
- "box" : {
43
- "comment" : "",
44
- "id" : "obj-4",
45
- "index" : 2,
46
- "maxclass" : "outlet",
47
- "numinlets" : 1,
48
- "numoutlets" : 0,
49
- "patching_rect" : [ 70.491801261901855, 137.704914093017578, 30.0, 30.0 ]
50
- }
51
-
52
- }
53
- , {
54
- "box" : {
55
- "comment" : "",
56
- "id" : "obj-3",
57
- "index" : 1,
58
- "maxclass" : "outlet",
59
- "numinlets" : 1,
60
- "numoutlets" : 0,
61
- "patching_rect" : [ 26.229507446289062, 137.704914093017578, 30.0, 30.0 ]
62
- }
63
-
64
- }
65
- , {
66
- "box" : {
67
- "comment" : "",
68
- "id" : "obj-1",
69
- "index" : 2,
70
- "maxclass" : "inlet",
71
- "numinlets" : 0,
72
- "numoutlets" : 1,
73
- "outlettype" : [ "" ],
74
- "patching_rect" : [ 70.491801261901855, 28.688523769378662, 30.0, 30.0 ]
75
- }
76
-
77
- }
78
- , {
79
- "box" : {
80
- "comment" : "",
81
- "id" : "obj-518",
82
- "index" : 1,
83
- "maxclass" : "inlet",
84
- "numinlets" : 0,
85
- "numoutlets" : 1,
86
- "outlettype" : [ "" ],
87
- "patching_rect" : [ 26.229507446289062, 28.688523769378662, 30.0, 30.0 ]
88
- }
89
-
90
- }
91
- , {
92
- "box" : {
93
- "id" : "obj-517",
94
- "maxclass" : "newobj",
95
- "numinlets" : 2,
96
- "numoutlets" : 1,
97
- "outlettype" : [ "int" ],
98
- "patching_rect" : [ 69.672129154205322, 74.590161800384521, 33.0, 22.0 ],
99
- "text" : "== 0"
100
- }
101
-
102
- }
103
- , {
104
- "box" : {
105
- "id" : "obj-516",
106
- "maxclass" : "newobj",
107
- "numinlets" : 2,
108
- "numoutlets" : 1,
109
- "outlettype" : [ "" ],
110
- "patching_rect" : [ 69.672129154205322, 106.557374000549316, 32.0, 22.0 ],
111
- "text" : "gate"
112
- }
113
-
114
- }
115
- , {
116
- "box" : {
117
- "id" : "obj-515",
118
- "maxclass" : "newobj",
119
- "numinlets" : 2,
120
- "numoutlets" : 1,
121
- "outlettype" : [ "" ],
122
- "patching_rect" : [ 26.229507446289062, 106.557374000549316, 32.0, 22.0 ],
123
- "text" : "gate"
124
- }
125
-
126
- }
127
- ],
128
- "lines" : [ {
129
- "patchline" : {
130
- "destination" : [ "obj-515", 1 ],
131
- "order" : 1,
132
- "source" : [ "obj-1", 0 ]
133
- }
134
-
135
- }
136
- , {
137
- "patchline" : {
138
- "destination" : [ "obj-516", 1 ],
139
- "order" : 0,
140
- "source" : [ "obj-1", 0 ]
141
- }
142
-
143
- }
144
- , {
145
- "patchline" : {
146
- "destination" : [ "obj-3", 0 ],
147
- "source" : [ "obj-515", 0 ]
148
- }
149
-
150
- }
151
- , {
152
- "patchline" : {
153
- "destination" : [ "obj-4", 0 ],
154
- "source" : [ "obj-516", 0 ]
155
- }
156
-
157
- }
158
- , {
159
- "patchline" : {
160
- "destination" : [ "obj-516", 0 ],
161
- "source" : [ "obj-517", 0 ]
162
- }
163
-
164
- }
165
- , {
166
- "patchline" : {
167
- "destination" : [ "obj-515", 0 ],
168
- "order" : 1,
169
- "source" : [ "obj-518", 0 ]
170
- }
171
-
172
- }
173
- , {
174
- "patchline" : {
175
- "destination" : [ "obj-517", 0 ],
176
- "order" : 0,
177
- "source" : [ "obj-518", 0 ]
178
- }
179
-
180
- }
181
- ]
182
- }
183
-
184
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/unloop-bpatcher.maxpat DELETED
The diff for this file is too large to render. See raw diff
 
unloop/max/unloop.maxpat DELETED
@@ -1,130 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 9,
6
- "minor" : 0,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 84.0, 131.0, 1000.0, 780.0 ],
14
- "gridsize" : [ 15.0, 15.0 ],
15
- "boxes" : [ {
16
- "box" : {
17
- "bgmode" : 0,
18
- "border" : 0,
19
- "clickthrough" : 0,
20
- "enablehscroll" : 0,
21
- "enablevscroll" : 0,
22
- "id" : "obj-2",
23
- "lockeddragscroll" : 0,
24
- "lockedsize" : 0,
25
- "maxclass" : "bpatcher",
26
- "name" : "unloop-bpatcher.maxpat",
27
- "numinlets" : 2,
28
- "numoutlets" : 2,
29
- "offset" : [ 0.0, 0.0 ],
30
- "outlettype" : [ "signal", "" ],
31
- "patching_rect" : [ 100.0, 68.0, 307.0, 469.0 ],
32
- "viewvisibility" : 1
33
- }
34
-
35
- }
36
- , {
37
- "box" : {
38
- "id" : "obj-1",
39
- "maxclass" : "newobj",
40
- "numinlets" : 2,
41
- "numoutlets" : 0,
42
- "patching_rect" : [ 143.0, 616.0, 55.0, 22.0 ],
43
- "text" : "dac~ 1 2"
44
- }
45
-
46
- }
47
- ],
48
- "lines" : [ {
49
- "patchline" : {
50
- "destination" : [ "obj-1", 1 ],
51
- "order" : 0,
52
- "source" : [ "obj-2", 0 ]
53
- }
54
-
55
- }
56
- , {
57
- "patchline" : {
58
- "destination" : [ "obj-1", 0 ],
59
- "order" : 1,
60
- "source" : [ "obj-2", 0 ]
61
- }
62
-
63
- }
64
- ],
65
- "originid" : "pat-142",
66
- "parameters" : {
67
- "obj-2::obj-1124" : [ "morph", "dry/wet", 0 ],
68
- "obj-2::obj-1125" : [ "level[8]", "level", 0 ],
69
- "obj-2::obj-1128" : [ "gain[4]", "gain", 0 ],
70
- "obj-2::obj-1140" : [ "overdub", "overdub", 0 ],
71
- "obj-2::obj-117" : [ "live.drop", "live.drop", 0 ],
72
- "obj-2::obj-1230" : [ "speed[2]", "speed+", 0 ],
73
- "obj-2::obj-171" : [ "toggle[2]", "toggle[30]", 0 ],
74
- "obj-2::obj-295" : [ "button[1]", "button[1]", 0 ],
75
- "obj-2::obj-316" : [ "toggle[3]", "toggle[3]", 0 ],
76
- "obj-2::obj-424::obj-12" : [ "number[8]", "number[2]", 0 ],
77
- "obj-2::obj-424::obj-13" : [ "number[9]", "number[3]", 0 ],
78
- "obj-2::obj-424::obj-15" : [ "number[2]", "number[2]", 0 ],
79
- "obj-2::obj-424::obj-19" : [ "number[3]", "number[3]", 0 ],
80
- "obj-2::obj-424::obj-20" : [ "number", "number", 0 ],
81
- "obj-2::obj-424::obj-23" : [ "number[4]", "number[3]", 0 ],
82
- "obj-2::obj-424::obj-26" : [ "number[5]", "number[3]", 0 ],
83
- "obj-2::obj-424::obj-28" : [ "number[6]", "number[2]", 0 ],
84
- "obj-2::obj-424::obj-30" : [ "number[7]", "number[2]", 0 ],
85
- "obj-2::obj-424::obj-347" : [ "periodic", "periodic", 0 ],
86
- "obj-2::obj-424::obj-349" : [ "drop", "drop", 0 ],
87
- "obj-2::obj-424::obj-8" : [ "toggle", "toggle", 0 ],
88
- "obj-2::obj-54" : [ "lpf", "lpf", 0 ],
89
- "obj-2::obj-55" : [ "tapelength", "length", 0 ],
90
- "obj-2::obj-76" : [ "hpf", "hpf", 0 ],
91
- "obj-2::obj-91::obj-156" : [ "live.gain~[26]", "live.gain~", 0 ],
92
- "obj-2::obj-91::obj-162" : [ "live.gain~[25]", "live.gain~", 0 ],
93
- "parameterbanks" : {
94
- "0" : {
95
- "index" : 0,
96
- "name" : "",
97
- "parameters" : [ "-", "-", "-", "-", "-", "-", "-", "-" ]
98
- }
99
-
100
- }
101
- ,
102
- "inherited_shortname" : 1
103
- }
104
- ,
105
- "dependency_cache" : [ {
106
- "name" : "dry-wet.maxpat",
107
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
108
- "patcherrelativepath" : ".",
109
- "type" : "JSON",
110
- "implicit" : 1
111
- }
112
- , {
113
- "name" : "unloop-bpatcher.maxpat",
114
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
115
- "patcherrelativepath" : ".",
116
- "type" : "JSON",
117
- "implicit" : 1
118
- }
119
- , {
120
- "name" : "vampnet-ui.maxpat",
121
- "bootpath" : "~/projects/research/unloop-2025/vampnet/unloop/max",
122
- "patcherrelativepath" : ".",
123
- "type" : "JSON",
124
- "implicit" : 1
125
- }
126
- ],
127
- "autosave" : 0
128
- }
129
-
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/max/vampnet-ui.maxpat DELETED
@@ -1,1314 +0,0 @@
1
- {
2
- "patcher" : {
3
- "fileversion" : 1,
4
- "appversion" : {
5
- "major" : 9,
6
- "minor" : 0,
7
- "revision" : 5,
8
- "architecture" : "x64",
9
- "modernui" : 1
10
- }
11
- ,
12
- "classnamespace" : "box",
13
- "rect" : [ 34.0, 87.0, 814.0, 779.0 ],
14
- "openinpresentation" : 1,
15
- "gridsize" : [ 15.0, 15.0 ],
16
- "boxes" : [ {
17
- "box" : {
18
- "fontsize" : 8.0,
19
- "id" : "obj-13",
20
- "maxclass" : "number",
21
- "maximum" : 64,
22
- "minimum" : 1,
23
- "numinlets" : 1,
24
- "numoutlets" : 2,
25
- "outlettype" : [ "", "bang" ],
26
- "parameter_enable" : 1,
27
- "patching_rect" : [ 1310.734448432922363, 511.55017364025116, 42.0, 17.0 ],
28
- "presentation" : 1,
29
- "presentation_rect" : [ 89.5, 135.0, 42.0, 17.0 ],
30
- "saved_attribute_attributes" : {
31
- "valueof" : {
32
- "parameter_initial" : [ 1 ],
33
- "parameter_initial_enable" : 1,
34
- "parameter_longname" : "number[24]",
35
- "parameter_mmax" : 64.0,
36
- "parameter_mmin" : 1.0,
37
- "parameter_modmode" : 3,
38
- "parameter_shortname" : "number[3]",
39
- "parameter_type" : 0
40
- }
41
-
42
- }
43
- ,
44
- "varname" : "number[8]"
45
- }
46
-
47
- }
48
- , {
49
- "box" : {
50
- "fontsize" : 8.0,
51
- "id" : "obj-14",
52
- "linecount" : 2,
53
- "maxclass" : "comment",
54
- "numinlets" : 1,
55
- "numoutlets" : 0,
56
- "patching_rect" : [ 1310.734448432922363, 472.547349274158478, 55.0, 24.0 ],
57
- "presentation" : 1,
58
- "presentation_rect" : [ 7.120483428239822, 135.939657211303711, 70.0, 15.0 ],
59
- "text" : "feedback steps"
60
- }
61
-
62
- }
63
- , {
64
- "box" : {
65
- "fontsize" : 8.0,
66
- "id" : "obj-4",
67
- "linecount" : 3,
68
- "maxclass" : "comment",
69
- "numinlets" : 1,
70
- "numoutlets" : 0,
71
- "patching_rect" : [ 1257.333370804786682, 468.047349274158478, 38.0, 33.0 ],
72
- "presentation" : 1,
73
- "presentation_rect" : [ 6.770833075046539, 114.960636019706726, 69.107615292072296, 15.0 ],
74
- "text" : "beat mask ms"
75
- }
76
-
77
- }
78
- , {
79
- "box" : {
80
- "fontsize" : 8.0,
81
- "format" : 6,
82
- "id" : "obj-12",
83
- "maxclass" : "flonum",
84
- "maximum" : 400.0,
85
- "minimum" : 0.0,
86
- "numinlets" : 1,
87
- "numoutlets" : 2,
88
- "outlettype" : [ "", "bang" ],
89
- "parameter_enable" : 1,
90
- "patching_rect" : [ 1258.000037491321564, 506.71401709318161, 40.0, 17.0 ],
91
- "presentation" : 1,
92
- "presentation_rect" : [ 90.5, 113.960636019706726, 40.0, 17.0 ],
93
- "saved_attribute_attributes" : {
94
- "valueof" : {
95
- "parameter_initial" : [ 0.0 ],
96
- "parameter_initial_enable" : 1,
97
- "parameter_longname" : "number[26]",
98
- "parameter_mmax" : 400.0,
99
- "parameter_modmode" : 3,
100
- "parameter_shortname" : "number[2]",
101
- "parameter_type" : 0
102
- }
103
-
104
- }
105
- ,
106
- "varname" : "number[7]"
107
- }
108
-
109
- }
110
- , {
111
- "box" : {
112
- "fontsize" : 8.0,
113
- "format" : 6,
114
- "id" : "obj-30",
115
- "maxclass" : "flonum",
116
- "maximum" : 1.0,
117
- "minimum" : 0.0,
118
- "numinlets" : 1,
119
- "numoutlets" : 2,
120
- "outlettype" : [ "", "bang" ],
121
- "parameter_enable" : 1,
122
- "patching_rect" : [ 1207.467486619949341, 506.74109160900116, 40.0, 17.0 ],
123
- "presentation" : 1,
124
- "presentation_rect" : [ 224.601398587226868, 114.829166448116297, 41.258741676807404, 17.0 ],
125
- "saved_attribute_attributes" : {
126
- "valueof" : {
127
- "parameter_initial" : [ 0.0 ],
128
- "parameter_initial_enable" : 1,
129
- "parameter_longname" : "number[20]",
130
- "parameter_mmax" : 1.0,
131
- "parameter_modmode" : 3,
132
- "parameter_shortname" : "number[2]",
133
- "parameter_type" : 0
134
- }
135
-
136
- }
137
- ,
138
- "varname" : "number[6]"
139
- }
140
-
141
- }
142
- , {
143
- "box" : {
144
- "fontsize" : 8.0,
145
- "id" : "obj-29",
146
- "maxclass" : "comment",
147
- "numinlets" : 1,
148
- "numoutlets" : 0,
149
- "patching_rect" : [ 1209.467486619949341, 468.047349274158478, 38.0, 15.0 ],
150
- "presentation" : 1,
151
- "presentation_rect" : [ 149.0, 118.229166448116302, 54.0, 15.0 ],
152
- "text" : "top p"
153
- }
154
-
155
- }
156
- , {
157
- "box" : {
158
- "fontsize" : 8.0,
159
- "id" : "obj-27",
160
- "maxclass" : "comment",
161
- "numinlets" : 1,
162
- "numoutlets" : 0,
163
- "patching_rect" : [ 1165.088787257671356, 468.279552161693573, 38.0, 15.0 ],
164
- "presentation" : 1,
165
- "presentation_rect" : [ 149.0, 135.229166448116302, 54.0, 15.0 ],
166
- "text" : "temp"
167
- }
168
-
169
- }
170
- , {
171
- "box" : {
172
- "fontsize" : 8.0,
173
- "format" : 6,
174
- "id" : "obj-28",
175
- "maxclass" : "flonum",
176
- "maximum" : 5.0,
177
- "minimum" : 0.0,
178
- "numinlets" : 1,
179
- "numoutlets" : 2,
180
- "outlettype" : [ "", "bang" ],
181
- "parameter_enable" : 1,
182
- "patching_rect" : [ 1165.680503249168396, 506.74109160900116, 40.0, 17.0 ],
183
- "presentation" : 1,
184
- "presentation_rect" : [ 224.601398587226868, 134.229166448116302, 41.258741676807404, 17.0 ],
185
- "saved_attribute_attributes" : {
186
- "valueof" : {
187
- "parameter_initial" : [ 1.0 ],
188
- "parameter_initial_enable" : 1,
189
- "parameter_longname" : "number[22]",
190
- "parameter_mmax" : 5.0,
191
- "parameter_modmode" : 3,
192
- "parameter_shortname" : "number[2]",
193
- "parameter_type" : 0
194
- }
195
-
196
- }
197
- ,
198
- "varname" : "number[5]"
199
- }
200
-
201
- }
202
- , {
203
- "box" : {
204
- "fontsize" : 8.0,
205
- "id" : "obj-26",
206
- "maxclass" : "number",
207
- "maximum" : 64,
208
- "minimum" : 8,
209
- "numinlets" : 1,
210
- "numoutlets" : 2,
211
- "outlettype" : [ "", "bang" ],
212
- "parameter_enable" : 1,
213
- "patching_rect" : [ 1095.275648653507233, 507.086641073226929, 42.0, 17.0 ],
214
- "presentation" : 1,
215
- "presentation_rect" : [ 224.0, 95.429166448116291, 42.0, 17.0 ],
216
- "saved_attribute_attributes" : {
217
- "valueof" : {
218
- "parameter_initial" : [ 32 ],
219
- "parameter_initial_enable" : 1,
220
- "parameter_longname" : "number[27]",
221
- "parameter_mmax" : 64.0,
222
- "parameter_mmin" : 8.0,
223
- "parameter_modmode" : 3,
224
- "parameter_shortname" : "number[3]",
225
- "parameter_type" : 0
226
- }
227
-
228
- }
229
- ,
230
- "varname" : "number[4]"
231
- }
232
-
233
- }
234
- , {
235
- "box" : {
236
- "fontsize" : 8.0,
237
- "id" : "obj-25",
238
- "maxclass" : "comment",
239
- "numinlets" : 1,
240
- "numoutlets" : 0,
241
- "patching_rect" : [ 1107.086672902107239, 463.779552161693573, 55.0, 15.0 ],
242
- "presentation" : 1,
243
- "presentation_rect" : [ 149.0, 96.229166448116302, 70.0, 15.0 ],
244
- "text" : "num steps"
245
- }
246
-
247
- }
248
- , {
249
- "box" : {
250
- "fontsize" : 8.0,
251
- "id" : "obj-23",
252
- "maxclass" : "number",
253
- "maximum" : 1024,
254
- "minimum" : 0,
255
- "numinlets" : 1,
256
- "numoutlets" : 2,
257
- "outlettype" : [ "", "bang" ],
258
- "parameter_enable" : 1,
259
- "patching_rect" : [ 1037.79533064365387, 507.086641073226929, 42.0, 17.0 ],
260
- "presentation" : 1,
261
- "presentation_rect" : [ 224.0, 76.0291664481163, 42.0, 17.0 ],
262
- "saved_attribute_attributes" : {
263
- "valueof" : {
264
- "parameter_initial" : [ 0 ],
265
- "parameter_initial_enable" : 1,
266
- "parameter_longname" : "number[23]",
267
- "parameter_mmax" : 1024.0,
268
- "parameter_modmode" : 3,
269
- "parameter_shortname" : "number[3]",
270
- "parameter_type" : 0
271
- }
272
-
273
- }
274
- ,
275
- "varname" : "number[3]"
276
- }
277
-
278
- }
279
- , {
280
- "box" : {
281
- "fontsize" : 8.0,
282
- "id" : "obj-24",
283
- "linecount" : 2,
284
- "maxclass" : "comment",
285
- "numinlets" : 1,
286
- "numoutlets" : 0,
287
- "patching_rect" : [ 1037.007929027080536, 463.779552161693573, 55.0, 24.0 ],
288
- "presentation" : 1,
289
- "presentation_rect" : [ 149.0, 77.229166448116302, 70.0, 15.0 ],
290
- "text" : "onset mask width"
291
- }
292
-
293
- }
294
- , {
295
- "box" : {
296
- "id" : "obj-22",
297
- "maxclass" : "newobj",
298
- "numinlets" : 1,
299
- "numoutlets" : 1,
300
- "outlettype" : [ "bang" ],
301
- "patching_rect" : [ 779.0, 402.0, 58.0, 22.0 ],
302
- "text" : "loadbang"
303
- }
304
-
305
- }
306
- , {
307
- "box" : {
308
- "fontsize" : 8.0,
309
- "id" : "obj-21",
310
- "linecount" : 3,
311
- "maxclass" : "comment",
312
- "numinlets" : 1,
313
- "numoutlets" : 0,
314
- "patching_rect" : [ 972.0, 425.0, 45.0, 33.0 ],
315
- "presentation" : 1,
316
- "presentation_rect" : [ 6.770833075046539, 94.000002801418304, 92.0, 15.0 ],
317
- "text" : "codebook level mask"
318
- }
319
-
320
- }
321
- , {
322
- "box" : {
323
- "fontsize" : 8.0,
324
- "id" : "obj-20",
325
- "maxclass" : "number",
326
- "maximum" : 14,
327
- "minimum" : 1,
328
- "numinlets" : 1,
329
- "numoutlets" : 2,
330
- "outlettype" : [ "", "bang" ],
331
- "parameter_enable" : 1,
332
- "patching_rect" : [ 973.0, 507.0, 45.0, 17.0 ],
333
- "presentation" : 1,
334
- "presentation_rect" : [ 85.5, 93.000002801418304, 45.0, 17.0 ],
335
- "saved_attribute_attributes" : {
336
- "valueof" : {
337
- "parameter_initial" : [ 4 ],
338
- "parameter_initial_enable" : 1,
339
- "parameter_longname" : "number[25]",
340
- "parameter_mmax" : 14.0,
341
- "parameter_mmin" : 1.0,
342
- "parameter_modmode" : 3,
343
- "parameter_shortname" : "number",
344
- "parameter_type" : 0
345
- }
346
-
347
- }
348
- ,
349
- "varname" : "number"
350
- }
351
-
352
- }
353
- , {
354
- "box" : {
355
- "fontsize" : 8.0,
356
- "id" : "obj-19",
357
- "maxclass" : "number",
358
- "maximum" : 1024,
359
- "minimum" : 0,
360
- "numinlets" : 1,
361
- "numoutlets" : 2,
362
- "outlettype" : [ "", "bang" ],
363
- "parameter_enable" : 1,
364
- "patching_rect" : [ 906.0, 507.0, 42.0, 17.0 ],
365
- "presentation" : 1,
366
- "presentation_rect" : [ 224.0, 56.629166448116301, 42.0, 17.0 ],
367
- "saved_attribute_attributes" : {
368
- "valueof" : {
369
- "parameter_initial" : [ 64 ],
370
- "parameter_initial_enable" : 1,
371
- "parameter_longname" : "number[19]",
372
- "parameter_mmax" : 1024.0,
373
- "parameter_modmode" : 3,
374
- "parameter_shortname" : "number[3]",
375
- "parameter_type" : 0
376
- }
377
-
378
- }
379
- ,
380
- "varname" : "number[2]"
381
- }
382
-
383
- }
384
- , {
385
- "box" : {
386
- "fontsize" : 8.0,
387
- "id" : "obj-17",
388
- "linecount" : 2,
389
- "maxclass" : "comment",
390
- "numinlets" : 1,
391
- "numoutlets" : 0,
392
- "patching_rect" : [ 905.0, 464.0, 55.0, 24.0 ],
393
- "presentation" : 1,
394
- "presentation_rect" : [ 149.0, 58.229166448116302, 70.0, 15.0 ],
395
- "text" : "typical min tok"
396
- }
397
-
398
- }
399
- , {
400
- "box" : {
401
- "fontsize" : 8.0,
402
- "id" : "obj-16",
403
- "linecount" : 2,
404
- "maxclass" : "comment",
405
- "numinlets" : 1,
406
- "numoutlets" : 0,
407
- "patching_rect" : [ 842.0, 464.0, 38.0, 24.0 ],
408
- "presentation" : 1,
409
- "presentation_rect" : [ 149.0, 38.229166448116302, 54.0, 15.0 ],
410
- "text" : "typical mass"
411
- }
412
-
413
- }
414
- , {
415
- "box" : {
416
- "fontsize" : 8.0,
417
- "format" : 6,
418
- "id" : "obj-15",
419
- "maxclass" : "flonum",
420
- "maximum" : 1.0,
421
- "minimum" : 0.0,
422
- "numinlets" : 1,
423
- "numoutlets" : 2,
424
- "outlettype" : [ "", "bang" ],
425
- "parameter_enable" : 1,
426
- "patching_rect" : [ 843.0, 502.526752233505249, 40.0, 17.0 ],
427
- "presentation" : 1,
428
- "presentation_rect" : [ 224.251748234033585, 37.229166448116302, 41.608392030000687, 17.0 ],
429
- "saved_attribute_attributes" : {
430
- "valueof" : {
431
- "parameter_initial" : [ 0.15 ],
432
- "parameter_initial_enable" : 1,
433
- "parameter_longname" : "number[21]",
434
- "parameter_mmax" : 1.0,
435
- "parameter_modmode" : 3,
436
- "parameter_shortname" : "number[2]",
437
- "parameter_type" : 0
438
- }
439
-
440
- }
441
- ,
442
- "varname" : "number[1]"
443
- }
444
-
445
- }
446
- , {
447
- "box" : {
448
- "fontsize" : 8.0,
449
- "id" : "obj-9",
450
- "linecount" : 2,
451
- "maxclass" : "comment",
452
- "numinlets" : 1,
453
- "numoutlets" : 0,
454
- "patching_rect" : [ 782.0, 463.965681314468384, 38.0, 24.0 ],
455
- "presentation" : 1,
456
- "presentation_rect" : [ 149.0, 19.229166448116302, 57.0, 15.0 ],
457
- "text" : "typical filter"
458
- }
459
-
460
- }
461
- , {
462
- "box" : {
463
- "id" : "obj-8",
464
- "maxclass" : "toggle",
465
- "numinlets" : 1,
466
- "numoutlets" : 1,
467
- "outlettype" : [ "int" ],
468
- "parameter_enable" : 1,
469
- "patching_rect" : [ 787.0, 501.526752233505249, 24.0, 24.0 ],
470
- "presentation" : 1,
471
- "presentation_rect" : [ 224.251748234033585, 18.729166209697723, 16.000000476837158, 16.000000476837158 ],
472
- "saved_attribute_attributes" : {
473
- "valueof" : {
474
- "parameter_enum" : [ "off", "on" ],
475
- "parameter_initial" : [ 1 ],
476
- "parameter_initial_enable" : 1,
477
- "parameter_longname" : "toggle[7]",
478
- "parameter_mmax" : 1,
479
- "parameter_modmode" : 0,
480
- "parameter_shortname" : "toggle",
481
- "parameter_type" : 2
482
- }
483
-
484
- }
485
- ,
486
- "varname" : "toggle"
487
- }
488
-
489
- }
490
- , {
491
- "box" : {
492
- "id" : "obj-2",
493
- "maxclass" : "newobj",
494
- "numinlets" : 2,
495
- "numoutlets" : 1,
496
- "outlettype" : [ "int" ],
497
- "patching_rect" : [ 599.350643634796143, 319.48051643371582, 33.0, 22.0 ],
498
- "text" : "== 0"
499
- }
500
-
501
- }
502
- , {
503
- "box" : {
504
- "id" : "obj-11",
505
- "maxclass" : "newobj",
506
- "numinlets" : 1,
507
- "numoutlets" : 1,
508
- "outlettype" : [ "" ],
509
- "patching_rect" : [ 377.0, 415.740486621856689, 70.0, 22.0 ],
510
- "text" : "loadmess 3"
511
- }
512
-
513
- }
514
- , {
515
- "box" : {
516
- "id" : "obj-10",
517
- "maxclass" : "newobj",
518
- "numinlets" : 1,
519
- "numoutlets" : 1,
520
- "outlettype" : [ "bang" ],
521
- "patching_rect" : [ 480.931334972381592, 415.740486621856689, 58.0, 22.0 ],
522
- "text" : "loadbang"
523
- }
524
-
525
- }
526
- , {
527
- "box" : {
528
- "id" : "obj-7",
529
- "maxclass" : "newobj",
530
- "numinlets" : 1,
531
- "numoutlets" : 0,
532
- "patching_rect" : [ 326.666805624961853, 88.0, 335.0, 22.0 ],
533
- "text" : "print #0-VAMPNET_UI_COMMAND_NOT_UNDERSTOOD"
534
- }
535
-
536
- }
537
- , {
538
- "box" : {
539
- "id" : "obj-6",
540
- "maxclass" : "newobj",
541
- "numinlets" : 6,
542
- "numoutlets" : 6,
543
- "outlettype" : [ "", "", "", "", "", "" ],
544
- "patching_rect" : [ 56.666805624961853, 56.64739465713501, 289.0, 22.0 ],
545
- "text" : "route queryid audiofile looplength_ms model periodic"
546
- }
547
-
548
- }
549
- , {
550
- "box" : {
551
- "id" : "obj-5",
552
- "maxclass" : "comment",
553
- "numinlets" : 1,
554
- "numoutlets" : 0,
555
- "patching_rect" : [ 248.091620206832886, 583.206147193908691, 396.183233499526978, 20.0 ],
556
- "text" : "query id --- audiofile ---- model_choice --- periodic --- drop --- seed "
557
- }
558
-
559
- }
560
- , {
561
- "box" : {
562
- "activedialcolor" : [ 0.6, 0.6, 0.6, 1.0 ],
563
- "appearance" : 1,
564
- "fontsize" : 8.0,
565
- "id" : "obj-349",
566
- "maxclass" : "live.dial",
567
- "numinlets" : 1,
568
- "numoutlets" : 2,
569
- "outlettype" : [ "", "float" ],
570
- "parameter_enable" : 1,
571
- "patching_rect" : [ 489.313010931015015, 469.465681314468384, 40.0, 36.0 ],
572
- "presentation" : 1,
573
- "presentation_rect" : [ 107.809941202402115, 8.729166448116302, 30.0, 36.0 ],
574
- "saved_attribute_attributes" : {
575
- "activedialcolor" : {
576
- "expression" : ""
577
- }
578
- ,
579
- "textcolor" : {
580
- "expression" : ""
581
- }
582
- ,
583
- "valueof" : {
584
- "parameter_initial" : [ 0.0 ],
585
- "parameter_initial_enable" : 1,
586
- "parameter_linknames" : 1,
587
- "parameter_longname" : "drop[2]",
588
- "parameter_mmax" : 1.0,
589
- "parameter_modmode" : 0,
590
- "parameter_shortname" : "drop",
591
- "parameter_type" : 0,
592
- "parameter_unitstyle" : 1
593
- }
594
-
595
- }
596
- ,
597
- "textcolor" : [ 0.847058823529412, 0.819607843137255, 0.819607843137255, 1.0 ],
598
- "varname" : "drop"
599
- }
600
-
601
- }
602
- , {
603
- "box" : {
604
- "fontname" : "Andale Mono",
605
- "fontsize" : 8.0,
606
- "id" : "obj-348",
607
- "maxclass" : "comment",
608
- "numinlets" : 1,
609
- "numoutlets" : 0,
610
- "patching_rect" : [ 124.0, 342.465681314468384, 74.0, 15.0 ],
611
- "presentation" : 1,
612
- "presentation_rect" : [ 6.770833075046539, 5.729166448116302, 51.0, 15.0 ],
613
- "text" : "model"
614
- }
615
-
616
- }
617
- , {
618
- "box" : {
619
- "activedialcolor" : [ 0.6, 0.6, 0.6, 1.0 ],
620
- "appearance" : 1,
621
- "fontsize" : 8.0,
622
- "id" : "obj-347",
623
- "maxclass" : "live.dial",
624
- "numinlets" : 1,
625
- "numoutlets" : 2,
626
- "outlettype" : [ "", "float" ],
627
- "parameter_enable" : 1,
628
- "patching_rect" : [ 377.0, 462.465681314468384, 55.0, 36.0 ],
629
- "presentation" : 1,
630
- "presentation_rect" : [ 61.770833075046539, 8.729166448116302, 39.0, 36.0 ],
631
- "saved_attribute_attributes" : {
632
- "activedialcolor" : {
633
- "expression" : ""
634
- }
635
- ,
636
- "textcolor" : {
637
- "expression" : ""
638
- }
639
- ,
640
- "valueof" : {
641
- "parameter_enum" : [ "0", "1", "3", "5", "7", "13", "21", "32", "64" ],
642
- "parameter_initial" : [ 3 ],
643
- "parameter_initial_enable" : 1,
644
- "parameter_linknames" : 1,
645
- "parameter_longname" : "periodic[2]",
646
- "parameter_mmax" : 128.0,
647
- "parameter_modmode" : 0,
648
- "parameter_shortname" : "periodic",
649
- "parameter_type" : 1,
650
- "parameter_unitstyle" : 9
651
- }
652
-
653
- }
654
- ,
655
- "textcolor" : [ 0.847058823529412, 0.819607843137255, 0.819607843137255, 1.0 ],
656
- "varname" : "periodic"
657
- }
658
-
659
- }
660
- , {
661
- "box" : {
662
- "fontsize" : 8.0,
663
- "id" : "obj-346",
664
- "items" : [ "default", ",", "supermetroid", ",", "percussion", ",", "machines", ",", "choir", ",", "n64", ",", "opera", ",", "orchestral", ",", "sample-instrument", ",", "xeno-canto", ",", "march-31", ",", "saxophone", ",", "sax-new", ",", "sax-sep", ",", "lazaro-ros", ",", "lazaro-ros-sep", ",", "cat10" ],
665
- "maxclass" : "umenu",
666
- "numinlets" : 1,
667
- "numoutlets" : 3,
668
- "outlettype" : [ "int", "", "" ],
669
- "parameter_enable" : 0,
670
- "patching_rect" : [ 169.0, 364.465681314468384, 100.0, 17.0 ],
671
- "presentation" : 1,
672
- "presentation_rect" : [ 6.88541653752327, 18.229166448116302, 50.770833075046539, 17.0 ]
673
- }
674
-
675
- }
676
- , {
677
- "box" : {
678
- "id" : "obj-3",
679
- "maxclass" : "newobj",
680
- "numinlets" : 1,
681
- "numoutlets" : 1,
682
- "outlettype" : [ "" ],
683
- "patching_rect" : [ 130.057793855667114, 602.0, 89.0, 22.0 ],
684
- "text" : "prepend to-text"
685
- }
686
-
687
- }
688
- , {
689
- "box" : {
690
- "id" : "obj-1",
691
- "maxclass" : "newobj",
692
- "numinlets" : 1,
693
- "numoutlets" : 1,
694
- "outlettype" : [ "" ],
695
- "patching_rect" : [ 50.0, 602.0, 75.0, 22.0 ],
696
- "text" : "prepend osc"
697
- }
698
-
699
- }
700
- , {
701
- "box" : {
702
- "id" : "obj-367",
703
- "maxclass" : "newobj",
704
- "numinlets" : 1,
705
- "numoutlets" : 2,
706
- "outlettype" : [ "int", "bang" ],
707
- "patching_rect" : [ 56.666805624961853, 137.397974371910095, 29.5, 22.0 ],
708
- "text" : "t i b"
709
- }
710
-
711
- }
712
- , {
713
- "box" : {
714
- "id" : "obj-366",
715
- "maxclass" : "newobj",
716
- "numinlets" : 1,
717
- "numoutlets" : 1,
718
- "outlettype" : [ "" ],
719
- "patching_rect" : [ 599.350643634796143, 252.597400188446045, 70.0, 22.0 ],
720
- "text" : "loadmess 0"
721
- }
722
-
723
- }
724
- , {
725
- "box" : {
726
- "fontsize" : 8.0,
727
- "id" : "obj-365",
728
- "maxclass" : "comment",
729
- "numinlets" : 1,
730
- "numoutlets" : 0,
731
- "patching_rect" : [ 626.62337064743042, 285.714282989501953, 61.0, 15.0 ],
732
- "presentation" : 1,
733
- "presentation_rect" : [ 103.770833075046539, 50.45833146572113, 26.729166924953461, 15.0 ],
734
- "text" : "lock"
735
- }
736
-
737
- }
738
- , {
739
- "box" : {
740
- "id" : "obj-362",
741
- "maxclass" : "toggle",
742
- "numinlets" : 1,
743
- "numoutlets" : 1,
744
- "outlettype" : [ "int" ],
745
- "parameter_enable" : 0,
746
- "patching_rect" : [ 599.350643634796143, 283.116880416870117, 24.0, 24.0 ],
747
- "presentation" : 1,
748
- "presentation_rect" : [ 122.310760617256165, 50.59761106967926, 14.61988240480423, 14.61988240480423 ]
749
- }
750
-
751
- }
752
- , {
753
- "box" : {
754
- "color" : [ 0.3, 0.9, 0.1, 1.0 ],
755
- "id" : "obj-262",
756
- "maxclass" : "newobj",
757
- "numinlets" : 1,
758
- "numoutlets" : 1,
759
- "outlettype" : [ "" ],
760
- "patching_rect" : [ 169.0, 331.465681314468384, 70.0, 22.0 ],
761
- "text" : "loadmess 0"
762
- }
763
-
764
- }
765
- , {
766
- "box" : {
767
- "id" : "obj-43",
768
- "maxclass" : "newobj",
769
- "numinlets" : 1,
770
- "numoutlets" : 2,
771
- "outlettype" : [ "", "" ],
772
- "patching_rect" : [ 208.0, 398.465681314468384, 31.0, 22.0 ],
773
- "text" : "t s s"
774
- }
775
-
776
- }
777
- , {
778
- "box" : {
779
- "id" : "obj-274",
780
- "maxclass" : "newobj",
781
- "numinlets" : 2,
782
- "numoutlets" : 1,
783
- "outlettype" : [ "" ],
784
- "patching_rect" : [ 601.526759147644043, 376.335903882980347, 32.0, 22.0 ],
785
- "text" : "gate"
786
- }
787
-
788
- }
789
- , {
790
- "box" : {
791
- "id" : "obj-273",
792
- "maxclass" : "newobj",
793
- "numinlets" : 2,
794
- "numoutlets" : 1,
795
- "outlettype" : [ "" ],
796
- "patching_rect" : [ 601.526759147644043, 443.511481046676636, 86.0, 22.0 ],
797
- "text" : "random 32768"
798
- }
799
-
800
- }
801
- , {
802
- "box" : {
803
- "id" : "obj-272",
804
- "maxclass" : "button",
805
- "numinlets" : 1,
806
- "numoutlets" : 1,
807
- "outlettype" : [ "bang" ],
808
- "parameter_enable" : 0,
809
- "patching_rect" : [ 601.526759147644043, 413.740486621856689, 24.0, 24.0 ],
810
- "presentation" : 1,
811
- "presentation_rect" : [ 29.0, 50.380436055362225, 15.103658214211464, 15.103658214211464 ]
812
- }
813
-
814
- }
815
- , {
816
- "box" : {
817
- "fontsize" : 7.0,
818
- "id" : "obj-270",
819
- "maxclass" : "number",
820
- "numinlets" : 1,
821
- "numoutlets" : 2,
822
- "outlettype" : [ "", "bang" ],
823
- "parameter_enable" : 0,
824
- "patching_rect" : [ 598.473323822021484, 502.290111064910889, 44.0, 16.0 ],
825
- "presentation" : 1,
826
- "presentation_rect" : [ 47.770833075046539, 49.932265162467957, 51.0, 16.0 ]
827
- }
828
-
829
- }
830
- , {
831
- "box" : {
832
- "color" : [ 0.3, 0.9, 0.1, 1.0 ],
833
- "id" : "obj-200",
834
- "maxclass" : "newobj",
835
- "numinlets" : 1,
836
- "numoutlets" : 1,
837
- "outlettype" : [ "" ],
838
- "patching_rect" : [ 672.51913046836853, 473.282475471496582, 70.0, 22.0 ],
839
- "text" : "loadmess 9"
840
- }
841
-
842
- }
843
- , {
844
- "box" : {
845
- "fontsize" : 8.0,
846
- "id" : "obj-206",
847
- "maxclass" : "comment",
848
- "numinlets" : 1,
849
- "numoutlets" : 0,
850
- "patching_rect" : [ 659.542030334472656, 501.526752233505249, 39.0, 15.0 ],
851
- "presentation" : 1,
852
- "presentation_rect" : [ 6.320590555667877, 50.432265162467957, 32.0, 15.0 ],
853
- "text" : "seed"
854
- }
855
-
856
- }
857
- , {
858
- "box" : {
859
- "color" : [ 0.2, 0.0, 0.8, 1.0 ],
860
- "id" : "obj-258",
861
- "maxclass" : "newobj",
862
- "numinlets" : 0,
863
- "numoutlets" : 1,
864
- "outlettype" : [ "" ],
865
- "patching_rect" : [ 598.473323822021484, 473.282475471496582, 73.0, 22.0 ],
866
- "text" : "r #0-seed"
867
- }
868
-
869
- }
870
- , {
871
- "box" : {
872
- "id" : "obj-313",
873
- "maxclass" : "newobj",
874
- "numinlets" : 1,
875
- "numoutlets" : 1,
876
- "outlettype" : [ "" ],
877
- "patching_rect" : [ 221.0, 431.465681314468384, 75.0, 22.0 ],
878
- "text" : "prepend text"
879
- }
880
-
881
- }
882
- , {
883
- "box" : {
884
- "id" : "obj-168",
885
- "maxclass" : "newobj",
886
- "numinlets" : 18,
887
- "numoutlets" : 1,
888
- "outlettype" : [ "" ],
889
- "patching_rect" : [ 50.0, 545.0, 453.0, 22.0 ],
890
- "text" : "pack 0 vampnet example.wav default 7 0.1 12345 10000. 1 0.15 64 4 0 36 1. 0. 0. 1"
891
- }
892
-
893
- }
894
- , {
895
- "box" : {
896
- "id" : "obj-157",
897
- "maxclass" : "comment",
898
- "numinlets" : 1,
899
- "numoutlets" : 0,
900
- "patching_rect" : [ -8.670519590377808, 101.0, 62.0, 20.0 ],
901
- "text" : "query id"
902
- }
903
-
904
- }
905
- , {
906
- "box" : {
907
- "id" : "obj-133",
908
- "maxclass" : "number",
909
- "numinlets" : 1,
910
- "numoutlets" : 2,
911
- "outlettype" : [ "", "bang" ],
912
- "parameter_enable" : 0,
913
- "patching_rect" : [ 56.666805624961853, 100.0, 50.0, 22.0 ]
914
- }
915
-
916
- }
917
- , {
918
- "box" : {
919
- "comment" : "",
920
- "id" : "obj-378",
921
- "index" : 1,
922
- "maxclass" : "inlet",
923
- "numinlets" : 0,
924
- "numoutlets" : 1,
925
- "outlettype" : [ "" ],
926
- "patching_rect" : [ 56.666805624961853, 5.0, 30.0, 30.0 ]
927
- }
928
-
929
- }
930
- , {
931
- "box" : {
932
- "comment" : "",
933
- "id" : "obj-380",
934
- "index" : 1,
935
- "maxclass" : "outlet",
936
- "numinlets" : 1,
937
- "numoutlets" : 0,
938
- "patching_rect" : [ 50.0, 674.0, 30.0, 30.0 ]
939
- }
940
-
941
- }
942
- ],
943
- "lines" : [ {
944
- "patchline" : {
945
- "destination" : [ "obj-380", 0 ],
946
- "source" : [ "obj-1", 0 ]
947
- }
948
-
949
- }
950
- , {
951
- "patchline" : {
952
- "destination" : [ "obj-349", 0 ],
953
- "source" : [ "obj-10", 0 ]
954
- }
955
-
956
- }
957
- , {
958
- "patchline" : {
959
- "destination" : [ "obj-347", 0 ],
960
- "source" : [ "obj-11", 0 ]
961
- }
962
-
963
- }
964
- , {
965
- "patchline" : {
966
- "destination" : [ "obj-168", 16 ],
967
- "source" : [ "obj-12", 0 ]
968
- }
969
-
970
- }
971
- , {
972
- "patchline" : {
973
- "destination" : [ "obj-168", 17 ],
974
- "source" : [ "obj-13", 0 ]
975
- }
976
-
977
- }
978
- , {
979
- "patchline" : {
980
- "destination" : [ "obj-367", 0 ],
981
- "source" : [ "obj-133", 0 ]
982
- }
983
-
984
- }
985
- , {
986
- "patchline" : {
987
- "destination" : [ "obj-168", 9 ],
988
- "source" : [ "obj-15", 0 ]
989
- }
990
-
991
- }
992
- , {
993
- "patchline" : {
994
- "destination" : [ "obj-1", 0 ],
995
- "source" : [ "obj-168", 0 ]
996
- }
997
-
998
- }
999
- , {
1000
- "patchline" : {
1001
- "destination" : [ "obj-168", 10 ],
1002
- "source" : [ "obj-19", 0 ]
1003
- }
1004
-
1005
- }
1006
- , {
1007
- "patchline" : {
1008
- "destination" : [ "obj-274", 0 ],
1009
- "source" : [ "obj-2", 0 ]
1010
- }
1011
-
1012
- }
1013
- , {
1014
- "patchline" : {
1015
- "destination" : [ "obj-168", 11 ],
1016
- "source" : [ "obj-20", 0 ]
1017
- }
1018
-
1019
- }
1020
- , {
1021
- "patchline" : {
1022
- "destination" : [ "obj-270", 0 ],
1023
- "source" : [ "obj-200", 0 ]
1024
- }
1025
-
1026
- }
1027
- , {
1028
- "patchline" : {
1029
- "destination" : [ "obj-12", 0 ],
1030
- "order" : 1,
1031
- "source" : [ "obj-22", 0 ]
1032
- }
1033
-
1034
- }
1035
- , {
1036
- "patchline" : {
1037
- "destination" : [ "obj-13", 0 ],
1038
- "order" : 0,
1039
- "source" : [ "obj-22", 0 ]
1040
- }
1041
-
1042
- }
1043
- , {
1044
- "patchline" : {
1045
- "destination" : [ "obj-15", 0 ],
1046
- "order" : 8,
1047
- "source" : [ "obj-22", 0 ]
1048
- }
1049
-
1050
- }
1051
- , {
1052
- "patchline" : {
1053
- "destination" : [ "obj-19", 0 ],
1054
- "order" : 7,
1055
- "source" : [ "obj-22", 0 ]
1056
- }
1057
-
1058
- }
1059
- , {
1060
- "patchline" : {
1061
- "destination" : [ "obj-20", 0 ],
1062
- "order" : 6,
1063
- "source" : [ "obj-22", 0 ]
1064
- }
1065
-
1066
- }
1067
- , {
1068
- "patchline" : {
1069
- "destination" : [ "obj-23", 0 ],
1070
- "order" : 5,
1071
- "source" : [ "obj-22", 0 ]
1072
- }
1073
-
1074
- }
1075
- , {
1076
- "patchline" : {
1077
- "destination" : [ "obj-26", 0 ],
1078
- "order" : 4,
1079
- "source" : [ "obj-22", 0 ]
1080
- }
1081
-
1082
- }
1083
- , {
1084
- "patchline" : {
1085
- "destination" : [ "obj-28", 0 ],
1086
- "order" : 3,
1087
- "source" : [ "obj-22", 0 ]
1088
- }
1089
-
1090
- }
1091
- , {
1092
- "patchline" : {
1093
- "destination" : [ "obj-30", 0 ],
1094
- "order" : 2,
1095
- "source" : [ "obj-22", 0 ]
1096
- }
1097
-
1098
- }
1099
- , {
1100
- "patchline" : {
1101
- "destination" : [ "obj-8", 0 ],
1102
- "order" : 9,
1103
- "source" : [ "obj-22", 0 ]
1104
- }
1105
-
1106
- }
1107
- , {
1108
- "patchline" : {
1109
- "destination" : [ "obj-168", 12 ],
1110
- "source" : [ "obj-23", 0 ]
1111
- }
1112
-
1113
- }
1114
- , {
1115
- "patchline" : {
1116
- "destination" : [ "obj-270", 0 ],
1117
- "source" : [ "obj-258", 0 ]
1118
- }
1119
-
1120
- }
1121
- , {
1122
- "patchline" : {
1123
- "destination" : [ "obj-168", 13 ],
1124
- "source" : [ "obj-26", 0 ]
1125
- }
1126
-
1127
- }
1128
- , {
1129
- "patchline" : {
1130
- "destination" : [ "obj-346", 0 ],
1131
- "source" : [ "obj-262", 0 ]
1132
- }
1133
-
1134
- }
1135
- , {
1136
- "patchline" : {
1137
- "destination" : [ "obj-168", 6 ],
1138
- "source" : [ "obj-270", 0 ]
1139
- }
1140
-
1141
- }
1142
- , {
1143
- "patchline" : {
1144
- "destination" : [ "obj-273", 0 ],
1145
- "source" : [ "obj-272", 0 ]
1146
- }
1147
-
1148
- }
1149
- , {
1150
- "patchline" : {
1151
- "destination" : [ "obj-270", 0 ],
1152
- "source" : [ "obj-273", 0 ]
1153
- }
1154
-
1155
- }
1156
- , {
1157
- "patchline" : {
1158
- "destination" : [ "obj-272", 0 ],
1159
- "source" : [ "obj-274", 0 ]
1160
- }
1161
-
1162
- }
1163
- , {
1164
- "patchline" : {
1165
- "destination" : [ "obj-168", 14 ],
1166
- "source" : [ "obj-28", 0 ]
1167
- }
1168
-
1169
- }
1170
- , {
1171
- "patchline" : {
1172
- "destination" : [ "obj-380", 0 ],
1173
- "source" : [ "obj-3", 0 ]
1174
- }
1175
-
1176
- }
1177
- , {
1178
- "patchline" : {
1179
- "destination" : [ "obj-168", 15 ],
1180
- "source" : [ "obj-30", 0 ]
1181
- }
1182
-
1183
- }
1184
- , {
1185
- "patchline" : {
1186
- "destination" : [ "obj-3", 0 ],
1187
- "source" : [ "obj-313", 0 ]
1188
- }
1189
-
1190
- }
1191
- , {
1192
- "patchline" : {
1193
- "destination" : [ "obj-43", 0 ],
1194
- "source" : [ "obj-346", 1 ]
1195
- }
1196
-
1197
- }
1198
- , {
1199
- "patchline" : {
1200
- "destination" : [ "obj-168", 4 ],
1201
- "source" : [ "obj-347", 0 ]
1202
- }
1203
-
1204
- }
1205
- , {
1206
- "patchline" : {
1207
- "destination" : [ "obj-168", 5 ],
1208
- "source" : [ "obj-349", 0 ]
1209
- }
1210
-
1211
- }
1212
- , {
1213
- "patchline" : {
1214
- "destination" : [ "obj-2", 0 ],
1215
- "source" : [ "obj-362", 0 ]
1216
- }
1217
-
1218
- }
1219
- , {
1220
- "patchline" : {
1221
- "destination" : [ "obj-362", 0 ],
1222
- "source" : [ "obj-366", 0 ]
1223
- }
1224
-
1225
- }
1226
- , {
1227
- "patchline" : {
1228
- "destination" : [ "obj-168", 0 ],
1229
- "source" : [ "obj-367", 0 ]
1230
- }
1231
-
1232
- }
1233
- , {
1234
- "patchline" : {
1235
- "destination" : [ "obj-274", 1 ],
1236
- "source" : [ "obj-367", 1 ]
1237
- }
1238
-
1239
- }
1240
- , {
1241
- "patchline" : {
1242
- "destination" : [ "obj-6", 0 ],
1243
- "source" : [ "obj-378", 0 ]
1244
- }
1245
-
1246
- }
1247
- , {
1248
- "patchline" : {
1249
- "destination" : [ "obj-168", 3 ],
1250
- "source" : [ "obj-43", 0 ]
1251
- }
1252
-
1253
- }
1254
- , {
1255
- "patchline" : {
1256
- "destination" : [ "obj-313", 0 ],
1257
- "source" : [ "obj-43", 1 ]
1258
- }
1259
-
1260
- }
1261
- , {
1262
- "patchline" : {
1263
- "destination" : [ "obj-133", 0 ],
1264
- "source" : [ "obj-6", 0 ]
1265
- }
1266
-
1267
- }
1268
- , {
1269
- "patchline" : {
1270
- "destination" : [ "obj-168", 7 ],
1271
- "source" : [ "obj-6", 2 ]
1272
- }
1273
-
1274
- }
1275
- , {
1276
- "patchline" : {
1277
- "destination" : [ "obj-168", 2 ],
1278
- "source" : [ "obj-6", 1 ]
1279
- }
1280
-
1281
- }
1282
- , {
1283
- "patchline" : {
1284
- "destination" : [ "obj-346", 0 ],
1285
- "source" : [ "obj-6", 3 ]
1286
- }
1287
-
1288
- }
1289
- , {
1290
- "patchline" : {
1291
- "destination" : [ "obj-347", 0 ],
1292
- "source" : [ "obj-6", 4 ]
1293
- }
1294
-
1295
- }
1296
- , {
1297
- "patchline" : {
1298
- "destination" : [ "obj-7", 0 ],
1299
- "source" : [ "obj-6", 5 ]
1300
- }
1301
-
1302
- }
1303
- , {
1304
- "patchline" : {
1305
- "destination" : [ "obj-168", 8 ],
1306
- "source" : [ "obj-8", 0 ]
1307
- }
1308
-
1309
- }
1310
- ],
1311
- "originid" : "pat-136"
1312
- }
1313
-
1314
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unloop/requirements.txt DELETED
@@ -1,5 +0,0 @@
1
- python-osc
2
- descript-audiotools
3
- tqdm
4
- argbind
5
- gradio-client
 
 
 
 
 
 
update-repos.sh DELETED
@@ -1,11 +0,0 @@
1
- #
2
- repos=( "vampnet-music" "vampnet-percussion" "vampnet-n64" "vampnet-birds" "vampnet-choir" "vampnet-machines" "nesquik" "vampnet-opera")
3
- for repo in "${repos[@]}"
4
- do
5
- echo "Updating $repo"
6
- git remote add --fetch $repo https://huggingface.co/spaces/hugggof/$repo
7
- git push --force $repo main
8
- done
9
-
10
- # https://huggingface.co/spaces/hugggof/vampnet-music
11
- # git push --space-percussion main