Hello I was interested in telling the computer to play sine waves with specific frequencies, and I found a custom made function that allows for this. However unlike the Play function, the “Fplay” function doesn’t allow for options. Is there a way for me to change the function, or to achieve this goal another way? Below is the function, with an example telling it to play a note with a frequency of exactly 256. The biggest problem is with the Play function I can decide what the sustain will be, and with Fplay it is the same short notes over and over. Any help would be greatly appreciated, Making functions is a little outside my skill range. I found this function on GitHub but the thread was closed so I couldn’t ask the maker.
define :fplay do |x|
play hz_to_midi(x)
end
fplay 256