Jump to content

Patchbay for Softsynth?


sebiiksbcs
 Share

Recommended Posts

Hi,

I am thinking about building a hardware patchbay as found on vintage analog synths like http://www.sequencer.de/pix/arp/arp2600.jpg, but sending MIDI events via MBHP.

My idea could be comparable to the MS-20 legacy MIDI controller I guess. I would like to use the controller to virtually patch my slowly growing, "all-modulatable" Csound synth (ÃŽt is called Fatma, by the way).

So as I am OK at Csound but baaad at MIOS, I need a starting point: connections of real cables could invoke DIN events, right? But then, how can I implement the function which output exactly gets connected to which input?

Could I invoke one DIN event, for example ADSR1 out, by just closing the circuit with the cable just like with a push switch, then let MIOS wait for a second DIN event, which would be for example VCA1 in, and  send a certain CC message after the second circuit is closed?

I hope you get what I mean.

(How the CC messages are interpreted by Csound is not the problem, that's very customizable. I just need the MIOS andd hardware part )

Link to comment
Share on other sites

connections of real cables could invoke DIN events, right?

As a switch does exactly the same as thing (opening/closing a circuit): yes.

Could I invoke one DIN event, for example ADSR1 out, by just closing the circuit with the cable just like with a push switch, then let MIOS wait for a second DIN event, which would be for example VCA1 in, and  send a certain CC message after the second circuit is closed?

I don't really now what you mean by "waiting for a second event", but: yes.

Link to comment
Share on other sites

I think that to make clear to MIOS which connection goes where, one could let MIOS work in DIN pairs. For one DIN event is received, MIOS waits for a second one (which would come from the connection of the other end of the cable), and after the pair of DIN events is received, sends an according MIDI message.

That is my idea of realizing it, but i am sure there are smarter methods.

Look at the pic i made:

mios patchbay_thumb.png

2454_mios_patchbay_png947bd4134e4fb80fb9

Link to comment
Share on other sites

I considered rather than working out the MIDI-patch cable thing I should just build a real analog synth myself!

Maybe the mod matrix is a good way to go. I wonder, does it work also in a, say 12 x 12 matrix or so?

Gonna learn MIOS and C, should be more intuitive than Csound:

...

CSound is pretty hardcore, though there is nothing in synthesis that can't be done, (eventually), with it.

...

Warning:- steep learning curve ahead!

Link to comment
Share on other sites

I fiddled around with the idea a bit and found it to be really easy and fun :-)

Basically, all you need is some sockets and cross over cables - connect one pin to GND and one to a SR. Now, if you plug in one side of a cable nothing happes. As soon as you plug in the other end of the cable you'll get 2 DIN event quasi simultaneously. I'll post the source when I get back home on Sunday.

Link to comment
Share on other sites

That's the original post, which I couldn't post a couple of days back when the forum was down a lot:

As I always like the idea of patch cables, I just did some tests with it.

Basically you hook the sockets up to GND and a DIN pin. You'll need cross-over cables for this though - when you plug in one side of a cable nothing happens. When you plug in the other side, you're closing 2 switches rather rapidly, invoking 2 DIN_NotifyToggle. Same for unplugging a cable - you get 2 DIN_NotifyToggle.

Set up some vars:

unsigned char tick, count, one;
"tick" is the internal timer that counts the "ticks" between two DIN events. "count" counts the number of events in a pair, so it's either 0 (no event yet) or 1 (one connection has been closed). "one" just stores the pin of the first event so we know which pair has been connected. What I did is I set up the timer to something rather slow:
MIOS_TIMER_Init(0x03, 65535);
The timer function increments a small helper variable:
void Timer(void) __wparam
{
  tick++;
}[/code] Finally the DIN event handler:
[code]void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam
{
if (pin_value == 0) {
// something was put in
if (count == 0) {
// and it was the first one
tick = 0;
count = 1;
one = pin;
} else
if (tick < 10) {
// good one
MIOS_LCD_Clear();
MIOS_LCD_CursorSet(0x00);
MIOS_LCD_PrintCString("+ ");
MIOS_LCD_PrintBCD2(one);
MIOS_LCD_PrintCString(" ");
MIOS_LCD_PrintBCD2(pin);

// reset
count = 0;
}
} else {
// something was removed
if (count == 0) {
// and it was the first one
tick = 0;
count = 1;
one = pin;
} else
if (tick < 10) {
// good one
MIOS_LCD_Clear();
MIOS_LCD_CursorSet(0x00);
MIOS_LCD_PrintCString("- ");
MIOS_LCD_PrintBCD2(one);
MIOS_LCD_PrintCString(" ");
MIOS_LCD_PrintBCD2(pin);

// reset
count = 0;
}
}
}

All it really does is:

* check if the button is pressed or depressed (basically does the same thing for both, so I'll only go into detail for the "pressed" part)

* check if "count" is 0 which means this is the first event, if so

* increment count, memorize the pin number and reset the tick

* if count == 1 then it's the second button IF the tick (which is incremented by the timer) is < 10 (basically some nasty debouncing to allow regular buttons to be used along with the patch field)

* second button means: we've got a connection. Display that on the LCD, reset the count

* done

Working really good for me. And it's fun. Only thing I'm wondering now is - how could I use this ;D

DrBunsen: Does that answer you question?

Link to comment
Share on other sites

  • 2 weeks later...

You could use the scan matrix code with cables.

The trick is to use the cables themselves to act as the switches, rather than placing switches on the sockets.

Assuming you have designated ins and outs (which you do, as this is a patchbay...)

For each patch input, assign a connector (banana sockets would work well) and a DIN pin 0 -x.

For each patch output, assign a connector and a DOUT pin 0-y.

Implement the scan matrix for an [x,y] matrix.

Now you use the patch cables to connect ins to outs as needed If you use banana sockets, you can connect one-to-many or many-to-one simply by piggybacking. You might need to use series diodes in the cable if you wanted to combine one-to-many and many-to-one, ie:

In1 -> Out1 + Out2

In2 -> Out1 + Out3

Without diodes, this would register a connection between

In1 and Out3 and

In2 and Out2

because of links from other cables.

The cables complete the connection between ins and outs, as a switch would ordinarily.

Link to comment
Share on other sites

What you describe is certainly easier, but it does not allow random patching (which might not be necessary in most applications). By "random patching" I mean being able to connect *any* pair of sockets. So there's no difference between inputs and outputs which makes the whole thing a lot more flexibel. You could use a bay with 16 sockets it as a 4->12 or 8->8 ... ;D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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

Loading...
 Share

×
×
  • Create New...