Software » Catch with a C

AuthorPost

Vandueren

Registered on : 06/23/2014

Posts : 243

Posted : 01/11/2015 01:18:25 "Quote"


SMIRKY UPDATE 2: Fixed an error that was discussed in the comments below. In order for this bug fix to work, you must remove any existing Catch blocks from your patch and re-insert them from the Browser area.




UPDATE! tiny error in the xml:




        <variable dtype="int8_t" name="condition" editable="0" value="0.0107421875"/> (it was value =10)




But 10 = 10240 and that doesn't fit in an 8byte integer so there were warnings when compiling.




Variation on the Latch-block. Same inputs and outputs.




But when the gate re-opens, you have to 'catch' the previous value before the controls start responding again.




This is ideal to control multiple parameter sets with just the two knobs, without having the sounds skip when you come back to the first parameters.




It takes some getting used to though, but it is how many hardware synths handle this type of thing.




 




Example Patch:




AAEAAAlqeJyFVk1oG0cU/mZ2tTMbVzROaeLUDtWhLqSRxK7+jaCkOA22lcQQtYSSQ7uW1lRB1o8t4TrGvfSSQ3ESF3wq6cmQQimxKW6gl+bSQHMoySVOkxJwoGAIGIMJ1FDcWf3Y3pFEpYNWu2/evPf9vFlAM7SXqH92dwGVfa/tojtVKI5N+bL2VCVXsCq5YgFEM1gC3tH0oG980i5X7UJmBlT7nb2Pw2dz+Yo96Tu7d19hWXYaXY37H82UbCd3cw/lvFWCGopFE6BHtC1modtIGkkzGTKSEcNwrkMEtAh4zlmVzOdQY9FMCENb/DY/Dt153ojxLivwDDZijGgG6jh7wrvRU48IhwwnrRE0TCMeCYWSprOEgKVL+VzFFxGLEvEoYg94lX2DrmZikVoh6jgB2SZ0aItASVvTIrVpjUEfZp/wCXRFInvRBPqIAO5crmBDHbCycayf4t/yP3G09thv+o1gyO9cB0ynSYJrd93xi/d5mv/VOf5yv4CiVjPUqDVg4sVz/gO7ANaolpLVcxx4S3cDNrHEL/KjLsC0NeUg/DihzbNPcbgOv2gp0UQfVyHDdLKHB9mCBJOyIWCaJvRpirhLvHaXz/N/myUaTokUmPXIWWlRe8luubKqRMkDdBOKOg6qbABaXUlQrbg1AFrWfuELTtU1FoLR2jKHCMwKYM/nvhDJbduKiv/ahh7A205UqBbW9kcs7MNBlmlJu80LEsu0DLfYlA32477YzFir2PQRIbbhiVI1PyW4NiJmAou/Ca5/htes92oGw2EH78X7UnKyrf3DOY7Vk0faCPmO5I/YI/6uRDctKzh0JjdVmcyNVSuihIQZNoVQ2Ct2Cf1m0vjfryCj1wa8K1BiD0BP9khl0k12SWDQuUxaFqpL23k7I5RhG9kMhFar+gW82XZDgsANaQvMaaOcNdyRjLbuUJLcsZrif+iKS3qKkAKTpZey2EV2Q5LexBIEklCGtiBEDfB0fagJ8LKWGUHsIfuYfYbjB2r2+0y/L1QXgdNBynLbO5Xhr/O1zvYOLEgNBBbYDn/lakCMzlki+UBbY2908gE9KGfvHSFUeWh5l91VBq7zJ/xZ5ypXU7IPvcvsHr/Zfn/N3dHlfn5aJ66OnChFdkdqTEC1Ar0pTbFvKuOypvaYgV+RetHWBFGDxUJlspifEoFGIuocZV3iaNuzg6kSekTAeEIo+SEoPLLMdrSZfcOZrUrWHks0oU9Ml9SBptArmuqVbPk0xef4MZct9RFFglIfYflOUKqCpg/PiLbssGkLe/Ar+pfw1JJBxi8wz5/xVRyq4xeL1OR1vVXF8PA59g76WlTs94UbQhYdv3jecgjgqvY1+07yDHYErnNQyDYomW4pav09cRz+1Bx5kVAwFnfqWj8FvPZBNZsr+karlVJVwJqIW1mBoIC1vA+YIU/Gae3XfaLaHPH6sDyo8+yr/SGVaEPtWstLgXeF3WI3pdOObgpC5giNPWqJ77XZ3y3xSl7E7xA6sUT+A0bW9oA=




4 different oscillators play a note in order,Knob 1 adjusts the Pitch, Know 2 filter ferquency




Use button 1 to cycle through the 4 oscillators.




Use button 2 to adjust filter type. This is hooked up through latch instead of catch, so you can hear the downside: choosing say a HPF and then switvhing to another oscillator immediately switches that one to HPF too.


smirky

Registered on : 11/07/2013

Posts : 406

Posted : 07/23/2014 01:34:56 "Quote"


