set VoiceLimit of sine Wave Generator
-
@rglides oh SWEET! so its not what I said. Thats great news. haha.
-
@Chazrox that could be true, I know setting to 1 probably isn't a good idea too. But no, I was getting some really strange sounds cos of the max saturation for sure - EDIT changing in real-time sounds fine actually, very smooth
-
@rglides I was just playing with it and it doesnt have a problem with zero even so I really dont know. hahaha
-
@rglides shiiid. You're all good then!
-
@Chazrox oh interesting, yeah I would have thought that'd be some kind of mute hack but nope
-
@Chazrox said in set VoiceLimit of sine Wave Generator:
Voice Limit" is paramter [2]
Avoid the magic number, use the parameter name instead OSC1.VoiceLimit
-
@d-healey ah, are these the proverbial "magic numbers" I hear about? It worked either way, I just chose the short version obviously thinking it was better. Thank You!
-
@Chazrox Yeah a magic number means you're using the value of a constant instead of the constant itself. So to anyone else looking at your code - or you in the future when you've forgotten what your code does - they just see a number that magically does something but have no idea what it refers to.
-
@d-healey That makes sense. Now I know wth that means. haha Ty.
Hope all is blessed!
-
Yeah it's true, I did update to this
inline function onknb_OSC1_VoiceLimitControl(component, value) { OSC1.setAttribute(OSC1.VoiceLimit, value); }; Content.getComponent("knb_OSC1_VoiceLimit").setControlCallback(onknb_OSC1_VoiceLimitControl);
but it was very helpful to discover that the function was always working, just not updating in real-time in module window, so the help was massive
edit: 'update' I mean revert hehe
-
@d-healey It would be even better if instead of this:
OSC1.setAttribute(OSC1.VoiceLimit, value);
we could do this:
OSC1.VoiceLimit = value;
but I'm guessing that's too dynamic (or something) for C++?
-
@dannytaurus
OSC1.VoiceLimit
is a constant with a value of 2. So what you're suggesting wouldn't work. -
@d-healey Yeah, it's quite different to what I'm used to in Ruby and Rails.