Help modifying /logic/counter2


#1

Hello!

I want that the counter2 object start at a value different from 0.

I added an int32 parameter named init to choose the position to start from and be able to increase/decrease.

Then I added "count=param_init" at the beginning of the krate code.

I can see the init value when I live the patch but the counter doesn't increase or decrease.

I don't know if it's clear....


#2

Hi,

isn't the counter by @philoop what you're looking for? It has inlets for min and max values.


#3

No.

I just want it to be in a different value by default.

I want to be able to add or substract octaves to my key board notes.
Default will be +0 (i2 on the mux object), then increase ( +12, +24) or decrease


#4

It is working if I put "count=2" in the init code but not with parameter or attribute.


#5

Solved.

I created a variable which is the sum of count + attr_init and modified the code in consequence.

Here's my object to compare with the original:
counter2Perso.axo (1.7 KB)


#6

This is pretty great. Would you be able to make a version with integer inlet? That woul be pretty you useful for me :slight_smile:


#7

Thanks! The integer inlet for the initial position, maximum or both?
I will try tomorrow.


#8

Both would be great :slight_smile: thx


#9

Here it is!

counter2_init_int_input.axo (1.6 KB)