Scriptnode LFO shape
-
Anyone know how to make a rounded rectangle LFO with scriptnode?
-
@d-healey Interesting. Mixing modChains seems to work
HiseSnippet 1186.3oc6X0raiTDDtGG2NwdytZQZe.FshCYkVrrSVfEgPNjD6UQfirhCQ41pN8TItkmo6gY5IIFDm3oHbBdB3BBItf3HBId.3.hC7BDId.ftlYr8L14Or1MYWAyE6t9oqu5mtpomNAJNDFpBHVk2YfOPrVj1cfT2a8dLgjr4FDq6QayB0PfcBo0F3yBCAGhk0bOCIXUtHI94rFqwbYRNLlDgrqRvgOV3Izio1Y0OR351h4.6H7xH8SVcStRttxUEYvybzZDeFuO6PXKFJVAJwpTSGgVEzUyzPnQl0TNC51ScrLQ9cEgh8cAbQcRWyFkPlrdOgqSmg9ZHgXUryXOetDO+Az1BGwH5ii.2Olg8XMxFCrJjGREyAo5YgTsLPpkx0A2.TjogGIC5JlfNCHTNQtLcdjgofTFBU9rylRMHCE5AYSQ2pv8MncDZduyGuENG7ZRTurwaZx+tzlGb.v0iAaQZq8l0Lc8yEJmagn0zwtJzt7.gu1XeDHKltzt0d0yAnDxDqukZaN2DpsY1efcS4gBITkG.FTtQn+Vf9XUP+kdH6gO58OHRxw3tse.3yBfcTcbYCVJj446BaaT3w166p386J9L3QU97Jkq7EUrynTLRWCkXIdOlTBtgSKFdDVpCTtKIi71GBdr8QL2nw62UbJt90+TLYaUjVHOrMSGHNgXQ2Jxqqo4AGVOEcFZVEHnpwqqgqwxptfzIdweadRYVGWakxr9PlDzY.o1POMTFm0R+u4eXJZNJCoobPP2hwMN2fNLcOrj2jZzlZJHnJeTsEJetRq4LtkODnEvvZBbk4jPgjJfMC2E4xYtjcwfIpDAsGJdgDCWDE8NTOkSrgpSxAjGjAHCEgXhWYiTnymuhenIJkwD2kpB4lF33Y6ILB5sAP0w7uZKrtBq8NYCllgd9FhPeSI4ZQlSiImOxQAi2RG3jQYmNr.yvAchrkFsxvusPlFpF2MoM6jInc+U6pAerdOaWRzMKgcv.xDxuvpjLFoz0yHu4jF4qO8zenQ29vwIQuTpq9kd+ZijjXq.3Si.IePN6+zUV4OaPtbm7rFSa+ZWnStXrkr2F6FSlZmH+6imm03himOybb+xMRwqqQvMbdZmdrvo1Qr89LtikhGmNdC+pSwmeqAIS0eEZn3vkMmfVNeo+8ndleqlx7Jq6sxU3ZM6wfDxSGUy.4xz.fChifIOrFjz9r5P12PftBsE.N6ad2tKG2TpWjadLWIIJizushv+zu7MM+9+52ygz4o9.q+DUD2IoYHx4FsMXVfs.k6BrIaSuXRTLl0sbkZ1SqSf8JiFk8hbRFMiEVLyjr+qMHKeax+eP1qRCx1689te9ne7OZ7RcPV4gCxdsYNVo3tru50jsDMzbigICiCGtFy6Jg1U79+lKgHg3qWMJDMZn9Ehq4SZ9+ZSu+bK9jMGllRu.VlHjIQAGI3Px0kKS2.B6qU92L2GziwCTOmmbEWLrrPLEyk5jwelpxz13Z65jiRbWJsV0ZDOgi34bN9cEdq5Dx4qyxyfNqLC57jYPm2dFz4clAcd2YPmmdo5fe8tOLRq7R9lSFBcZFWbYY0Tx12MoXm7O7CXYjC
-
@Matt_SF Thanks, I'll play around with this!
-
@Christoph-Hart Feature request - make core LFO gain default to 0, I keep deafening myself each time I add one :p
-
@d-healey said in Scriptnode LFO shape:
@Matt_SF Thanks, I'll play around with this!
I noticed sometimes phase issues happens when changing things around. It seems to work better if you put the 2 modChains in a split note (and sync the frequency parameters with a global parameter knob).
-
It seems to be quite hard to keep them in sync, if I start making changes to some of the parameters I lose the shape and can't get it back.
-
@d-healey I can't try it right now but a
control.resetter
might work... -
@d-healey Didn't try much, indeed
control.resetter
works but actually it might be unnecessary : putting the two oscillators one after the other also works and they seem to stay in phase. No need to bother with a convoluted send/receive system.HiseSnippet 1135.3oc6X8zaaTDEeFaOowtoUAodhSqp5gToRvNTnEgPN3j3JKvQVwgnbqZxrShG4cmYYmYShAwI9TDt.eC3LW3a.m3DG3Fhy4a.LucW6cW6jzfUaxg18jeu27l2u2emYbuPEiq0pPDt5tiB3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+O7udz+T.o2gDvoCmJxd2jAIfjazQH4A1hDlGmN8Y5KkDEiEcKmwyOKROEQQikTnC2wEccs6DF+Q2CVd+O8uahw1KCJ4wWyELPoLxzKD0wc5aCMACfn7S0d8O2DcgvovQU2jn4q6LtbL8Jz4tQqsfjerfwSdvSUxlb8PiJ3l4F89TVn5krjGo.4wEi4XuVtL9OcnJoKP6z.cbh6SH0WsNxW3JdIiAuL7CrOk6h0Ys4PmOZNz4oygNe7bnymLG57r4Pmmek5.++Kom0AE2VF81Jt3Bi2RRsuULdVC5+.Dvd1bA
-
@Matt_SF I like the simplicity! But your snippet is giving me this:
-
@d-healey That's odd, it's working here :
Maybe having a parameter to reset the oscillators' gate once in a while is worth having after all... ?
And the oscs do seem to stay synced when changing their phases btw
Edit : and which osc's phase you choose to change doesn't matter, the end result is the same -
@d-healey About this case : just inverting one osc's phase gives you the rounded rect wave.
-
Here's another approach using a
math.expr
node with theMath.smoothstep()
function and a single triangle oscillator that is being rectified:HiseSnippet 1249.3ocsW80aiTCD2aabNRtxo6j3QdvpBDohdQIG8NNIDpkl1TUQaunlRg254tqShU10dOudaa.AeY3q.R7FhG4Mj3i.R798M.Fudyta9S+CQWyCs1imY7OOyuYr2NJoKKJRpPNUNYTHC4rBt6HgdPqATt.s+NHmGgOjFoYJhUz1iBoQQLOjiyx6YD3ToDJ42a2bapOU3xxEgPmJ4trC3AbctzNa80be+1TO1I7fBZuwV66JEsj9xX.OKiafBotCo8YGQMpsDF4TdWOtVp5poZVDxoz1RuQcGHuTX0+TdD+belYRSTWvQVwsk9dFDajhZMf660Y74NBAdoSdTXYaT3CvGx83YxyiFONYARtEEiGNKMI7VdB30rH7ZT.dyARNEfTIKjdBtqqhGpyWwfmGh2W.ImdTHrWDJVcQN+NtkDTPnqGPGxZqfIYFT6EMZrNA9yZeQuXgqlKEDo3Hol8JQs0p9CUqT8GqRldod8l6ZlsQI88Yp4trISqtICqIhCNmoVmbA0OlkoHb7mLlhu9XZwTtq8TWPQoXe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Me9BXyKuQaLeh4WEqkA1xAPPmcSp+bb1UPAlUBKD8e.Su9RO.
-
@Matt_SF @Christoph-Hart Thanks! How did you add those annotations?
-
Rightclick on a node, then enter it in the
comment field
. It supports markdown syntax -
Here's how I do it
HiseSnippet 1222.3oc0XszaiTDDtGa2NXmrqVj1e.iVwgrRKV1KKOjPnDxCGYANxJNDs2V0omNws7LSOzSOIwf3B7yfCbiy7OfKHARH9OfDm3DQhSbB5Z5YxzSrSbhIKO7E6t5tp5q9pG8LdfTPYwwBIxow9ShXHmUvCmDpFs4HBOD0aKjy8w8IwJlz0HZiIQj3XlGxwo5Nf.mF0PoeNesMH9jPJqPDBcffSYeHOfqJjNX8Of662k3w1mGXc5msdOpHbSguHQimp31nHBcL4X1tD3XUvHm5a6wUB4PEQwhQN01P3MY3Hwoglye.OlenOCVzAMTaHi3tBeO.wfTzli39dCxi6Xj1JCJXgpFV3g39bO9ExKXiGjtgagF17gSkqCdcrgW6aL7PVnqlAcZPH7R7IpxHCRGYavEkyT8BUrvXtZhc55eU39p3AbEczrwakYfWch5kMdyR92Cu8QGwnpBvVC284u7yzNNSycMwCoRdjR6e.Hqjszs6y6TBPFwHmuGqaghUtmPjtRQRn1c6oCE22yc6vi4grVTISC4shi1koNUHGu5irN1id7617njPJjObijrHhjsuXfOYxpwjfHe1dZceh6g9B53g7Og83leZyFM+rltVJkFAa.mXU5HRXHyOd5iAs4gJove0vjfCYxmnAreRg8lpSu5USv1c5yH+tmHQwCOtOQI4mgbv6lDLTOfgx1LCcZYNUPfpoqaCqgxsgrPuzE+o9S1lcf0NYa1IeSDDLrPkVdFqllMy9s9WPp6dXKhF1U3AvuKgpCyICHpQPSgN6ozUcLYK5EUek0rbYHXEiyRMWM37MwABOi5kr9Csr9EmPSG1DADak7P0bOzvxCqfEwT8LbnkFMUDHYsr1ddNnxlBnx5rsHJBDHawiizEbajn6AMcEkj.rolKN6Bte.QpudPYNa8KVo2uOO7.npxdFRexYWR1CVenhEAUy1yFgnrNL2hglxFHKmTeZmb9ZS6jWyxIoiDFyN0vaYmY8uH3mRc5x3tR1GmvBoSJ77x+3m+6izFFc8g2r7b6qL7VI0St6ASeQSYIzsmIOesqlI2Q2Fe8No1M0IfAWBOXDIdN4lakEqmd84LfnorGCmoANle7S0sNkq4uONP+cq78lSAe9c.NUzy6sqccVbxvHdZxvpkcIbDiLtSYjuroaE1Y9CBJtpdeh7XlJEyWVHLfU6zdd.acHOR3SjE4DPbNZ2NjnGfmRD2zfEcGNpvlaJP5LlFqujpU91ycV1skivXhm2BvOm+syjeJUOUcQ5fsqmd+DkPWYmggoBB8klWeE6rAowCCoDe1c0TGqgoviCX7vNjf.RgG94e4d+1e7U+Po94kvTe1ky5qX5lM67eydYSUSIT2zfZP97JRuZjhuc4vaZURIjGj3OSjCxWbj+2ii+5u76b+F4uVp1nY9r9N+ObXe8zg8K9r96xmI6RKjhHlTwY4uuCrR+VdULOQRu3Cfc0CGxCPmpkMvG0KGTYOzskE0vhcBmxLu5TC7Vr3wJQz+LuCP.gJEuH6FCH5dkTI5QRgo+8EMv8g0tcPmXhLLtcq1n.tG+ETJ7Nlut9kBmsNOcAz4MV.cd1Bnyat.57VKfNu8Bny6bs5.+SNYSuf++AsfAamVb43Tb4aUzeAUld97A
using a math expression is less convoluted...
But the cool thing is that you can go linearly from sine to rectangle just by using the Gamma parameter ;) -
I've built up Christoph's example into a larger module. I'd now like to include a fade in time to the LFO. I've added an envelope and tried it in various places in the chain but it doesn't work as I want.
Any ideas?
HiseSnippet 998.3oc4W80iZaDDeMvVUtzVkTEU0G5CtR8Ahz0HHIMMR8gvcbPDp4tCcPt12P6YObrB6ccVulTTU+t0OB8yP+DjuAsy50fM47Qnz6hpT4Aj24O3eyL+lYGFnjdPbrTQbpOZQDPb9D5vEB8zNSYbAo+QDmOhpgXM4vEQr3Xvm33T8EFcN0qQR+71meHKfI7fbQDx4RtG7RdHWmKcP6ejGDzi4Ci3gEr9Is66IEcjAxDDGUoMIQLuYrKgSXFypPQ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ation to the frequency value? (another math node? or could I feed my noise osc back into the freq of my triangle osc?)
-
@d-healey Are you using new_layout? Because the snippet crashes on develop...
-
-
Also, is there a way to get the Math.expr node with the smoothstep to be bidirectional? Currently it always goes from 0.0 - 1.0 but I'd like it to go from -1.0 - 1.0
Actually I think I can work around this by editing the modulation table.
-
Also also is there a way to get LFO to restart on keypress, so every note in a chord stays in sync?