Polyphonic LFO 2023
-
There's an old thread about this from 5 years ago that I didn't feel like resurrecting, so there can be a fresh take on this.
I have a sampler that fires up to 5 voices on note. These are fired using Synth.playNoteWithStartOffset using a for loop. I want to have individual modulation for each.
If I drop an effect like Stereo FX and apply some modulation, modulator's onVoiceStart callback properly executes for every voice.
But if I use an LFO for pitch modulation, then use a script voice start modulator for the frequency, its onVoiceStart callback fires only once, not allowing for different LFO frequency values per voice.
Am I doing something wrong here?
-
@aaronventure The LFO is monophonic so any child modulator will also be executed monophonically (even if it could be monophonic).
Just use the well documented script envelope modulator to create a polyphonic LFO.
HiseSnippet 1521.3oc0X0saaTDEdV6LN0ogpFHBA2MWzKZEkHGnTPhKhiiiCFpSrxlF3tvj0iiGkcmYY2YSpKhq4sAIdC3QfWAdCxa.bN6O16FarrcanhToJOm4bl4LemuyO1cCzNhvPc.wp5IC8EDq0o1CUlA6MfKUj1MIVOf1gGZDArDQMF5yCCE8HVVkO.EXUcER7e2rSCtKW4HFKhPNUKcDuP5IMik1s92Iccaw6INQ5kS6mUusiVsm1UGA9SYZMhO24R9EhC4nZknDqJ62SZzA1FtQDB5zP2an8.80pD8OUFJO2UfK1lXCGThXxdCjt85l8VCIDKZ2wu7xIu7Mocj8jijOFAdX7FrwVjGCrJMKWZ6Evkrx4Rqj3RaPscBj9lw6f9y8osUP.oOGf57tRhtDq+ftmFTPY1xieonU.rXjAO940p8TF7eO4q6GobLRshoUGpMhiTO9Iq8yqUcseYM1s2pe+otGdMAZWWQvT2FitAyxvGqh7NWD7T1Ub2HwHEgmeQLsx7goNIu5bJpUsURyQ9hz0szt8PrB+7jQ.RJrAe5ksaxMbLnjJCzyWDXjn6X0TbEvpSBQUoMEgWZz9.udh3Gvbz8hb4lhzILuIcC.OJDCw.kJTZFlOuZA3X0lIGadcwMnckFmAS2GKMEeDPp6BeLMy78n62uuvwL1AWg15GV1zv4+5ePx0eepsTIhKKFe4eX7Z12yuRvNPnDAH3s8LpL9myakQ+4tx3QNF35OIfqB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ZqjqIYg1JYU1IMz5K83wSu7F+Kh7t3qxerNx.0u6vgIHwpZGF4YCENcxlgJLa7oz00xJoZCc0qkUxKcysw0Voat8n5g+WbGdbm.8Yoy1fQz6EKAd2p3eYzpzN3Z11jqR3BTbLOB1x6LGGDh+T3aROca9rkvlOeIr4YKgMewRXyyWBa9xkvluZl1f+pCocHvrNPP28SZiZsuhCr2XlN4evWOZCF
-
@Christoph-Hart After I posted, I was about to go to bed but figured I could give it a try with the script time variant modulator. I came up with this:
Right clicking the node(s) and enabling "AllowPolyphonic", but it still wasn't polyphonic, even though the onNote callback executed once per voice as expected.
Is the time variant script modulator monophonic only, too?
-
@aaronventure yes. "Time variant" is HISE speak for monophonic. Polyphonic Time-Variant = envelope.
A few unrelated hints:
- Use the vertical / horizontal swap to make the scriptnode layout more squarish ( in your example swapping the orientation of the fix64_block will make it more clear)
- Noise phase modulation is gibberish - there is no phase in noise. What do you want to achieve here?
- you might even get what you want with a fm synthesizer node and get rid of all modulation connections to modulate the frequency, it's basically a sine wave generator hardwired to use the incoming audio signal as frequency modulation
HiseSnippet 1926.3oc0Y8zabjTEuaaWNYrCQYYWVARbnNrGbjxNZbHrrRHv+2ACYrG41qYiPBmxcWyLEt6pZppZaOfPhuA648FRbjKvdiaV7I.INvE9PDNv4vqpp6Y51y3YmYRbBXGY0UUupeu52626OUmVRQHUoDRO+ZG0Kk54eOTPOtt6VcILt2da64eeTShRSkX2Ta1KknTzHOe+4epYB+ZK3Y+4kqsIIlvCoClxy6XAKj9LVBSOX1Vq+yXww6RhnGwRJI8SVeuPAeKQrHCrm4QM7RIgmQ5P2mXDaNjm+h6DwzBYflnoJPlMEQ8B5Jtf6j+XlhcZL0LXUu.3E4l1aqtr3nVEmUkmmOp0fS97tS9GfZxhX8me.B7.6B3A6nLF3O23LoUmBSxujIsfyjdOTPnjkpGrhwdVFsGGbHsI.TW1Tbx54eEZKAH.WWOgbFcWILn+FV4SZz3QX3OO7G1NiGpYBNVv2WnoGvW4gK8aW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9WobF3hVDYKJMzawa5U8GMBUCIotQUuLxzKVFDq1af9k+nk9m+wG7x09Zz+KWaX82XJO52yperqYvgd+y...JaJw9mBrzaMUONr+NnVcMsnLzq9sftWz1y3HN1kxbrHpiQlJ4LV1kyny0+lMiIa1SQGAg+61D2OyMlovPm9cg7DJaEUHQBVIvWPwYPNhO9wOIZSLQgSHWhMZBCRZ9RMUh6qDjNeID6NCiXO+pgQrO8pqgX+gu7K+qqMMH1u+W1t8lWsQFjaBnP16vN8dt0+h0mH63Eu+1+i7H1fDgP2kw6bc22S95xXLJb.XISh9upye9astKh8Pphpcukgotk3OKfZmTk8Tywdfou4JMeE+4Uqz7WPafUlaFeg4lwcJtYrqTAvWJJAEJR.LADsCmDaK6jZ5csf1YZLakK5xfYXtsnoWpOUHNCGQay3LWqaswDtgrpL2KmpfBSRWkIfbBE0fpRFJJSa4jFR5uhYJ30yYhOa2Cd3Rikotv3Yp2Z4z+Eewe6+rx+5eu1qIccpSzr7fqUL0IYGUAlUlxBLOvBFMgadxRiYT4+aUjoRaj.y8w.YsZHy8Qf2pa8h0lvbteNjyEX4l+kjJjZBGZsR.AOZC0Edxv+eQi50qu5KfTw7NTW3jY5RwKpdJMMASuLkFpUfzikZ6+1nj4Dj2494c7B+074Gp.meHh.YG5oJZ6MWlwjN54+oWM9lyus6.8lG.NiRHt4neWzO0lNx6MeMvg1p8iXyo1q7px+l14Cyuh2dQ8ahnug5lyVJ065Ve4DWu4SMND0axN.1pXUL+xlo2lPAjDh8d2u1ed+2EeW5CEYZnrYShVxLbx8yRB.peXwU8UE2xOebihbMAv87aTPXyWbUyX+7EWsOa9sgNRHgRwIgtu6hwadW6Lv4la+u4qFpoYLdUuyc7.j4qQ3YtV9IggFH9iW0yaz64wyvd9dyvddxLrmu+LrmOYF1yOXF1ymN18X9D54ciXh3fIZsiKIn+NbBvdsLcu+KfhYT.y
-
@Christoph-Hart said in Polyphonic LFO 2023:
Noise phase modulation is gibberish - there is no phase in noise. What do you want to achieve here?
I just snapped where I left off yesterday. I was trying to figure out if maybe it was polyphonic, but the noise seed was the same and that's why I wasn't getting a polyphonic result, so I had the "phase" of the noise switching onNote (which is firing per voice) hoping that was maybe the issue.
But it turns out the whole thing was monophonic from the start.
@Christoph-Hart said in Polyphonic LFO 2023:
"Time variant" is HISE speak for monophonic. Polyphonic Time-Variant = envelope.
Ah, I didn't download the latest version of the dictionary!
@Christoph-Hart said in Polyphonic LFO 2023:
the well documented script envelope modulator
I know you'll get to it eventually and re-do the whole docs like you did the website. It would be a shame that you built all these magnificent systems all intricately linked together, only to have them go unused because of the lack of documentation. Dude, I can script my own fucking modifiers and build networks in minutes. I'm not sure how many VI developers are aware that HISE has this feature, or the depth it has.
Right, what does this little guy do exactly? https://docs.hise.audio/scriptnode/list/math/sig2mod.html
I realized that the osc signal was going negative, that's why I did this in my first try as posted above. div = 2, add=gain
I'll get back to you on the rest as soon as I try to implement it.
-
sig2mod (abbreviation for signal to modulation) scales a
-1...1
signal into the0...1
range. So basically the exact same thing you did with thediv
andadd
nodes, but within a single handy node.Sidenode: using
div
should only be used if you don't have a constant divisor because it's orders of magnitude slower than floating point multiplication. If you write that in C++ code, compilers born after 1970 will usually figure this out themselves and optimize the division to a multiplication of the inverse, but I wouldn't trust it to do that with vectorized data too (all math nodes use a SIMD function that operators on multiple samples with one CPU instruction). It's not critical, but I would recommend making it a habit of preferring multiplication over division whenever possible.I know you'll get to it eventually and re-do the whole docs like you did the website
yup some bright day in the future. However I think it made sense to implement the stuff first before making proper documentation because it allows it to be used by me and some other brave power users while the API stablized. The documentation can't get outdated if it doesn't exist!
-
@Christoph-Hart said in Polyphonic LFO 2023:
Noise
Is there a way to get the same behavior as the random LFO which is available as a time variant modulator?
To be precise, I need it to generate a random value at a given frequency. I'll then plug that into the smoother node.
-
@aaronventure Just slap a
sampleandhold
node after the noise generator and use the converter node to control the duration as milliseconds:HiseSnippet 1396.3ocyX8zaaaCEmxIzdNIsocce.zwTfBC6rttArC0M+wcFaNwnJK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