Soundライブラリ

Processing3からの標準(公式謹製?)Soundライブラリについての忘備録。
公式ドキュメント(英語)

概要

イコライザー的なものを作りたい場合SoundFileオブジェクトでmp3データなどを読み込んで、それとは別にWaveformオブジェクトを用意して、そこにSoundFileオブジェクトを渡して使用するという感じ。

SoundFile

コンストラクタSoundFile(parent, path)
SoundFile(parent, path, cache)
parent:thisとする
path:ファイル名
cache:キャッシュ(default: true)
再生play()
再生(ループ)loop()
停止stop()
再生位置は先頭に戻る。
一時停止pause()
再生位置はそのまま

Amplitude, BeatDetector, FFT, Waveform

コンストラクタAmplitude(parent)
BeatDetector(parent)
FFT(parent, bands)
Waveform(parent, samples)
parent:thisとする
bands:
samples:サンプリング数(100程度がGood)
入力ソース登録input(input)
input:SoundObject
解析開始.analyze()
.analyze(value)
解析結果.data[]
一時停止.stop();
size(600, 100)
background(197, 234, 222)

コメントする