If you have a problem or need to report a bug please email :

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

Schmitt triggers

Post any examples or modules that you want to share here

Re: Schmitt triggers

Postby RJHollins » Fri Jul 29, 2022 6:00 pm


Straight to the toolbox.
Posts: 1539
Joined: Thu Mar 08, 2012 7:58 pm

Re: Schmitt triggers

Postby Tepeix » Sat Jul 30, 2022 12:30 pm

Here's a Tulamide Switch in asm !)

Interesting sound ;) Act as distortion, gate, and a sort of sequencer.. With ton of aliasing !)
Maybe other's use are possible !)

This one is more hard to do.
Maybe it's possible to optimize it further.
This solution need 4 comparison.
Comparing the in and the last in value 2 time.

Also a new Schmith Trigger.
I think this one is the most optimized but not so sure.
It use 1 comparison, 2 andps, and a boolean output.
If you need a boolean this is better.
(in asm seams that it's not possible to declare boolean variable ?)
Tulamide switch.fsm
(44.13 KiB) Downloaded 22 times
Posts: 124
Joined: Sat Oct 16, 2021 3:11 pm

Re: Schmitt triggers

Postby tulamide » Sun Jul 31, 2022 12:51 am

Cool! Thanks a lot. I have no knowledge of Assembler, so I will just assume it's the fastest. But honestly I wouldn't use it for manipulating audio. I could rather think of some transient detection or stuff like that. But there sure are better algorithms for those purposes already. :lol:
If you feel like gifting:
Posts: 2574
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Schmitt triggers

Postby Spogg » Sun Jul 31, 2022 8:59 am

Tepeix wrote:Here's a Tulamide Switch in asm !)

... Also a new Schmith Trigger ...

Clever stuff Tepeix!
User avatar
Posts: 3004
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Schmitt triggers

Postby Tepeix » Sun Jul 31, 2022 6:38 pm

That's a very interesting thing to do in asm !)
Maybe specially because i'm just in the learn of how to compare efficiently in complex logic.

If using only one or some Tulamide Switch, there's not much gain to find optimization.
But i like to imagine a very big amount of switch feeding some neural network that detect pitch or peak...
Héhé maybe that's not possible and there's no utility for large amount..

I find another code but it take just a little more cpu..
But it was interesting..

This one use no classic comparison. But abs and sign.
If y >= x, then sign of y-x is positive.
also max (x,0) could be replaced by x+abs(x) (but it double the result..)
also the output of this one is -0.5 to 0.5..

Code: Select all
streamin in; streamout out;
streamin t; streamin u;
int abs=2147483647;
int sgn=-2147483648;
float n5=0.5;
float a=0; float b=0;
movaps xmm5,n5;
movaps xmm6,sgn;
movaps xmm7,abs;

movaps xmm0,in;
movaps xmm4,xmm0;
subps xmm0,t;
andps xmm0,xmm6;
orps xmm0,xmm5;
//sign - last sign  > positive if last one negative
movaps xmm1,a;
movaps a,xmm0;
subps xmm0,xmm1;
movaps xmm1,xmm0;
//+abs could not be negative
andps xmm1,xmm7;
addps xmm0,xmm1;

addps xmm0,out;
subps xmm4,u;
andps xmm4,xmm6;
orps xmm4,xmm5;
//sign - last sign
movaps xmm1,b;
movaps b,xmm4;
subps xmm4,xmm1;
//-abs could not be positive
movaps xmm1,xmm4;
andps xmm1,xmm7;
subps xmm4,xmm1;
addps xmm0,xmm4;

// "min+max" >  x<0.5 or x>0.5  => x=-0.5 or 0.5
subps xmm0,xmm5;
andps xmm0,xmm6;
orps xmm0,xmm5;

movaps out,xmm0;

I'm happy that this work.. But it take more cpu..
Posts: 124
Joined: Sat Oct 16, 2021 3:11 pm


Return to User Examples

Who is online

Users browsing this forum: No registered users and 6 guests