Jump to content
IGNORED

Sync options for USB-MIDI -> nanoloop/PO-12


Recommended Posts

Alright, so I want to synchronise my OP-1 with nanoloop/PO-12, *without* using a computer or tablet of some kind. I'm not keen on the idea of buying the Oplab just for this purpose, but am considering it since there doesn't seem to be anything else on the market with similar features.

 

I have an arduino duemillanove that I have had sitting around for years, and understand that I may be able to achieve this goal using a USB host shield, but can't seem to find the correct terms to search for in order to find tutorials.. everything I've found so far is for USB-MIDI to DIN-MIDI only, which is *almost* there, just not quite. Or DIN-MIDI to sync pulses, which again, is missing a key part of the process. I'm sure they could be combined but I'm not quite sure how to do that.

 

Ideally, I'd like to even be able to use nanoloop as master, since it's constantly sending sync pulses, but if that's not possible then using OP-1 as the host is fine.

 

 

Anyone?

Link to comment
https://forum.watmm.com/topic/90050-sync-options-for-usb-midi-nanolooppo-12/
Share on other sites

I think there is a Kenton usb host that will hook up the OP-1 to midi din and then add a Volca Sample (bear with me :) ) which will take mid din and sync the PO-12, leaving you the output of the PO-12 to link with Nanoloop. I'm assuming Nanoloop is synced with a mini jack???

 

Reading your post more it would probably be easy to just reverse the chain and set the devices to a suitable midi mode to work.

 

I'm also wondering if maybe either the audioconnect midi interfaces work standalone or that new Roland sync box would do it but that's more than an OP-lab costs. I use an ipad and usb hub with cheap usb midi ports to sync my hardware. An app called midibridge allows you to store various configurations and makes things easy and flexible. I know you stated no tablets but imo it is probably the best solution.

Perhaps, but I also don't have an ipad.. and also don't have any other use for an ipad in my setup.

 

There's merit in the Kenton setup, since there is apparently a way to get nanoloop to send/receive midi-compatible data, I just haven't been able to wire the plug up correctly so can't test it (either that or it just doesn't work). Nanoloop sends/receives sync pulses through the EXT port.

 

Also, I'm wondering if the Kenton box works with tempo/sync data, since it seems designed mostly for using USB MIDI keyboards with older gear. Also, if it's able to filter MIDI information so that it's just the sync pulses, and none of the note data from the OP-1. I guess I'll have to look into it.

 

Thing is, I *know* it's possible with arduino with a USB host shield, I just can't seem to find any information to get me started.

sorry for the useless post, i just read the PO-manuals PDF and didnt knew there is no Midi connector

Edited by Test Fforet

so what you want to do is:

- listen to sync pulses from the PO12 with an Arduino input

- send MIDI clock to the OP1 over USB MIDI?

 

I haven't got the USB-Host Shield, but it looks like with this library you get a relatively easy USB MIDI connection:

https://github.com/YuuichiAkagawa/USBH_MIDI

 

If I get this right, the steps you need to do are basically:

- detect the sync pulse, which is just a pulse, should be easy enough

- calculate how often you gotta send MIDI clock bytes: there's 24 clock ticks per quarter note, how many sync pulses per quarter does the PO send?

- send MIDI clock bytes using the USB MIDI library in the correct interval, something like:

static uint8_t clock = 0xF8;
SendData(&clock, 0); // dunno. how does the library know how much data it should send? Does it infer this from the message? Then this could should be ok.
dunno how the PO sends start/continue/stop, but on the MIDI side it's just FA/FB/FC instead of F8...

 

let me know about your progressions, this is interesting! Didn't know there was a host shield for the Arduino :)

Edited by Guest

Yeah I'll look into it for sure. I'm not sure about sync resolution or what I'd be trying to sync (most likely nanoloop which is I think 12ppqn).

 

..buuuut it'll have to wait since I've got a bunch of other projects on the go so may be a while heh.

hey I'm just now messing around with a Raspberry PI, doing some USB-MIDI Sysex stuff...

 

the rPI might be an easy solution for you imo.

basically, just get a rPI.

install minimal Raspbian.

install puredata.

make a simple PD patch which takes clock from USB-MIDI and sends clicks out the audio jack.

(or do it with C++ and ALSA if you feel like it)

make the PD patch start when the PI boots up.

connect OP-1 to USB, connect PO to audiojack. done.

Edited by Guest

the following thing provides tight AF sync pulse from one GPIO pin. :)

need to solder a connector of course...

 

#include <bcm2835.h>
#include <stdio.h>
#include <alsa/asoundlib.h>

// Blinks on RPi Plug P1 pin 11 (which is GPIO pin 17)
#define PIN RPI_GPIO_P1_11
int main(int argc, char **argv)
{
	if(argc != 2)
	{
		printf("must define hardware midi port, e.g. \"sync hw:1,0,0\"\n");
		return 1;
	}
		
    snd_rawmidi_t* midiin;
    const char* portname = argv[1];
	snd_rawmidi_open(&midiin, NULL, portname, SND_RAWMIDI_SYNC);
	snd_rawmidi_read(midiin, NULL, 0);
	
    if (!bcm2835_init())
      return 1;

    bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP);
    
    while (1)
    {
		uint8_t readByte;
		snd_rawmidi_read(midiin, &readByte, 1);
		static unsigned long cnt = 0;
		switch(readByte)
		{
			case 0xFA:
			{
				cnt = 0;
				break;
			}
			case 0xF8:
			{
				if(cnt % 6 == 0)
				{
			        bcm2835_gpio_write(PIN, HIGH);
			        bcm2835_delay(1);
			        bcm2835_gpio_write(PIN, LOW);
				}
				cnt++;
				break;
			}
			default:
				break;
		}
    }
    bcm2835_close();
    return 0;
}

 

 

you'll need that bcm2835 library to speak to the IO pins:

http://www.airspayce.com/mikem/bcm2835/index.html

(follow instructions to install & setup)

 

also need the asound library:

 

sudo apt-get install libasound2-dev

 

then compile that program:

 

gcc -o sync sync.c -lbcm2835 -lasound

 

run:

 

./sync hw:1,0,0

 

the "hw:1,0,0" is the identifier of your USB-MIDI device which you want to use as clock source.

may be different on your PI, but this is what it looks like when I connect an Analog Rytm:

 

 

pi@void ~/gpiosync/gpiosync % amidi -l
Dir Device    Name
IO  hw:1,0,0  Elektron Analog Rytm MIDI 1

Awesome, thanks! I'll probably ask a million questions because I'm also largely unfamiliar with linux, but it's a start!

  • 5 weeks later...

basically just install the Raspbian Lite OS.

you don't even need an extra keyboard/mouse/screen, best to hook up the pi to your router and setup via network/ssh.

e.g.: https://www.raspberrypi.org/forums/viewtopic.php?t=74176

it's easy, I had no experience with Linux myself.

 

 

I just put this sync thing into a repo:

https://github.com/jpenca/mirg

Edited by Guest

this is off topic but a useful item that eliminates the need of a laptop/ipad as a host:

http://www.modemachines.com/products/catalogue/cerebelusb/

but it's also 99.00 € ........

Edited by sheathe

yeah, it's useful but not for PO/nanoloop sync. I'll probably end up getting one eventually so I can use the op-1 with the monomachine.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   1 Member

×
×