Holy crap you did it. I've been piecing together a long chain of blocks in each of my patches to achieve this since I couldn't figure out how to do it in a block.




You, sir or ma'am, are my hero.


Vandueren

Registered on : 06/23/2014

Posts : 243

Posted : 07/23/2014 07:45:43 "Quote"


Thanks Smirky!




I was to lazy to figure out the blocks combination  




What would you think about a selector that let's you choose modes:





  • 0: classic Latch (instant jump)


  • 1: catch


  • 2: jump (like in knobextender, = jump when moved)


  • 3: higher takes precedence


  • 4: lower takes precedence




...




or something else useful? Requests are welcome


komatrohn

Registered on : 11/09/2013

Posts : 34

Posted : 07/23/2014 00:24:02 "Quote"


Very cool and useful. Thanx




 


komatrohn

Registered on : 11/09/2013

Posts : 34

Posted : 07/23/2014 00:29:07 "Quote"


I would like that very much. Also, just an idea if possible, a mode that changes the value in relation to the previous value (adding or subtracting depending on setting).




This might get a bit crazy at extreme ends but could be tamed with a clipper after.


smirky

Registered on : 11/07/2013

Posts : 406

Posted : 07/23/2014 06:29:07 "Quote"


That would be amazing.




My biggest sadness with the KnobExpander block is that it doesn't work the same way in the emulator as it does on a patchblock. In the emulator it jumps values only when the 'knob' is moved (which is what I'd actually want), but when using it in a patchblock it seems to jump immediately. I assumed that this difference was because of the difference between the digital emulator and the analog pbs, but I'm not sure.




I've already started planning to try and hack together your Catch block with the Data Demux block to create a super KnobExpander-style block, but I have no idea if I have the chops for it. I probably won't get to that until this weekend, so if you want to do it be my guest.


smirky

Registered on : 11/07/2013

Posts : 406

Posted : 07/23/2014 06:31:06 "Quote"


Out of pure curiosty, what would you use this for? I'm trying to wrap my head around a cool way to use this fucntionality, but my brain isn't thinking of anything. Maybe some kind of generative sequencer...?


Vandueren

Registered on : 06/23/2014

Posts : 243

Posted : 07/24/2014 08:40:34 "Quote"


that's probably because it only changes when the value changes, but in the analog realm the buttons are a tiny bit noisy,a nd they might have changedjust 1 bit from the stored values…




If I implement it, I'd have to do some tesing to find a threshold of a few bits.


smirky

Registered on : 11/07/2013

Posts : 406

Posted : 07/23/2014 21:45:36 "Quote"


Yep, that's exactly what I was thinking.




Not sure if you saw this post of mine a while back, but it might help you in thinking about how to control for the noisey knobs. It might not help at all though...




Basically, all of my patches have a series of three sets of blocks that I use to do the following:





  1. Map/clip the knob values to 0-1 range, since they don't always seem to reach actual zero.


  2. Smooth out my knob jittering, per my link above.


  3. Use a kind of Latch+Comparator to make sure the values don't automatically jump when I switch between knob functions. Your Catch block helps do this much more elegantly.




Some day I'll write a block that does all three of these at once and win a Pulitzer.


Vandueren

Registered on : 06/23/2014

Posts : 243

Posted : 07/23/2014 22:16:34 "Quote"


I wouldn't use demux, I think it only sends an output when the value is actually changing, and that doesn't work well with Catch.




Just use Split and distribute, as a bonus you get 4/8/16 (!) versions by using the expanded routing objects.




Example with 1 knob controlling the pitch of 4 sines. (knob 1 / button 1 to select oscillator 1-4)




AAEAAAMPeJx1ks1O20AUhc/Ew9wAXbCB8hMJb9ilaMbYxJU35WeLWOQJnMSolqIkgI34SdtNX6ISq4rXYIm6RogNWx4ACYQEK7g4JIi4eCyNrZk79zvnDKDO1G/0nqenl7f/CVmNWxGku1WrQaS0SicYd10dvA4BHEp8WkkbcdveTJNOmkD6lbABzKr74heMDrYCI2thUv8Ouay9OtBVZ7SPqd6qpwMT6EVtdMV1nMDwuUdAsRptp1GrzgCN0LhMQ6fqGqXBmYEu26ZsO2V7Kfs1WeXMKKjaacaJ7XIzv+IBB+qcJjH+VuhIS9yxxi4EHlEQe0NSb+kn/c1JVe81iDvq0g987u1wdU6EuB1SLfboG/3qVzj/qUi5IoOH9MKvBphTN0UL9EpRYGMZeVa8w8UDSTrO4RYgN+J9NiGKQu8F/4auMM+Li44XfDRx4RxgbYQdSGfZ84GSulCXmOgZzB18ncHzxgPOaK3dSnbazV3ILe1zF4sKfJkGuRsmLoFJgLH1eDfZiWtpwty+WWJxM9SkaSyYt0A/HFli3LMrODHBiQ1ZcKT+0Z+cBcO37pEsSvv+m7z/eMAzONmcpA==