We are about to switch to a new forum software. Until then we have removed the registration on this forum.
working on a sequencer couldnt find a decent method for BPM so i used a simple method.
ZVmod=200 tan(radians(tan(radians(87cos(radians(millis()0.180)) ))sin(radians(millis()*0.180)) )) ;
by dividing millis() using *0.180 = 1000 * 0.180 = 180 deg inside sin cos etc this produces 60BPM at each 1 sec. 0.36 = 120BPM = 360 deg 0.70 = 240BPM = 720 deg
the equation above produces a saw triangle + - wave. tangent is only effective at about 87 deg so not perfect before it goes off the scale.
60BPM ramp triangle wave equation.
ZVmod=200 tan(radians(tan(radians(80cos(radians(millis()0.180)) ))sin(radians(millis()*0.180)) )) ;
positive negative 60BPM triangle wave.
ZVmod=200 sin(radians(tan(radians(60sin(radians(millis()0.180)) ))sin(radians(millis()0.180)) )); ZVmod=200 *-sin(radians(tan(radians(60sin(radians(millis()0.180)) ))sin(radians(millis()*0.180)) ));
Sharp Triangle 60BPM wave.
ZVmod=200 -sin(radians(tan(radians(60sin(radians(millis()*0.180)) )) ));
my BPM counter said 30BPM on this but thats because its + - i only tested one direction.
Simple ramp pulse 60BPM
ZVmod=200 -sin(radians(tan(radians(millis()0.180)) )) ;
basically this is how you implement easy waves using sin cos tan.
i just tried to view this on opera and it missed out some of the ******* in the equation????? why does this forum never post correctly?????
Comments
Can you explain what BPM is?
To format your code, please visit the following link: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text#latest
In a nutshell, edit your post, select your code and hit ctrl+o.
Kf
@kfrajer -- I think that here BMP is "beats per minute" -- so counting audio pulses to establish the rhythm using triangle / ramp / saw waves.