MIDI clock - syncronisation

182 views
Skip to first unread message

jur1...@gmail.com

unread,
May 12, 2018, 12:35:26 PM5/12/18
to Lightjams
2 points are clear for me:

I want to have the right BPM on my Master speed slider so that all grids are automaticaly synced to this time  midi.clock.speed  works good to do this


but the next problem is how to sync this tempo automaticaly to Midi Start/Stop ?...so that all effects are in sync. with the Masterbeat starting.....

I have noticed that  midi.clock.beat is automaticaly syncronized when there is a new Midi Start command.....and so it is everytime perfect in sync. to my Keyboardarranger.


The problem: How i can set this syncronisation as Masterspeed??



Mathieu

unread,
May 12, 2018, 2:11:40 PM5/12/18
to Lightjams
A wild guess, since I'm not sure exactly which effects you want to sync with the clock, but if you'd use the midi.clock.sawtooth function, everything would be in sync with the clock. 

For example, if you're generating a sine wave somewhere, instead of using the sin function, you could use map.sin(midi.clock.sawtooth(...)). But then you may have the problem that you don't really want to sync to the clock exactly and you want a slower sine wave or faster, etc. Multiplying the clock is as easy as doing (midi.clock.sawtooth(...) * 2) % 100. But dividing is a bit harder.

The other thing to know is that most generator functions like sin, sawtooth, etc. automatically reset when the grid is deactivated and re-activated. So you could do this reset behavior by linking the activation slider of a grid or group to a MIDI note.

jur1...@gmail.com

unread,
May 12, 2018, 4:10:00 PM5/12/18
to Lightjams
I was just not aware that the grid's automatically reset when it is deactivated and re-activated.....

This should eliminate the problem that occures when I was testing with only a normal grid without starting with MIDI

the problem is a timing problem like when Quantizing a note ........

EXAMPLE:       If the MIDI-Note (command) comes a moment too late the grid becomes an offset

so it would be better to have a generally quantized system that starts the grid without offset

the function midi.clock.beat is everytime syncronized with the timeline an pulses correctly on beat

so the Idea was to have a reference to this value maybe if the grid was opened a little bit to late after the midi.clock.beat-pulse 

the time difference from midi.clock.beat-pulse to the grid opening can used as an value to correct the offset-time.


.....is this possible?




Mathieu

unread,
May 12, 2018, 7:10:10 PM5/12/18
to ligh...@googlegroups.com
To test, you can click the reset time button at the top-right of the grid.

>> If the MIDI-Note (command) comes a moment too late the grid becomes an offset

Does the MIDI note actually come too late? Alternatively, could you send the MIDI note before and use a delay in Lightjams?

jur1...@gmail.com

unread,
May 13, 2018, 2:15:28 AM5/13/18
to Lightjams

I don't think you understood what I'm trying to do....

I'll try to explain it again

The way I work is to change the states in Cantabile with a footswitch.
So it is quite possible that the MIDI impulse is not exactly quantized.

If the impulse comes too early it is not a problem to align the MIDI command with the time grid.

..... but if the command is now too late it is no longer possible to correct this (at most with a time machine;-))

If a Lightjams grid is started too late, e.g. 0.2 s, then the speed is still correct but all events of the grid are 0.2 s too late.


Exaggerated example:

Grid Source: Squarewave1s-on, 1s-off, 1s-on, 1s-off (and so on).....

Now I would send the start-command 1s to late normaly the grid would be at step (off)
But now it starts at the beginning (correct in time) but with (on)

Here it would be handy if you could calculate this offset to the sources on the grid as a phase shift.
Meaning the phase value of all curves should be adjusted here for the offset.

Then the grid would always run correctly configured to the Master beat

midi.clock.beat gives me a real-timeline 1to1 with the arranger-events so is there a way to snap the grids automaticaly on this timeline?

jur1...@gmail.com

unread,
May 13, 2018, 4:36:26 AM5/13/18
to Lightjams
.....but if this way is not possible please tell me how to set a source to activate an intensity in time with the beat


maybe 4 beats and on every first beat the source power 100% for 1 beat

Mathieu

unread,
May 13, 2018, 7:35:50 AM5/13/18
to ligh...@googlegroups.com
To activate on the 1st beat out of 4, you can try:

