[Help the noob!] - Convert Midi ppq to LFO frequency


#1

Hello!

I recently got my Axoloti, but I must say I am a bit lost. I mean, i can handle the software and the connections, and the device is running perfectly. But i do not exactly have a mathematical mind :smile:

My goal is mainly to create a multiFX with the Axoloti for an external drum machine. I thought that creating a simple gater, synced to the MIDI, would be a simple thing for my first steps. But the math are the problem : i just don't know how to convert the Midi ppq to feed a a square LFO, and cut the sound 2, 4 or 8 time each measure.

Could someone guide me with the logical it needs to be done? I'm (almost) sure I will then be able to find the right objects to do it and post the result here!

(I looked accross the forum, but I don't think someone already posted or used this in a patch).

Cheers!
yan


#2

You probably don't need an LFO if you want to sync to midi. There's a midi/in/clock object you can combine with math/divremc to sync a sequencer to the clock. All black squares in the sequencer object will trigger the envelope in this case.


#3

Thanks a lot, Jan! I found the Midi object, but i didn't know how to use it's output :smile:
You are right an enveloppe may be easier to use in this case. I will give it a try.


#4

So i tried your idea, but using an enveloppe didn't sound exactly like I wanted. I guess it could work with more tweak, and i will surely try. But for now I used a square LFO.

But i'm still trying to convert the pulses from the midi clock to get the BPM of the song. In my little patch, i have set by hand the LFO to 2,76Hz... impossible to set it to 2,75Hz by hand, which would correspond to the 165BPM of the track i'm feeding in audio and midi. Would be great if I could adjust the LFO rate from the BPM of the track (using Hz = BPM / 60).

I'm sorry, i'm really not a math guy and I can't a way to do it on my own :worried:
If anyone could give more hints, this would be much appreciated. No needs to make the full patch for me, i can try to do it myself if i can get the logic of it.


#5

I don't think you need the LFO at all, if you change from "sel b 16 2t pulse" to "sel b 15 2t".

Alternatively, if you only want a square wave from the midi clock, something like this this should work:
set the first denominator to 12, so you get 2 pulse per quarter note, then the second denominator to 2, so you get only 0 or 1 at the rem output. Then you can patch the rem output directly to the vca, or maybe multiply it by a constant first to set the volume.


#6

Thanks a lot, i will try that! That's typically the kind of reasoning i have some trouble to achieve by myself. I hope it will get better with time :smile:


#7

You could "draw" your LFO with the selector object that uses bipolar bars and smooth the output. This way it will always be in sync?


#8

So many objects I'm not aware of! I will check that too.


#9

I know the feeling :smile:

I forget what the objects are called but it's a selector of some kind. You just need to put some counters or something in front of it to make it run at the speed you want. And to smooth the output you have to use another object, I think it's called "smooth". I haven't tried this but it should work.


#10

I experimented with tempo syncable delay here: https://sebiik.github.io/community.axoloti.com.backup/t/delay-sync-to-midi-clock/979/10?u=jsz

I believe the same method could be used for controlling LFO speed in sync.