5.1.2. 将麦克风和摄像头作为传感器
将麦克风作为传感器
麦克风通常是作为音频的输入设备使用的,比如声音的直播、录音等,但在交互艺术领域中也可以将其作为传感器来使用。媒体艺术家往往倾向于发现那些设备的发明、生产、销售目的以外的“剩余价值”。这里介绍通过对输入音频的分析,提取出特定的属性信息的方法。
分析“声音大小”
比较常用的方法是提取输入音频的“声音大小”,即音频的振幅。要捕捉“声音的大小”或音量的变化可以使用峰值电平(Peak Level),峰值电平是指将一段时间内音频振幅的最大值以绝对值的形式来表现。峰值电平的数值化可以使用[peakamp]和[meter]这两个MSP构件。两者都是将峰值电平输出为实数讯息的,也都可以设置侦测的间隔时间。将输出的数值限定在0~1之间方便将其转换为其它信号,如MIDI讯息、DMX512灯光讯息等。
人的听觉上的“声音大小”(俗称音量),由“振幅”(amplitude)和人离声源的距离决定,振幅越大响度越大,人和声源的距离越小,响度越大。(单位:分贝dB)
使用这个功能时首先确认电脑的声卡上正确连接了麦克风,笔记本电脑通常内置了麦克风。如果打开[ezadc]后没有音频输入进来,可以进入Max的菜单Options/Audio Status选择正确的输入设备。
<pre><code>
----------begin_max5_patcher----------
1272.3oc0XkzaaaDF8rzuBh4XAivrvgK8VaCPuzC8ZgQQ.E0XkwkKBbwwNAw
n.o4RQNzhlffZCDfTfBzSoAHtEnns4ei7x+hNKjxxNRVjzZw0Gn47wQy78d7
a4w4Qc6.5mrGKCX7wFaYzoyi51oixjzPmxwc.Q96ED5molFHHIJhEmCL0OKm
sWtxN6g9CBNXZy6Tjky2lG3myShkyAU9vsShyy3Ojorg6AKM2une+P1zSLtH
hGGxxyl1ndZY7ApohKsNxOO3973g2KkEjqwCBIVZCpcOpogsk7dKgEiu9hEO
oHuZ0qbB9.EZR5uycrrAS4vw9QpMDL98u4r+82O+nmd9e+iUSHKeesmC.RCO
taW4EyaHkd9O+Cieygm7h2N9a+myd1SFezwqA5cFDoGrmsqKlfMMHpEzvyUd
Ea2H5zZSSmu73yO74m7x+TbCEBix1LrIg51iJnSpioA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a+hv7KSu9AABwAW5LoHHGa4Ib.6YSqNTJOoIT4gR
oAuY4asTwuepN3ZyQhMhWwTS+V9JN3WwBCSdv06hSKWaK0Y6P8fP2IuXlADb
EezlBANtHWj7FwugZQWp.nHpOK8ySBGzXFVRlP0o9Q8vHpxSQPjm8RkgG4Gy
BgvJmqdqiXueb2+i6o+0g
-----------end_max5_patcher-----------
</code></pre>
分析声音的高低
声音的高低(音调)是由频率(frequency)决定的,频率越高音调越高,频率的单位是赫兹(Hz)。人耳的听觉范围为20~20000Hz。[fzero]可以用于估算收到的单音音频信号的基本频率。[fzero]有三个输出口,第一个输出基本的频率,第二个输出当前的振幅峰值(peak amplitude),第三个输出口当侦测到新的音符时会输出bang讯号。它适合用于追踪单音信号,如果同一时间出现多个音调,分析结果会变得不准确,当追踪乐器的复音 (polyphone)时要小心不要让音符重叠。
<pre><code>
----------begin_max5_patcher----------
1110.3ocyX0zhaaDF9r8uBwbr3HlYz28VaCzdnG50xRInOFuYVzGFoQI6tgr
WZWJTBEBkdoARf.smJMEZuTJM+a1r69unyGRxxajVa4XzZePVZ7HMOOOuuyy
6q7SlNADjcLo.n8wZGnMYxSlNYhbHw.SptdBHw+3vX+B4z.gYIIjTFXl52Xj
iYxwu9U+0k+9u0d3iJKXz4zPeFMKULGT0ONOKkUPOkHGCqCqFNnLHHlzdhok
IzzXBqn8fpoUPijSs9lW3yBeHM8vGjSBYJ9fgN5dHjiowLMCaG95nY4INZhz
gZeyx0HqjUuH0ONZjjTYAGcOKKPKbm5mHWWvEu8Ot5+dy0u37q+2mWOgB1IJ
B..hAd5zohCy9.U128r2bw+b99jxhvV5XnkqCdox5tEJq4HorAkLFWntMt2U
9Cmkl04OlPA+vl0G6gknNXoQ8BqlG6jED0B.B7SODz7j9v3373LNTFJGWIRp
3nKRxQbubD2AGQfl0HmGGYj7GPR8qR5fMQ47De4Ba2mh.lsOnJbQA1nGNdag
d.2S0ihEbRlmUDlsfbVmxBteYwvsY+.FoTEns3Ka6grgvz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