sebiiksbcs Posted April 1, 2008 Report Share Posted April 1, 2008 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 ) Quote Link to comment Share on other sites More sharing options...
sebiiksbcs Posted April 1, 2008 Author Report Share Posted April 1, 2008 Forgot to mention an approach I found in the web, using Arduino and Max/MSP. No detailed explanations though:http://web.media.mit.edu/~adamb/patchbay.htmlBut that guy created an interface between an existing ARP 2600 patchbay and Csound, which is roughly comparable to what I want to do... Quote Link to comment Share on other sites More sharing options...
Screaming_Rabbit Posted April 1, 2008 Report Share Posted April 1, 2008 Forgot to mention... please use the EDIT feature in future and extend the first posting, if no one posted an answer already.Thank youRoger Quote Link to comment Share on other sites More sharing options...
nILS Posted April 1, 2008 Report Share Posted April 1, 2008 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. Quote Link to comment Share on other sites More sharing options...
sebiiksbcs Posted April 2, 2008 Author Report Share Posted April 2, 2008 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: Quote Link to comment Share on other sites More sharing options...
DrBunsen Posted April 2, 2008 Report Share Posted April 2, 2008 If you're not totally hooked on the idea of real cables, you could have a look at the implementation of the modulation matrix in the MIDIbox SID Quote Link to comment Share on other sites More sharing options...
sebiiksbcs Posted April 2, 2008 Author Report Share Posted April 2, 2008 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! Quote Link to comment Share on other sites More sharing options...
nILS Posted April 5, 2008 Report Share Posted April 5, 2008 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. Quote Link to comment Share on other sites More sharing options...
DrBunsen Posted April 6, 2008 Report Share Posted April 6, 2008 But when you have more than one cable, how does it know which is which ??? Quote Link to comment Share on other sites More sharing options...
nILS Posted April 7, 2008 Report Share Posted April 7, 2008 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 * doneWorking really good for me. And it's fun. Only thing I'm wondering now is - how could I use this ;DDrBunsen: Does that answer you question? Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 7, 2008 Report Share Posted April 7, 2008 Just to throw a spanner in the works, may I suggest a VCS3 style patchbay? It's more flexible, cheaper, and easier to implement.... Quote Link to comment Share on other sites More sharing options...
nILS Posted April 7, 2008 Report Share Posted April 7, 2008 Yes, you may, but I thought the point was to have cables :-) Besides "easy to implement" I believe what I suggested is pretty simple, right? Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 7, 2008 Report Share Posted April 7, 2008 Sorry I thought the point was to have a patchbay :) As you guys all know by now, I'm a function-over-form guy....Yes, what you said is simple, but it's not as simple as using the existing scan matrix code ;) Quote Link to comment Share on other sites More sharing options...
/tilted/ Posted April 20, 2008 Report Share Posted April 20, 2008 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 + Out2In2 -> Out1 + Out3Without diodes, this would register a connection between In1 and Out3 and In2 and Out2because of links from other cables.The cables complete the connection between ins and outs, as a switch would ordinarily. Quote Link to comment Share on other sites More sharing options...
nILS Posted April 20, 2008 Report Share Posted April 20, 2008 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 Quote Link to comment Share on other sites More sharing options...
/tilted/ Posted April 20, 2008 Report Share Posted April 20, 2008 but surely with a patchbay, the entire point is to connect inputs to outputs...you could still connect inputs to inputs, or outputs to outputs, but you'd need at least one input and one output for a patch to be scanned correctly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.