Edm*_*mhs 9 audio macos terminal
我需要在命令行上生成给定频率的音符
以下是笔记的频率列表http://www.phy.mtu.edu/~suits/notefreqs.html
例如:
$ some-app -frequency 523.25 -timeinseconds 3
Run Code Online (Sandbox Code Playgroud)
它可以是原生的mac,python或ruby工具.我需要安装的库越少越好.也许我可以用mac做点什么:说或者是afplay?
这将用于发送音乐笔记的其他项目,我希望在使用它时听到它.
小智 12
SoX非常适用于此目的,它可以在brew中使用:
$ brew install sox
$ play -n synth 3 sin 523.25
Run Code Online (Sandbox Code Playgroud)
您还可以将声音保存到文件中:
$ play -n out.wav synth 3 sin 523.25
Run Code Online (Sandbox Code Playgroud)
这很简单,老而且没有维护,但请看一下https://github.com/psycotica0/tone-generator
$ brew install sdl
$ git clone https://github.com/psycotica0/tone-generator.git
$ cd tone-generator && make
$ ./generator 2600 2
Run Code Online (Sandbox Code Playgroud)
$ say "do ray me fa so la te do"
Run Code Online (Sandbox Code Playgroud)
哈哈。