ノイズをモジュレーションしてみる
あー、ちょっと遅れちゃった。
なので、今日は2つ書く予定です。
use v5.14; use strict; use warnings; use Cassis; use constant SAMPLING_RATE => 44100; { my $eg = Cassis::EG->new( fs => SAMPLING_RATE, # sampling-rate adsr => [ 0.01, # Attack : time(sec) 0.0, # Decay : time(sec) 1.0, # Sustain: gain 3.0 # Release: time(sec) ], curve => 0.05 # default: 1.0 / exp(1.0) ); my $eg_out = $eg->one_shot( gatetime => 0.01 ); my $noise = Cassis::Noise->new( speed => 0.5 ); my $wav = $noise->exec( num => scalar(@{$eg_out}), mod_speed => { src => $eg_out, depth => 1.0 } ); Cassis::File::write( file => 'jet_sound1.wav', fs => SAMPLING_RATE, channels => [ $wav ] ); } { my $eg = Cassis::EG->new( fs => SAMPLING_RATE, # sampling-rate adsr => [ 3.0, # Attack : time(sec) 0.0, # Decay : time(sec) 1.0, # Sustain: gain 0.0 # Release: time(sec) ], curve => 3.0 # default: 1.0 / exp(1.0) ); my $eg_out = $eg->one_shot( gatetime => 3.0 ); my $noise = Cassis::Noise->new( speed => 0.7 ); my $wav = $noise->exec( num => scalar(@{$eg_out}), mod_speed => { src => $eg_out, depth => 0.98 } ); Cassis::File::write( file => 'jet_sound2.wav', fs => SAMPLING_RATE, channels => [ $wav ] ); }
mod_pitch
をエンベロープで変化させると、
こんな感じでジェットサウンドを作る事ができます。
少しだけ、ゲームの効果音っぽいですね!
おしまい。
Leave a Comment