nanosynth

所属分类:文章/文档
开发工具:Ruby
文件大小:3KB
下载次数:0
上传日期:2019-12-30 05:16:19
上 传 者sh-1993
说明:  微型Ruby音调发生器
(A miniature Ruby tone generator)

文件列表:
LICENSE (1064, 2019-12-30)
nanosynth.rb (3915, 2019-12-30)

# NanoSynth A miniature tone generator written in Ruby, intended to show how to create a minimal Ruby program that generates sound. For a detailed description of how it works, check out this blog post: # Installation * Download `nanosynth.rb` * Install the [WaveFile gem](http://wavefilegem.com): `gem install wavefile --version 1.1.1` # Example Usage NanoSynth expects 3 arguments: the waveform, frequency, and amplitude. It will then generate 1 second of sound and write it to a file called `mysound.wav` in the current directory. ruby nanosynth.rb For example: ruby nanosynth.rb square 440.0 0.2 The command above will generate a square wave of 440Hz, at 20% full volume, and write it to `mysound.wav` in the current directory. The waveform can be one of `sine`, `square`, `saw`, `triangle`, or `noise`. The amplitude should be between 0.0 (silence) and 1.0 (full volume). Amplitudes above 1.0 will result in clipping distortion.

近期下载者

相关文件


收藏者