Trying to make my first object from scratch


#1

Hi,

I've been tinkering with some axo-objects, editing the code and getting results. Now trying from scratch and not really getting to a useable state. It compiles fine, but it does nothing.
It's an object that should pass triggers only for a certain amount of time, and then stop until it gets a reset signal.

I currently have this K-rate Code, the timing is not even implemented yet

outlet_trigger = 0;
if (inlet_trigger > 0) { 
 	count++;
	if (count > maxretrigger) {count = maxretrigger;}
	else if (count <= maxretrigger) {outlet_trigger = 1;}
	}
if (inlet_reset > 0) count = 0;
outlet_count = count;

It's probably very noob/basic but I need some directions to get going...


#2

SOLVED:

this thread helped me get going https://sebiik.github.io/community.axoloti.com.backup/t/coding-axoloti-objects/2606

outlet_trigger = 0;
if ((inlet_trigger > 0) && !ntrig) { 
 	count++;
	if (count > param_maxretrigger) {count = param_maxretrigger;}
	else if (count <= param_maxretrigger) {outlet_trigger = 1;}
	ntrig=1;
	}
else if (!(inlet_trigger>0)) ntrig=0;
if (inlet_reset > 0) count = 0;
outlet_count = count;