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

Sync to external MIDI #182

Open
ajtribick opened this issue Jun 10, 2019 · 11 comments
Open

Sync to external MIDI #182

ajtribick opened this issue Jun 10, 2019 · 11 comments

Comments

@ajtribick
Copy link
Contributor

Is there a guide to setting up FoxDot+SuperCollider to synchronise with external MIDI? I see there is a sync_to_midi method on the Clock object but this ended up being unusable - I think it was missing some of the beats and ending up randomly slowing down by factors of 2 or so as a result.

@Qirky
Copy link
Owner

Qirky commented Jun 10, 2019

sync_to_midi is a non-reliable way of synchronising to an external midi clock device. There is some information available about synchronising with a midi device being triggered from FoxDot https://foxdot.org/documentation/setting-up-midi/

@ajtribick
Copy link
Contributor Author

Thanks for that. I was trying to go the other way, i.e. use the external MIDI source to drive the FoxDot clock. What would be necessary for a more reliable sync than sync_to_midi?

@Qirky
Copy link
Owner

Qirky commented Jun 19, 2019

It isn't properly documented but in theory if you install the rtmidi library and the Python wrapper library then using Clock.sync_to_midi() will look for a midi-in device and clock/beat values then update the FoxDot clock.

I don't have a MIDI device to test this with and the FoxDot clock has undergone several changes since the sync_to_midi function/classes were written so I'm not sure it would work right now. I can have a look at updating it but it isn't a high priority at the moment.

If you don't mind keeping a constant bpm I would set both your MIDI device and FoxDot to the same tempo and then change the Clock.nudge value to adjust FoxDot's down beat to sync up with your device.

@toboko
Copy link

toboko commented Dec 18, 2019

I read the Midi.py file and It's almost done like tempo but I personally think that main feature to implement is the sync between start and stop on external midi devices.
It would be great if from my MIDI board I could start or stop in sync FoxDot + External Device.
I've found that in Supercollider it's super easy to handle this events with (reference from MIDIIn.sysrt)

(
// init and connect your device
MIDIClient.init;
MIDIIn.connect(1, MIDIClient.sources[0]);
// call event 
MIDIIn.sysrt = {
   arg uid, index, data;
   if (index == 10) {
      "Start".postln;
   } { };
   if (index == 12) {
      "Stop".postln;
   }
})

I would like to improve your code but I need more references about FoxDot's flow

@tuborgman
Copy link

Hi there! Any news on handling MIDI sync to external MIDI or sync external MIDI gear to Foxdot ? That would be really uselful..

@Qirky
Copy link
Owner

Qirky commented Mar 28, 2020

Afraid not, I haven't been working on the project a whole lot to be honest, and I don't have any MIDI devices I could use to develop this feature

@joesh1
Copy link

joesh1 commented Sep 9, 2020

Same here Ryan.

I've tried sending the midiclock out, but it doesn't work - not unless I'm doing something wrong. FoxDot happily send notes to my external synth (a DS Rev2) which works fine, but there's not clock sync, so it just happily plays away at another tempo - other than the one FoxDot is playing/using.

@Bubobubobubobubo
Copy link

Bump for this issue. Has anyone been able to get MIDI sync or Link sync?

@tkna91
Copy link

tkna91 commented Apr 7, 2024

It appears that rtmidi cannot be expected to have synchronization capabilities, since the rtmidi page https://www.music.mcgill.ca/~gary/rtmidi/ states this.

RtMidi does not provide timing functionality (i.e., output messages are sent immediately).

However, I wish the receiver (e.g., REAPER or other DAW) could synchronize the tempo, not foxdot, to facilitate editing of MIDI and audio input to the DAW with foxdot. Is it not possible to do that as well?

@tkna91
Copy link

tkna91 commented Apr 7, 2024

FoxDot has its own sequencer without MIDI clocking, based on very fine sleep loops, so they are currently not possible?
Perhaps SuperCollider is the synthesizer part, but not the sequencer part, and therefore MIDI to/from other DAWs, etc. is meaningless as far as MIDI clocking is concerned?

@tkna91
Copy link

tkna91 commented Apr 10, 2024

It seems to be possible, although some minor adjustments may be necessary.

Screencast with audio:

20240410-175624_screencast-audioin.mp4

Environment:

  • OS: Arch Linux x86_64
  • Kernel: 6.8.2-arch2-1
  • WM: sway
  • foxdot 0.8.12-3
  • PYENV_VERSION=3.10.13
  • python-rtmidi 1.5.8-1
  • reaper 7.12-1
  • pipewire-jack 1:1.0.4-3
  • pipewire 1:1.0.4-3

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

No branches or pull requests

7 participants