« first day (282 days earlier)      last day (2921 days later) » 

02:31
@LuisMendo Excellent! It hurt me to see how many bytes it took to wait for a second
Your latest question got me thinking. We should incorporate either audiowrite or sound into MATL so we can build a true synthesizer
MATL Online should be able to handle audio just fine
 
7 hours later…
09:49
@Suever It would be very easy to incorporate those two functions in MATL. If MATL Online can handle it, we do it!
As for &Xx, maybe I should define F to mean 2.5 to obtain a quarter of a second
FM synthesis in MATL... it makes me tingle with emotion
 
9 hours later…
19:15
Pushed:
Input F to Xx is now interpreted as 2.5
 
3 hours later…
22:05
I'm considering this regarding sound/ soundsc / audiowrite: create a function for that named Y#. The name makes sense because # suggests output, and in fact it is used for file write
2 inputs, 0 outputs (default): sound with 2 inputs. F and T for the second input define 44100 and 48000 sample frequencies
3 inputs, 0 ouputs: third input indicates whether to auto-scale (T) or not (F); or it defines 2-number vector as allowed by soundsc
2 inputs, 1 output (secondary default): audiowrite with filename audio.wav.
3 or more inputs, 1 output: audiowrite with filename as third input, and possibe parameter-value pairs as further inputs. 'BitsPerSample', 'BitRate', 'Quality' will be predefined literals
@Suever ^ What do you think?
Also, # in the name suggests the "sharp" symbol in music :-)
@LuisMendo That was my first thought
Hehe, mine too. But I got lost in the explanation
What is the 1 output?
Aww
You are right
Makes no sense
I was considering the file as an output
Well you could have the one output return the filename
22:11
Stupid me
I need to rethink the in/out and defaults
So quick question
F#r
Doesn't the F there say to ignore outputs?
So I guess you could technically do F#Y# to give the "one output" version but ignore it
kinda convoluted
Yes, that's one solution. But I'll try to come up with something cleaner
For example, 48000 is not often used as sample freq
I was wondering that
Wasn't sure if that was a European thing ;p
So maybe T to play, F to write, both with 44100
@Suever Supposedly it's used in music production, sometimes
What do we do for imwrite?
I feel like the logic should be similar
22:16
I was looking at that precisley :-)
Play with the inputs, similarly, yes
Yea I think that's good
I'll have to write an overloaded sound that calls audiowrite underneath
Since I'll have to a file to stream back to the user
I'll come back latter. Dinner time for me!
^ Yeah, I hope not too difficult
Now once we do this you're going to definitely have to write a synthesizer challenge with a MATL demo implementation
@LuisMendo Shouldn't be bad at all
Great!
Yes, I love FM synthesis! :-)
@LuisMendo LOL
Oh wow! I thought Mendo did this! Nice :). Usually he wins my matrix questions, good to see someone else using this language. I'm trying to lear nit too. — carusocomputing 5 hours ago
22:32
Haha. Congrats on the accepted answer! And good to see more people who like the language
Maybe something like this for the new function:
2 inputs, 0 outputs (default): sound with two inputs or audiowrite with filename 'audio.wav'. Second input is sample frequency. If negative: audiowrite; if positive: sound. T corresponds to 44100, F to -44100

3 inputs, 0 outputs (secondary default): third input indicates whether to auto-scale (T) or not (F); or it defines 2-number vector as allowed by soundsc; or defines filename for audiowrite. Second input is still sample frequency (and negative values probably make no sense here)

More than 3 inputs, 0 outputs: audiowrite with filename as third input, and parameter-value pairs as furthe
@Suever
@LuisMendo Yea I think that looks pretty good. I would imagine that most challenges would allow either a sound or a file
I would think that sound would be more common
 
1 hour later…
23:51
This seems a little clearer, and avoids the negative frequency, which was a little inconsistent accross the different function signatures:
* 2 inputs, 0 outputs (default): sound with two inputs. If second input is T: 44100. If F: audiowrite with 44100 and filename 'audio.wav'
* 3 inputs, 0 outputs (secondary default): if third input is a truthy scalar: call soundsc with two inputs. If it's a 2-number vector: call soundsc with the three inputs. In both cases, T in second input is corresponds to 44100. If third input is a string: defines filename for audiowrite.
* More than 3 inputs, 0 outputs: audiowrite with filename as third input, and parameter-value pairs as further inputs. 'BitsPerSample', 'BitRate', 'Quality' will be predefined literals (second input can only be positive). If second input is T: 44100.

« first day (282 days earlier)      last day (2921 days later) »