Hi there -
I've been trying to make a square wave, but my pd knowledge is a little rusty. I know of osc~ and phasor~ for a cosine and sawtooth wave, respectively, but I haven't been able to find a square-wave generator. I think I ought to be able to use an osc, and just output 1 when the output is positive, and -1 when it's negative, but I've become hung on the details. Is the following a good overview of what needs to be done?
osc~ -> snapshot~ -> moses 0 -> b (one for each moses output) -> -1.0 or 1.0 -> sig~
It seems like using snapshot to turn every sample into a number so that moses can divide them around 0 is inefficient. Is there an object that deals with signals that can do what moses does? (Or just a better way to get a variable-frequency square-wave in general?)
much appreciated, David Merrill dmerrill@media.mit.edu
You could probably just make a table with two points in it (-1,1) and then use a phasor at the frequency you want to drive a tabread~. Make sure you multiply the phasor output by 2 to properly index your table. This is just off the top of my head, but I think it should work...
Chad
-----Original Message----- From: pd-list-admin@iem.kug.ac.at [mailto:pd-list-admin@iem.kug.ac.at]On Behalf Of David Merrill Sent: Friday, March 07, 2003 11:39 AM To: pd-list@iem.kug.ac.at Subject: [PD] help making a square wave?
Hi there -
I've been trying to make a square wave, but my pd knowledge is a little rusty. I know of osc~ and phasor~ for a cosine and sawtooth wave, respectively, but I haven't been able to find a square-wave generator. I think I ought to be able to use an osc, and just output 1 when the output is positive, and -1 when it's negative, but I've become hung on the details. Is the following a good overview of what needs to be done?
osc~ -> snapshot~ -> moses 0 -> b (one for each moses output) -> -1.0 or 1.0 -> sig~
It seems like using snapshot to turn every sample into a number so that moses can divide them around 0 is inefficient. Is there an object that deals with signals that can do what moses does? (Or just a better way to get a variable-frequency square-wave in general?)
much appreciated, David Merrill dmerrill@media.mit.edu
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
I think the easiest (but not mathematically exact) way is to [osc~] ->[*~ 10000000]-> [clip~]
best greetings, T
----- Original Message ----- From: "David Merrill" dmerrill@media.mit.edu To: pd-list@iem.kug.ac.at Sent: Friday, March 07, 2003 6:39 PM Subject: [PD] help making a square wave?
Hi there -
I've been trying to make a square wave, but my pd knowledge is a little rusty. I know of osc~ and phasor~ for a cosine and sawtooth wave, respectively, but I haven't been able to find a square-wave generator. I think I ought to be able to use an osc, and just output 1 when the output is positive, and -1 when it's negative, but I've become hung on the details. Is the following a good overview of what needs to be done?
osc~ -> snapshot~ -> moses 0 -> b (one for each moses output) -> -1.0 or 1.0 -> sig~
It seems like using snapshot to turn every sample into a number so that moses can divide them around 0 is inefficient. Is there an object that deals with signals that can do what moses does? (Or just a better way to get a variable-frequency square-wave in general?)
much appreciated, David Merrill dmerrill@media.mit.edu
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
Recognizing, of course, that this isn't an anti-aliased square wave, so it may or may not sound ok, depending on a particular definition of ok.
Larry
On Friday 07 March 2003 12:51, Thomas Grill wrote:
I think the easiest (but not mathematically exact) way is to [osc~] ->[*~ 10000000]-> [clip~]
best greetings, T
----- Original Message ----- From: "David Merrill" dmerrill@media.mit.edu To: pd-list@iem.kug.ac.at Sent: Friday, March 07, 2003 6:39 PM Subject: [PD] help making a square wave?
Hi there -
I've been trying to make a square wave, but my pd knowledge is a little rusty. I know of osc~ and phasor~ for a cosine and sawtooth wave, respectively, but I haven't been able to find a square-wave generator. I think I ought to be able to use an osc, and just output 1 when the output is positive, and -1 when it's negative, but I've become hung on the details. Is the following a good overview of what needs to be done?
osc~ -> snapshot~ -> moses 0 -> b (one for each moses output) -> -1.0 or 1.0 -> sig~
It seems like using snapshot to turn every sample into a number so that moses can divide them around 0 is inefficient. Is there an object that deals with signals that can do what moses does? (Or just a better way to get a variable-frequency square-wave in general?)
much appreciated, David Merrill dmerrill@media.mit.edu
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
Hallo, David Merrill hat gesagt: // David Merrill wrote:
I've been trying to make a square wave, but my pd knowledge is a little rusty. I know of osc~ and phasor~ for a cosine and sawtooth wave, respectively, but I haven't been able to find a square-wave generator. I think I ought to be able to use an osc, and just output 1 when the output is positive, and -1 when it's negative, but I've become hung on the details. Is the following a good overview of what needs to be done?
osc~ -> snapshot~ -> moses 0 -> b (one for each moses output) -> -1.0 or 1.0 -> sig~
It seems like using snapshot to turn every sample into a number so that moses can divide them around 0 is inefficient. Is there an object that deals with signals that can do what moses does? (Or just a better way to get a variable-frequency square-wave in general?)
There are severaly ways. Attached is a non-antialiased version with pulse modulation (PM on hardware synths)
Frank Barknecht _ ______footils.org__