Square Wave from Sines


    Oct 09 2019 | 11:57 am
    Hi, guys I am trying to make a square wave from Sines, however, I think I am getting the phase wrong. As you can see in the scope, it's not a square.
    Could you please point me to an example. The max documentation seems to only have already made objects like rect~ phasor~ and so on. Thank you

    • Oct 09 2019 | 1:26 pm
      Sorted!
      phase needs to be 0.25. because cycle~ is a cosine not a sine wave.
      From : https://www.facebook.com/groups/maxmspjitter/
    • Oct 09 2019 | 4:52 pm
      depending on what you do it could be cool to start from a phasor~ and make all waveforms from there. once you did that you will know the phase relations between these methods by heart. :)
    • Oct 09 2019 | 5:59 pm
      Hi Roman, thanks for the reply
      however i needed it to do it this way so so that students learn by adding each harmonic ‘s frequency and amplitude manually.
      The phasor object gives me a made up shape already, also I am aware of the examples in the documentations thanks
    • Oct 10 2019 | 12:17 am
      multiplying sines can produce the frequencies needed since the output of the multiplication is the sum and the difference of the original frequencies.
    • Oct 10 2019 | 3:14 am
      you´re right, i misunderstood the question. you still could use phasor, in order to avoid phase offsets between the partials. #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 437 186 50 9109513 +~ 0.75; #P newex 370 186 50 9109513 +~ 0.75; #P newex 303 186 50 9109513 +~ 0.75; #P newex 236 186 50 9109513 +~ 0.75; #P newex 169 186 50 9109513 +~ 0.75; #P newex 106 186 50 9109513 +~ 0.75; #P newex 67 251 50 9109513 cycle~; #P newex 399 279 50 9109513 /~ 11.; #P newex 398 251 50 9109513 cycle~; #P newex 437 151 50 9109513 *~ 11.; #P newex 332 279 50 9109513 /~ 9.; #P newex 331 251 50 9109513 cycle~; #P newex 370 151 50 9109513 *~ 9.; #P newex 265 279 50 9109513 /~ 7.; #P newex 264 251 50 9109513 cycle~; #P newex 303 151 50 9109513 *~ 7.; #P newex 198 279 50 9109513 /~ 5.; #P newex 197 251 50 9109513 cycle~; #P newex 236 151 50 9109513 *~ 5.; #P newex 82 501 50 9109513 *~ 0.5; #P user scope~ 335 383 515 559 64 3 64 -1. 1. 0 0. 0 0. 206 206 206 83 83 83 0; #P flonum 210 45 47 9 0.25 11024. 3 139 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 221 89 50 9109513 phasor~; #P newex 130 279 50 9109513 /~ 3.; #P newex 130 251 50 9109513 cycle~; #P newex 169 151 50 9109513 *~ 3.; #P toggle 42 469 15 0; #P newex 42 530 50 9109513 dac~; #P connect 8 0 0 1; #P connect 8 0 7 0; #P connect 21 0 8 0; #P connect 4 0 8 0; #P connect 11 0 8 0; #P connect 14 0 8 0; #P connect 17 0 8 0; #P connect 20 0 8 0; #P connect 19 0 20 0; #P connect 16 0 17 0; #P connect 13 0 14 0; #P connect 10 0 11 0; #P connect 3 0 4 0; #P connect 5 0 22 0; #P connect 5 0 2 0; #P connect 5 0 9 0; #P connect 5 0 12 0; #P connect 5 0 15 0; #P connect 5 0 18 0; #P connect 24 0 10 1; #P connect 25 0 13 1; #P connect 26 0 16 1; #P connect 27 0 19 1; #P connect 18 0 27 0; #P connect 15 0 26 0; #P connect 12 0 25 0; #P connect 9 0 24 0; #P connect 23 0 3 1; #P connect 2 0 23 0; #P connect 22 0 21 1; #P connect 6 0 5 0; #P connect 1 0 0 0; #P window clipboard copycount 28;