在音名、MIDI 值、频率、音符盒刻度和简单蜂鸣播放之间进行转换。
- 仓库:
opencomputers - 系统:
openos - 类型:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\note.lua
local note = require("note")- 说明: 把音名或 MIDI 值转换成蜂鸣频率。
- 参数:
n
note.freq(nil)- 说明: 把音名或频率转换成 MIDI 音符编号。
- 参数:
n
note.midi(nil)- 说明: 把 MIDI 音符编号还原成类似
A#4的音名。 - 参数:
n
note.name(nil)- 说明: 通过
computer.beep立即播放一个音符。 - 参数:
toneduration
note.play(nil, nil)- 说明: 在音符盒刻度
0..24与对应的 MIDI 值34..58之间互相转换。 - 参数:
n
note.ticks(nil)- 本页只列出模块导出的公开函数。