Jump to content

Guitar FX switcher with MidiBox


flo
 Share

Recommended Posts

  • 2 weeks later...
  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Ah, I found it, I guess, on SVN:

http://svnmios.midibox.org

[/] [trunk/] [apps/] [controllers/] [midibox_mm/] [src/] [mm_vpot.c]

MIOS_DOUT_SRSet(LEDRINGS_SR_CATHODES, cathode_patterns[sr_ctr]);

[/] [trunk/] [apps/] [controllers/] [midibox_mm/] [src/] [main.h]

// NOTE2: the shift registers are counted from zero here, means: 0 is the first shift register, 1 the second...

#define LEDRINGS_SR_CATHODES 8 // shift register with cathodes of the 8 LED rings

It's just too simple... ;)

------------------

So I can set all 8 pins of the first of the 4 ShiftRegisters of my DOUT module at once to the bit-pattern of the value of a Midi CC message with:

MIOS_DOUT_SRSet( 0, envt2 );

like this:

/////////////////////////////////////////////////////////////////////////////////

// function: MPROC_NotifyReceivedEvnt

//

// This function is called by MIOS when a complete MIDI event has been received.

//

// Parameters:

//  unsigned char evnt0 [in] First MIDI event byte.

//    => Midi CC messages on channel 16 are supported. evnt0 = 0xBF.

//  unsigned char evnt1 [in] Second MIDI event byte in.

//    => Midi CC number: The "bank" of 7 FX loopers that is adressed. evnt1 = [0, 15].

//  unsigned char evnt2 [in] Third MIDI event byte in.

//    => Midi CC value: The bypass state of the 7 FX loopers (enabled/disabled).

//      Each bit controls the state of one FX looper. Bits [0, 6] are used for the 7 FX loopers.

/////////////////////////////////////////////////////////////////////////////////

void MPROC_NotifyReceivedEvnt( unsigned char evnt0, unsigned char evnt1, unsigned char evnt2 ) __wparam

{

  // evnt0 => Midi CC messages on channel 16 are supported. evnt0 = 0xBF.

  // Midi CC message (1011) on channel 16 (1111) => evnt0 = 1011 1111 = 0xBF

  if( evnt0 != 0xBF )

  {

    return;

  }

  // evnt1 = [0, 15].

  if( evnt1 > 15 )

  {

    return;

  }

  // evnt1 => Midi CC number: The "bank" of 7 FX loopers that is adressed.

  // evnt2 => Midi CC value: The bypass state of the 7 FX loopers (enabled/disabled).

  // Each bit controls the state of one FX looper. Bits [0, 6] are used for the 7 FX loopers.

  MIOS_DOUT_SRSet( evnt1, envt2 );

}

Link to comment
Share on other sites

Indeed. ;D

I did find that function list but sometimes there just is not enough information.

Example:

http://www.ucapps.de/cmios_fun.html#MIOS_DOUT_SRSet

MIOS_DOUT_SRSet

C_DECLARATION void MIOS_DOUT_SRSet(unsigned char sr, unsigned char sr_value)

DESCRIPTION sets value of DOUT shift register

C_IN number of shift register in <sr>

value in <sr_value>

C_IN does not state that the DOUT shift register numbers are zero-based nor does the DOUT documentation in:

http://www.ucapps.de/mbhp_dout.html, which is very hardware orientated.

I had to dig around in SVN to find a note about it that confirmed my assumption:

[/] [trunk/] [apps/] [controllers/] [midibox_mm/] [src/] [main.h]

// NOTE2: the shift registers are counted from zero here, means: 0 is the first shift register, 1 the second...

Also, there is no reference that MIOS_DOUT_SRSet depends on:

MIOS_SRIO_NumberSet(...), being called as initialisation before using DOUT module.

But I think that it does...

Perhaps using the DOUT module is explained somewhere in more detail with documentation and examples but I could not find this.

For a newbie like me that makes the leaning curve just a bit steeper.

Link to comment
Share on other sites

I had to dig around in SVN to find a note about it that confirmed my assumption:

Or you could have just searched the wiki ;)

Counting from 0 is the norm though...

Also, there is no reference that MIOS_DOUT_SRSet depends on:

MIOS_SRIO_NumberSet(...), being called as initialisation before using DOUT module.

But I think that it does...

Perhaps using the DOUT module is explained somewhere in more detail with documentation and examples but I could not find this.

You always need to use this function when using DOUTs, and that is explained in the programming examples which are found on the ucapps.de download page and the C page too.

Moral of the story: search ;)

Link to comment
Share on other sites

@Durisian: Yes, nice, exactly what I had in mind to implement for the FX loopers in a series chain. Thanks!

Do you mind if I use this on my user page as a "preliminary" schematics? 

http://www.midibox.org/dokuwiki/flo

I will reference you as the name of course.

Did you also add indicator LEDs?

Also:

The relays need to be connected so that, in rest / not powered, they do not bypass the FX. This way when something goes wrong and power is removed, the FX are not bypassed and still can be manually switched.

Link to comment
Share on other sites

Hi Flo..I'm trying to build almost the same system..

if you want to see even other solutions for the relais..you may look at this schematic on my topic:

http://www.midibox.org/forum/index.php/topic,11849.15.html

this schematic should avoid relais clicks..and you can power with the 5v from the module (if you use 5v relais).. There's also the status led..  ;)

Dimitri

Link to comment
Share on other sites

@Dimitree: Thanks for that schematic link.

+1 for the english explanation. :)

It's probably something like this:

IC OUT = DOUT module output pin or some output pin from the CORE like the J5 header.

The relay-coil is put between R+ and R-.

When IC OUT goes ON, the gate-source voltage is positive and the FET BS170 is switched on. This pulls the drain and R- to ground.

The relay-coil will now conduct current because there is ~5V across it and the relay is switched on.

The "diode" on the left in series with the resistance (~5k or something) between 5V/R+ and R- is actually the indicator LED which now lights-up.

When IC OUT goes OFF, the gate-source voltage is 0V and the FET BS170 is switched off. This will let the drain and R- be pulled up to 5V again.

The relays will be switched off and the indicator LED will not light-up anymore.

BA159GP is the protection diode that takes care of the induction current that occurs when the relay is switched off.

Link to comment
Share on other sites

yes..it works like you said flo.. R+ and R- is the relay..IC OUT is one of the out pin on the 74HC595, so you need a circuit like this for every relay..unfortunately.. Diode + resistor is the LED, the BA159GP is an ultrafast diode, for protection.. The 300k resistor should avoid clicks when you switch..

Can the ULN2803 replace almost all these parts? if yes, I'd use the ULN2803.. Or we could combine the 2 circuits?

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