Jump to content
IGNORED

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


modey

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
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

I've just tried this with Puredata.

it sucks.

the patch is simple but you can literally hear the tick jittering around like a mofo.

 

so probably better to use one of the GPIO pins and do it lower level unless you don't care about tight sync.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 5 weeks later...

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.