More Related Content
Featured (20)
2024 Trend Updates: What Really Works In SEO & Content Marketing Storytelling For The Web: Integrate Storytelling in your Design Process Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis... How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR... 2024 State of Marketing Report – by Hubspot Everything You Need To Know About ChatGPT Product Design Trends in 2024 | Teenage Engineerings How Race, Age and Gender Shape Attitudes Towards Mental Health AI Trends in Creative Operations 2024 by Artwork Flow.pdf PEPSICO Presentation to CAGNY Conference Feb 2024 Content Methodology: A Best Practices Report (Webinar) How to Prepare For a Successful Job Search for 2024 Social Media Marketing Trends 2024 // The Global Indie Insights Trends In Paid Search: Navigating The Digital Landscape In 2024 5 Public speaking tips from TED - Visualized summary ChatGPT and the Future of Work - Clark Boyd Getting into the tech field. what next Google's Just Not That Into You: Understanding Core Updates & Search Intent How to have difficult conversations テーマ「perl meets beats」
- 17. 例)ラの音 (440Hz) を出す
サンプリング周波数 : 44,100Hz
量子化ビット数 : 8(-128〜+127)
音の長さ : 1 秒
モノラル
44,100 / 440
1 周期
データの長さ = サンプリング周波数 × 音の長さ
- 18. perl meets beats!
こんな感じで宣言して、
beats を WAV ファイルに書き出したい!
my $bpm = 138;
my $beats = {
kick => [ 1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 ],
snare => [ 0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0 ],
hat => [ 0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0 ]
};
- 20. perl meets beats!
単発の波形を作る
my $wav_kick = create_oneshot( 50, 0.1, $osc_saw );
my $wav_snare = create_oneshot( 1000, 0.05, $osc_noise );
my $wav_hat = create_oneshot( 5000, 0.05, $osc_noise );
キック、スネア、ハイハットを用意しました。
- 21. perl meets beats!
ビートを刻む
my $ch_kick = to_wav( $beats->{kick}, $wav_kick );
my $ch_snare = to_wav( $beats->{snare}, $wav_snare );
my $ch_hat = to_wav( $beats->{hat}, $wav_hat );
あとは、一緒に鳴らすだけ!