## [solved] the [sin] operator in gen~ versus [cos~] in Max

Oct 04 2018 | 3:42 pm
Hi I am using the following simple algorithm in gen~ to create a 'fat' unipolar Hanning window (for use in my granulator engine). I believe I stumbled upon this idea more by good luck than advanced trigonometry. phasor~ --> [gen~ triangle --> sin]. This creates a broad sinewave window, of the same frequency and phase as the phasor. I can increase the width of the resultant window by inserting a scalar >1 between triangle and sin operators, and also change the shape of the window by altering the 'peak' value to triangle.
My question is why can I not achieve this in MSP? I phase-shifted the phasor ramp and then repeated the above algorithm but I just get a bipolar wave at twice the frequency. Does the sin operator in gen just return the sine value of its input or is it doing something else?
Brendan

• Oct 04 2018 | 3:47 pm
(again, apologies for screenshot, but Max7 licence has expired)
• Oct 04 2018 | 4:31 pm
In gen, sin and cos do not take 0-1 phase input like their MSP or PD counterparts. Instead they take normal mathematical input of the range 0-twopi.
• Oct 04 2018 | 5:34 pm
Ah Joshua, many thanks!
• Oct 04 2018 | 6:00 pm
ps phasor --> expr~ abs(\$v1-0.5(*2) for the triangle 0-1; then expr~ (\$v1*\$f2) / (3.14156*2) At the risk of pushing my luck, is it possible to manipulate the 'peak' value (a la [triangle~]) using this algorithm - I'm aiming for a vanilla PD version of my Max granulator and have no native [triangle~] object ;)
Many thanks Brendan
• Oct 04 2018 | 6:21 pm
edit: nevermind me :D
2ndedit: you could try converting the ideas in this patch to PD but it only works with values above 2 for the peak:
3rdedit: also, for amp-windowing, this is fine, but keep in mind that phasor~ is not anti-aliased so for synthesis, this would not be best practice.
• Oct 04 2018 | 6:33 pm
Thanks buddy, but I can't Copy Compressed from clipboard - Max licence recently expired ;) I will get round to updating Max soon, just gotta find a feckin job first; been unemployed since January, job market is *slim pickins* - 2 Master's degrees, a PhD and a teaching diploma and I cannot even get *arrested* ffs :(
• Oct 04 2018 | 6:36 pm
(I'm gonna get booted off the forum LOL, no Max licence and asking PD-centric questions)
• Oct 04 2018 | 6:45 pm
Oh no worries, in that case here's a pic:
(i left my job at Pandora a month ago, after 2 years of ad production life felt too meaningless, thanks to some savings and max8 i'm not thinking about it too much but at some point gotta stress about employment again... so in many ways i feel ya 😅) Hope it helps :) Best of luck! ❤️
• Oct 24 2018 | 7:38 am
Hey Brendan, I didn't know how to contact you with a pm. So sorry to choose this way. Is there any update of your 'granary~' patcher back from 2015? I'm looking to replace my elasticx~ external from a very old patcher. Thanx so much. My contact would be peerbaierlein at gmx dot de
• Oct 24 2018 | 9:26 am
I’ll email you later today.
• Oct 24 2018 | 5:27 pm
Ps I haven’t used elasticx in years, or grainstretch, but these are two examples of externals that are way more developed than Granary. If you want to me to add specific functionality to Granary that you feel is missing, then please do shout and I will do my best to improve Granary 😉