<jupyter_start><jupyter_text>harmor_fixed1oscillatorpitch is fixed<jupyter_code>n_oscs = 1
harmor = Harmor(name='harmor', n_oscs=1)
enva = ADSREnvelope(name='enva', max_value=1.0, channels=1)
envc = ADSREnvelope(name='envc', channels=1)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'DUMMY', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF, 'BFRQ': torch.ones(1)*440}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'M_OSC', 'Q_FILT', 'NOISE_C', 'NOISE_A', 'DUMMY']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_cutoff', 'harmor_q']

audio_dir, param_dir = make_dirs('harmor_fixed')
render_dataset(synth, save_params, audio_dir, param_dir)<jupyter_output>100%|██████████| 20000/20000 [05:43<00:00, 58.30it/s]skipped 4974 quiet sounds<jupyter_text>harmor_1oscfreeSetting:- Oscillators    - n_oscs: 1    - Amplitude Envelope    - Free frequency- Filter    - Cutoff Envelope    - Fixed Q<jupyter_code>n_oscs = 1
harmor = Harmor(name='harmor', n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=1.0, channels=n_oscs)
envc = ADSREnvelope(name='envc', channels=1)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'DUMMY', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'M_OSC', 'Q_FILT', 'NOISE_C', 'NOISE_A']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_cutoff', 'harmor_q']

audio_dir, param_dir = make_dirs('harmor_1oscfree')
render_dataset(synth, save_params, audio_dir, param_dir)<jupyter_output>100%|██████████| 20000/20000 [12:13<00:00, 27.26it/s]skipped 5736 quiet sounds<jupyter_text>Check files<jupyter_code>audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[0], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
param = torch.load(param_files[0])
param.keys()<jupyter_output>20000 20000<jupyter_text>harmor_2oscfreeSetting:- Oscillators    - n_oscs: 2    - Separate Amplitude Envelope    - Separate frequency        - frequency is static- Filter    - Cutoff Envelope    - Fixed Q<jupyter_code>n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_cutoff', 'harmor_q']

