# create temporal modulations (form) form Enter settings for modulation detection optionmenu carrier: 1 option white_noise option tone_2000 natural modulation_rate 10 real modulation_depth 0.75 endform dur = 1 # make modulator signals Create Sound as pure tone: "mod_'modulation_rate'", 1, 0, dur, 44100, modulation_rate, 0.5, 0.01, 0.01 Scale peak... 0.5 Formula... self[col] + 0.5 # make carrier if carrier == 1 Create Sound from formula: "Noise", 1, 0, dur, 44100, "randomGauss(0,0.1)" call make_AM Noise mod_'modulation_rate' modulation_depth select Sound Noise plus Sound mod_'modulation_rate' Remove else Create Sound as pure tone: "Tone2000", 1, 0, 1, 44100, 2000, 0.5, 0.01, 0.01 call make_AM Tone2000 mod_'modulation_rate' modulation_depth select Sound Tone2000 plus Sound mod_'modulation_rate' Remove endif procedure make_AM .carrier$ .modulator$ .depth # modify modulator select Sound '.modulator$' Copy... temp_mod floor = 1 - '.depth' Formula... self[col] * '.depth' Formula... self[col] + floor depth_label = '.depth' * 100 depth_label$ = "'depth_label'" select Sound '.carrier$' Copy... '.carrier$'_'.modulator$'_'depth_label$'_mod Formula... self[col] * ((Sound_temp_mod[col]*'.depth') + (1 - '.depth')) select Sound temp_mod Remove endproc