From: "Ron S." Date: 2012-11-20T00:37:10+09:00 Subject: Missing Something I am an amateur programmer, and I feel I am missing something. Whenever I've tried to understand certain aspects of programming, I often feel I am just "missing something." And most instruction doesn't help (usually because of overly clever examples... like: Okay class, today we are talking about classes. So we'll use this class as an example. We'll create a "class" called "class" and since classes have members we'll create a member for each member of the class. Then we'll create a variable in the class called "class" where we'll store how classy everyone in the class is. Now... how many of you wear glasses?) I really just want my programs to DO SOMETHING. And I am trying to develop a sort of automated analog synthesizer that works with files in the .wav format. So my question is... what is WRONG with something like this? #! usr/bin/env ruby require 'wavefile' include Math frames = (ARGV[0].to_f * 44100.0).to_i volume = ARGV[1].to_f freq = 44100.0 / (ARGV[2].to_f) file = ARGV[3] w = WaveFile.new(1, 44100, 16) (0..frames).each do |frame| w.sample_data[frame] = sin(frame * 2.0 * PI / freq) * volume * 32767 end w.save(file) -- Posted via http://www.ruby-forum.com/.