counter(1,4, midi.clock.beat(1),0, grid.onactivated)==1

If you want to wait to get a beat before activating, you can use:

counter(1,4, midi.clock.beat(1),0, grid.onactivated)==2

jur1...@gmail.com

unread,
May 13, 2018, 10:06:20 AM5/13/18
to Lightjams

thanks.... I am sorry, but that's all to complicate for me 
I didn't understand what happens there


...think I must find an easyer way to sync maybe with Midi commands
with a VST like CC-Stepper sending from Cantabile

Mathieu

unread,
May 13, 2018, 2:00:47 PM5/13/18
to ligh...@googlegroups.com
Here's some info:

counter(1,4, midi.clock.beat(1),0, grid.onactivated)==1

counter(1,4,...): count from 1 to 4

midi.clock.beat(1): increment the counter at each MIDI clock beat

,0,: doesn't decrement ever (may be used for cue list when you want to go backward)

grid.onactivated: reset the counter each time the grid is activated

==1: compare the counter's value to 1 and return 100% if it is 1, otherwise return 0%

jur1...@gmail.com

unread,
May 13, 2018, 4:57:39 PM5/13/18
to Lightjams
Thank you for the info Mathieu....

I will think about it and if it could help......

it is only a problem at a few grids because others work with beat detection and on movingheads and scanners it is no problem
because there is always a fade in or out so a small offset is not to perceptible

only some runninglights that step's exactly with the Beat have this problem if they are powered with square ore random-square
.....



jur1...@gmail.com

unread,
May 13, 2018, 5:57:01 PM5/13/18
to Lightjams
I think the better way for me is to send the timer directly with a midi controller

so you can see with CC-Stepper from Cantabile sendet..... the beat 1  is everytime on Beat 1




timing.PNG

jur1...@gmail.com

unread,
May 14, 2018, 3:59:00 AM5/14/18
to Lightjams
.....think I have it     :-)

I will use your formula but i do the reset not with grid.onactivated
rather with CC-Stepper command on step1 so it allways will be in sync. with the timegrid

....if I have 1 Bar with 4 Beats    .....Beat 1 is then everytime on Beat 1  (and not on 2 or 3)     


xtopercent(counter(2,5,midi.clock.beat(2),0,midi.control(10,6)))



Mathieu

unread,
May 14, 2018, 8:24:41 AM5/14/18
to Lightjams
Looks good! 

jur1...@gmail.com

unread,
May 14, 2018, 9:22:45 AM5/14/18
to Lightjams
xtopercent(counter(2,5,midi.clock.beat(2),0,onbeat(midi.control(10,6))))

....little modification because the sendet controller-value  from CC-Stepper was to long (square) 

but with onbeat it is better

latch(onbeat(midi.control(16,2)), rand()) 
...for sequencer grid-source(x) that randomizes Movinghead  positions ....works great now   :-)

everytime i Start my arranger the Moves and Step-effects are automaticaly perfect in time
.....looks much better now




jur1...@gmail.com

unread,
May 16, 2018, 2:01:15 AM5/16/18
to Lightjams
....so I think it is the easyest way to use the automatic Reset of grids when it opens

now I must not change the grids because they are always in Time to the Masterbeat

it is much easier to work with the 'normal'-Waves in the Grid
TIMER.PNG

Acid Energy

unread,
Jun 13, 2021, 12:03:24 PM6/13/21
to Lightjams
Necromancing this. New to Lightjams, I have to get my head around this and play, so bear with me. I´ll do that.

However, things would be much more accessible if there was an option to sync the LFO (=generator) to MIDI clock in terms of bars, beats, 8th, 16th etc. , just like so many synthesizer and vst Instruments do. Yes one can sync Masterclock to MIDI Clock as far as I understand and can then go nuclear to multiply / divide, but to be honest...  things would be much more accessible if there was a switch to each LFO/generator that would allow to sync or run freely. Outside MIDI clock that could make for beat detection/audio. As long as there is a constant source like in dance music/techno I´d rather think in musical terms than mathematic terms.

This of course is just an impression from someone who just took his first baby steps with Lightjams. I may have missed an existing feature, apologies if I did.

Ryan Shea

unread,
Aug 23, 2021, 3:34:26 PM8/23/21
to Lightjams
Yes this would be so nice!
Reply all
Reply to author
Forward
0 new messages