Delayed comparison workaround [FAIL]

Until our dedicated user library is in place you can post examples and modules here

Moderators: electrogear, exonerate

Delayed comparison workaround [FAIL]

Postby JIftw on Wed Apr 07, 2010 7:40 am

EDIT: I no longer recommend using the posted workaround. Use the "de-threader" instead. See later posts for explanation.

Hi,

Just stumbled across a little problem and found a workaround. Thought I'd share it, in case it'd be useful to other beginners like myself.

On the left, you see the problematic case where the equality test is correctly solved only when it is no longer true. (Delayed response)
On the right the little hack. Simply use the integer as an index for the selector which chooses the correct boolean response.

Image
Image
Last edited by JIftw on Sat May 01, 2010 1:44 am, edited 3 times in total.
User avatar
JIftw
essemer
 
Posts: 46
Joined: Tue Mar 16, 2010 11:19 am

Re: Delayed comparison workaround

Postby JIftw on Wed Apr 07, 2010 8:19 am

Um.. I made a mistake.

The selector keeps the last entry when (index# +1) > total entries.
So the preceding hack was not a test of equality, it was "if greater or equal to 1".

For strickly "If equal to 1" you must also connect the "False" boolean to the selector's last input.


EDIT: Replaced external link with assatchment as per infuzion's recommendation.
Attachments
workaround.png
workaround.png (39.77 KiB) Viewed 688 times
Last edited by JIftw on Tue Apr 20, 2010 4:50 pm, edited 3 times in total.
User avatar
JIftw
essemer
 
Posts: 46
Joined: Tue Mar 16, 2010 11:19 am

Re: Delayed comparison workaround

Postby infuzion on Wed Apr 07, 2010 11:23 am

Might be a reportable bug if the triggers are not moving as they should.
BTW, it is preferred to post/upload images on the forum, so they will not be lost later.
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: Delayed comparison workaround

Postby JIftw on Sat May 01, 2010 1:42 am

I no longer recommend using the posted workaround. Use the "de-threader" instead.

The de-threader is in the Wiki, article name "MIDI and Timers". (Shouldn't this be in the official documentation ?)

My failed workaround is okay for the actual data, but not for the triggers which should be sent further down the code.


Sorry if this thread has been the cause of confusion / additional trouble.


Explanation:

I faced a similar problem earlier in my code for converting a Bool to an Int
(once again, using the selector instead of simply connecting the bool to an int "solved" it.)
After having done so, there was no need for the workaround that occured later in the code.
But, even with the workaround, I still had issues when using an external MIDI keyboard (but not PC keyboard, strangely)
SM would crash very often when I would connect basic elements deep in the code, trying to see if the data was changing as it should, making analysis very difficult. Still managed to find triggers were not being sent properly when using an external MIDI keyboard.
Inserting a de-threader solved everything. Many thanks to whoever posted that article in the wiki.

SM made me lose my hair ;)
User avatar
JIftw
essemer
 
Posts: 46
Joined: Tue Mar 16, 2010 11:19 am

Re: Delayed comparison workaround [FAIL]

Postby MyCo on Sat May 01, 2010 3:54 am

you should keep an eye on the trigger flow. You shouldn't search for workarounds, instead you should fix your trigger issues.
Some of my SynthMaker examples: TranceDrive, LoopDrive
or go directly to my Blog
User avatar
MyCo
smaniac
 
Posts: 1016
Joined: Mon Dec 19, 2005 1:43 am
Location: Germany


Return to Examples

Who is online

Users browsing this forum: No registered users and 0 guests