audio_dir, param_dir = make_dirs('harmor_2oscfree')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[0], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')<jupyter_output>20000 20000<jupyter_text>FM2_free- Parameters:    - Carrier/Modulator Amplitudes    - Carrier/Modulator Frequencies (static)<jupyter_code>envm = ADSREnvelope(name='envm')
envc = ADSREnvelope(name='envc')
fmosc = FM2(n_samples=64000, name='fm2')
dag = [
    (envm, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_M', 'attack': 'AT_M', 'decay': 'DE_M', 'sus_level': 'SU_M', 'release': 'RE_M', 'note_off': 'NO', 'noise_mag': 'NOISE_M'}),
    (envc, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (fmosc, {'mod_amp': 'envm', 'car_amp': 'envc', 'mod_freq': 'FRQ_M', 'car_freq': 'FRQ_C'})
]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['FRQ_M', 'FRQ_C', 'NOISE_M', 'NOISE_C']).to('cuda')
save_params = ['fm2_mod_amp', 'fm2_car_amp', 'fm2_mod_freq', 'fm2_car_freq']

audio_dir, param_dir = make_dirs('fm2_free')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[0], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
param = torch.load(param_files[0])
param.keys()<jupyter_output>20000 20000<jupyter_text>FM2x2-freeFM2 added together<jupyter_code>fm2_1 = FM2(n_samples=N_SAMPLES, name='fm2_1')
fm2_2 = FM2(n_samples=N_SAMPLES, name='fm2_2')
env1 = ADSREnvelope(name='env1')
env2 = ADSREnvelope(name='env2')
env3 = ADSREnvelope(name='env3')
env4 = ADSREnvelope(name='env4')
mix = Mix(name='add')
dag = [
    (env1, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_1', 'attack': 'AT_1', 'decay': 'DE_1', 'sus_level': 'SU_1', 'release': 'RE_1', 'note_off': 'NO', 'noise_mag': 'NOISE_1'}),
    (env2, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_2', 'attack': 'AT_2', 'decay': 'DE_2', 'sus_level': 'SU_2', 'release': 'RE_2', 'note_off': 'NO', 'noise_mag': 'NOISE_2'}),
    (env3, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_3', 'attack': 'AT_3', 'decay': 'DE_3', 'sus_level': 'SU_3', 'release': 'RE_3', 'note_off': 'NO', 'noise_mag': 'NOISE_3'}),
    (env4, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_4', 'attack': 'AT_4', 'decay': 'DE_4', 'sus_level': 'SU_4', 'release': 'RE_4', 'note_off': 'NO', 'noise_mag': 'NOISE_4'}),
    (fm2_1, {'mod_amp': 'env1', 'car_amp': 'env2', 'mod_freq': 'FRQ_1', 'car_freq': 'FRQ_2'}),
    (fm2_2, {'mod_amp': 'env3', 'car_amp': 'env4', 'mod_freq': 'FRQ_3', 'car_freq': 'FRQ_4'}),
    (mix, {'signal_a': 'fm2_1', 'signal_b': 'fm2_2', 'mix_a': 'MIX_A', 'mix_b': 'MIX_B'})
]
# avoid clipping
fixed_params = {'MIX_A': torch.ones(1)*0.5, 'MIX_B': torch.ones(1)*0.5, 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['FRQ_1', 'FRQ_2', 'FRQ_3', 'FRQ_4', 'NOISE_1', 'NOISE_2', 'NOISE_3', 'NOISE_4', 'MIX_A', 'MIX_B']).to('cuda')
save_params = ['fm2_1_mod_amp', 'fm2_1_car_amp', 'fm2_2_mod_amp', 'fm2_2_car_amp', 'fm2_1_mod_freq', 'fm2_1_car_freq', 'fm2_2_mod_freq', 'fm2_2_car_freq']
audio_dir, param_dir = make_dirs('fm2x2_free')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[0], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
param = torch.load(param_files[0])
param.keys()<jupyter_output>20000 20000<jupyter_text>FM2 half- Carrier Frequency is fixed<jupyter_code>envm = ADSREnvelope(name='envm')
envc = ADSREnvelope(name='envc')
fmosc = FM2(n_samples=64000, name='fm2')
dag = [
    (envm, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_M', 'attack': 'AT_M', 'decay': 'DE_M', 'sus_level': 'SU_M', 'release': 'RE_M', 'note_off': 'NO', 'noise_mag': 'NOISE_M'}),
    (envc, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (fmosc, {'mod_amp': 'envm', 'car_amp': 'envc', 'mod_freq': 'FRQ_M', 'car_freq': 'FRQ_C'})
]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF, 'FRQ_C': torch.ones(1)*440}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['FRQ_M', 'FRQ_C', 'NOISE_M', 'NOISE_C']).to('cuda')
save_params = ['fm2_mod_amp', 'fm2_car_amp', 'fm2_mod_freq']

audio_dir, param_dir = make_dirs('fm2_half')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[5], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
param = torch.load(param_files[5])
print(param.keys(), param['fm2_mod_freq'])<jupyter_output>20000 20000
dict_keys(['fm2_mod_amp', 'fm2_car_amp', 'fm2_mod_freq']) tensor([[0.8136]])<jupyter_text>Harmor_cfHarmor_2oscfree with modulated delaypredict phase every frame<jupyter_code>n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
cf = ChorusFlanger(name='cf', sr=SAMPLERATE)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    (cf, {'audio': 'harmor', 'delay_ms': 'CF_DELAY', 'rate': 'CF_RATE', 'depth': 'CF_DEPTH', 'mix': 'CF_MIX'})
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C', 'CF_DELAY', 'CF_RATE', 'CF_DEPTH', 'CF_MIX']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_cutoff', 'harmor_q', 'cf_delay_ms', 'cf_rate', 'cf_depth', 'cf_mix']

audio_dir, param_dir = make_dirs('harmor_cf_2')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[12], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
md_lfo = LFO(name='md_lfo', n_secs=N_SAMPLES/SAMPLERATE, rate_range=(0.1, 10.0))
md = ModulatedDelay(name='md', sr=SAMPLERATE)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    (md_lfo, {'rate': 'LFO_RATE', 'level': 'LFO_LEVEL'}),
    (md, {'audio': 'harmor', 'delay_ms': 'MD_DELAY', 'phase': 'md_lfo', 'depth': 'MD_DEPTH', 'mix': 'MD_MIX'})
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF, 'LFO_LEVEL': torch.ones(1)}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C', 'LFO_RATE', 'LFO_LEVEL', 'MD_DELAY', 'MD_DEPTH', 'MD_MIX']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_cutoff', 'harmor_q', 'md_delay_ms', 'md_phase', 'md_depth', 'md_mix']
audio_dir, param_dir = make_dirs('harmor_cf_3')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[2], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')<jupyter_output>20000 20000<jupyter_text>Harmor_cffixed- Harmor_2osc with flanger/chorus- rate=1Hz depth=0.1- only mix (0~0.5) and delay_ms (1~40.0 ms) is changed<jupyter_code>n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
cf = ChorusFlanger(name='cf', sr=SAMPLERATE, delay_range=(1.0, 40.0))
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    (cf, {'audio': 'harmor', 'delay_ms': 'CF_DELAY', 'rate': 'CF_RATE', 'depth': 'CF_DEPTH', 'mix': 'CF_MIX'})
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF, 'CF_RATE': torch.ones(1), 'CF_DEPTH': torch.ones(1)*0.1}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C', 'CF_DELAY', 'CF_MIX']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_cutoff', 'harmor_q', 'cf_delay_ms', 'cf_mix']
audio_dir, param_dir = make_dirs('harmor_cffixed')
# render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[11], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')
param = torch.load(param_files[0])
param.keys()<jupyter_output><empty_output><jupyter_text>Harmor_rev- Harmor_2osc with reverb    - decay    - gain<jupyter_code>n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
reverb = DecayReverb(name='reverb', ir_length=16000)
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    (reverb, {'audio': 'harmor', 'gain': 'RE_GAIN', 'decay': 'RE_DECAY'})
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C', 'RE_GAIN', 'RE_DECAY']).to('cuda')
save_params = ['harmor_amplitudes', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_cutoff', 'harmor_q', 'reverb_gain', 'reverb_decay']
audio_dir, param_dir = make_dirs('harmor_rev')
render_dataset(synth, save_params, audio_dir, param_dir)
audio_files = glob.glob(audio_dir+'/*.wav')
param_files = glob.glob(param_dir+'/*.pt')
print(len(audio_files), len(param_files))
audio, sr = librosa.load(audio_files[40], sr=16000)
mel = librosa.feature.melspectrogram(y=audio, sr=16000, power=2.0)
mel_db = librosa.power_to_db(mel, np.max)
librosa.display.specshow(mel_db, sr=16000, y_axis='mel')<jupyter_output>20000 20000<jupyter_text>Use Envelope<jupyter_code>n_oscs = 2
harmor = Harmor(n_samples=N_SAMPLES, name='harmor', sep_amp=True, n_oscs=n_oscs)
enva = ADSREnvelope(name='enva', max_value=0.6, channels=2)
envc = ADSREnvelope(name='envc', channels=1)
cf = ChorusFlanger(name='cf', sr=SAMPLERATE, delay_range=(1.0, 40.0))
dag = [
    (enva, {'floor': 'AMP_FLOOR', 'peak': 'PEAK_A', 'attack': 'AT_A', 'decay': 'DE_A', 'sus_level': 'SU_A', 'release': 'RE_A', 'note_off': 'NO', 'noise_mag': 'NOISE_A'}),
    (envc, {'floor': 'CUT_FLOOR', 'peak': 'PEAK_C', 'attack': 'AT_C', 'decay': 'DE_C', 'sus_level': 'SU_C', 'release': 'RE_C', 'note_off': 'NO', 'noise_mag': 'NOISE_C'}),
    (harmor, {'amplitudes': 'enva', 'osc_mix': 'M_OSC', 'f0_hz': 'BFRQ', 'f0_mult': 'MULT', 'cutoff': 'envc', 'q': 'Q_FILT'}),
    (cf, {'audio': 'harmor', 'delay_ms': 'CF_DELAY', 'rate': 'CF_RATE', 'depth': 'CF_DEPTH', 'mix': 'CF_MIX'})
    ]
fixed_params = {'AMP_FLOOR':torch.zeros(1), 'NO': torch.ones(1)*NOTE_OFF, 'CF_RATE': torch.ones(1), 'CF_DEPTH': torch.ones(1)*0.1, 'NOISE_A':torch.zeros(1), 'NOISE_C':torch.zeros(1)}
synth = Synthesizer(dag, fixed_params=fixed_params, static_params=['BFRQ', 'MULT', 'M_OSC', 'Q_FILT', 'NOISE_A', 'NOISE_C', 'CF_DELAY', 'CF_MIX']).to('cuda')
save_params = ['enva_peak', 'enva_attack', 'enva_decay', 'enva_sus_level', 'enva_release', 'envc_peak', 'envc_attack', 'envc_decay', 'envc_sus_level', 'envc_release', 'harmor_osc_mix', 'harmor_f0_hz', 'harmor_f0_mult', 'harmor_q', 'cf_delay_ms', 'cf_mix']
audio_dir, param_dir = make_dirs('harmor_cffenv')
render_dataset(synth, save_params, audio_dir, param_dir)<jupyter_output>100%|██████████| 20000/20000 [05:15<00:00, 63.30it/s]skipped 6982 quiet sounds
{'fraction_non_alphanumeric': 0.22053669508814144, 'fraction_numerical': 0.03185646283412669, 'mean_word_length': 8.047799337434927, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '118356', 'license': 'MIT', 'n_tokens_mistral': 9051, 'n_tokens_neox': 8583, 'n_words': 1419, 'path': 'final_dataset.ipynb', 'repo_name': 'hyakuchiki/diffsynth', 'size': '19117'}