跳至主要内容
版本:3.5.x

振动发生器

:::警告 实验性功能 这是一组正在不断演进的实验性功能。

请随时根据您的使用情况进行试验和提供反馈,以便我们改进应用程序接口并提供更多价值。

用法和签名可能会发生变化。 :::

此功能支持在 Inverse3 设备上实现可编程振动输出,最多可使用两个独立振荡器。其工作原理类似于基础合成器信号发生器,每个振荡器均可生成波形,且振幅与频率均可配置。


振荡器基础知识

  • 每个 Inverse3 设备最多支持 2 个振荡器 (oscillator: 0oscillator: 1).
  • 您可以单独批量控制振荡器。
  • 一旦设定,振荡器将一直运行,直到明确更改或停止("设定并遗忘 "行为)。
  • 您可以通过简单的 amplitude 控制,设置为 0 停止。

支持的波形

形状名称说明
sine_wave平滑的周期波形
square_wave二进制高/低信号
triangle_wave角状锯齿波
saw_wave上升斜坡信号

参数

参数类型制约因素说明
oscillatornumber0 或 1要设置的振荡器索引
shapestring参见上文的支撑形状要生成的波形类型
amplitudenumber必须是 > 0 & < 10振动强度
frequencynumber必须是 > 5 (赫兹) & < 20k (Hz)振荡器频率

所有字段均为必填字段

命令

set_oscillator

为设备分配一个振荡器

{
"inverse3": [
{
"device_id": "04BA",
"commands": {
"set_oscillator": {
"oscillator": 0,
"shape": "sine_wave",
"amplitude": 0,
"frequency": 3000
}
}
}
]
}

set_oscillators

一次分配多个振荡器。如果需要,也可以只传递一个。

{
"inverse3": [
{
"device_id": "04BA",
"commands": {
"set_oscillators": [
{
"oscillator": 0,
"shape": "sine_wave",
"amplitude": 0.2,
"frequency": 3000
},
{
"oscillator": 1,
"shape": "saw_wave",
"amplitude": 0.5,
"frequency": 80
}
]
}
}
]
}

设置

相关设置键:

注意:不建议使用 HTTP 以高频设置这些值。请使用仿真通道。

  • features/synth/enabled
  • features/synth/oscillator1/shape
  • features/synth/oscillator1/amplitude
  • features/synth/oscillator1/frequency
  • features/synth/oscillator2/shape
  • features/synth/oscillator2/amplitude
  • features/synth/oscillator2/frequency