Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add midi clock support #710

Merged
merged 7 commits into from Sep 27, 2023
Merged

add midi clock support #710

merged 7 commits into from Sep 27, 2023

Conversation

felixroos
Copy link
Collaborator

@felixroos felixroos commented Sep 27, 2023

fixes #709

usage:

stack(
  s("hh*4"),
  midicmd("clock*48").midi('IAC-Treiber Bus 1')
)

This allows manipulating the clock itself with a pattern :)
Additionally, it will fire a midi start event when the repl is started to make sure the clock is in phase.
On the very first start, it might behave weird when midi is not initialized yet...

edit: adjusted for new syntax

@yaxu
Copy link
Member

yaxu commented Sep 27, 2023

Nice! I have limited experience with midi clock, but did find it can be nice to send midi start more often, say every cycle. Some synths don't like this though. It can also be fun to pattern midi starts.

Superdirt uses a 'midicmd' control to specify the different midi commands. https://tidalcycles.org/docs/configuration/MIDIOSC/midi/#synchronising-midi-clock-via-tidal

This mirrors the supercollider midi api https://doc.sccode.org/Tutorials/A-Practical-Guide/PG_08_Event_Types_and_Parameters.html#MIDI%20output

@felixroos
Copy link
Collaborator Author

Nice! I have limited experience with midi clock, but did find it can be nice to send midi start more often, say every cycle. Some synths don't like this though. It can also be fun to pattern midi starts.

i should've looked at the tidal doc first :) yep that midicmd control sure looks nice! I've changed it to now allow:

stack(
  note("<c eb f g>*2").ply(2).s("gm_acoustic_bass").sub(note(12)),
  midicmd("clock*24*2,<start stop>/2").midi('IAC-Treiber Bus 1')
)

I've added a an alias clock for midiclock, because the namespace seems redundant, as the control is already namespaced...

@felixroos
Copy link
Collaborator Author

I've now adding automated start stop messages on top of it, because at least ableton does not like when the midi clock ends without sending a stop. the start could theoretically be left to the user, but it seems weird to only send the stop.

@felixroos
Copy link
Collaborator Author

ok starting automatically is a good idea, because my keystep will treat a second start message as toggle, so a continuous playback wouldn't be possible without a one time start command

@felixroos felixroos merged commit 527b895 into main Sep 27, 2023
2 checks passed
@felixroos felixroos deleted the midi-clock branch September 27, 2023 20:53
@felixroos felixroos mentioned this pull request Sep 14, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MIDI Clock
2 participants