Jump to content

putting encoders to ain64_din128_dout128_v2b application


axiomriddler
 Share

Recommended Posts

add to main.c

MIOS_ENC_TABLE {
             // sr pin mode
  MIOS_ENC_ENTRY(1, 0, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_ENTRY(1, 2, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_EOT
};
change Makefile.orig
# pass parameters to MIOS wrapper
MIOS_WRAPPER_DEFINES = -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE 

Link to comment
Share on other sites

err,

does this app care about encoders at all? the name at least contains explicitly ain, din and dout, no encoders there.

--  just looked into the source and the corresponding function is empty, so no encoders :(

you could try "enc_speed_v1b" under troubleshooting instead, to test the encoders. still you have to setup the encoders in mios_enc_table.inc. what spongebob suggested works in C-Apps only, this one is in assembler.

which application do you want to use in the end?

--- oh, i should read more carefully ^^

so you want to adapt the ain63_din128_... to also handle encoders? mb64e is in assembler, but you can look through the examples in ucapps.de -> MIOS - C Interface. There are some coding examples for encoders.

ok, i hope one of the answers is what you wanted to know  :P

Good Luck :) Alex

Link to comment
Share on other sites

hi, thanks to all..

i don't know if ain64_din128_dout128_v2b application is able to handle encoders with its din or not. that's why i asked 4 that..  :)

what i mean here is to know if ain64_din128_dout128_v2b (with little modifications) can also support 2 encoders. i hope that  i can use (the modified) ain64_din128_dout128_v2b application to handle 64 pots, 124 buttons, + 2 encoders using only 1 core (instead of using 2 cores running midibox64 + midibox64e for the equivalent controls)

fyi, i won't use the douts...

i saw traktorizer's din pin allocation, that's why i ask for that possibility with ain64_din128_dout128_v2b

regards,

anto

Link to comment
Share on other sites

what i mean here is to know if ain64_din128_dout128_v2b (with little modifications) can also support 2 encoders. i hope that  i can use (the modified) ain64_din128_dout128_v2b application to handle 64 pots, 124 buttons, + 2 encoders using only 1 core (instead of using 2 cores running midibox64 + midibox64e for the equivalent controls)

of course

add to main.c


MIOS_ENC_TABLE {
             // sr pin mode
  MIOS_ENC_ENTRY(1, 0, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_ENTRY(1, 2, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_EOT
};
[/code] change Makefile.orig
[code]
# pass parameters to MIOS wrapper
MIOS_WRAPPER_DEFINES = -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE
thats correct - in addition, the ENC_NotifyChange() has to be enhanced, so that MIDI events are sent on encoder movements. E.g.:

void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam
{
  MIOS_MIDI_TxBufferPut(0xb0);           // CC at MIDI Channel #1
  MIOS_MIDI_TxBufferPut(0x10 + encoder); // CC# is 0x10 (16) for first encoder
  MIOS_MIDI_TxBufferPut((0x40 + incrementer) & 0x7f);
  // this "40 +/- speed" format is used by NI software and some others
}
[/code]

to send relative CC events (will work fine with Traktor)

Best Regards, Thorsten.

Link to comment
Share on other sites

geee..thanks heaps mr. thorsten  :)

it's very revealing..where should i put those lines? how should i write for that? i mean to use the last 4 dins of shift register IC 8 for the 2 encoders...

/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when an encoder has been moved
// incrementer is positive when encoder has been turned clockwise, else
// it is negative
/////////////////////////////////////////////////////////////////////////////
MIOS_ENC_TABLE {
             // sr pin mode
  MIOS_ENC_ENTRY(8, 4, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_ENTRY(8, 6, MIOS_ENC_MODE_NON_DETENTED),
  MIOS_ENC_EOT
};
void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam
{
  MIOS_MIDI_TxBufferPut(0xb0);           // CC at MIDI Channel #1
  MIOS_MIDI_TxBufferPut(0x10 + encoder); // CC# is 0x10 (16) for first encoder
  MIOS_MIDI_TxBufferPut((0x40 + incrementer) & 0x7f);
  // this "40 +/- speed" format is used by NI software and some others
}

is that right if i write it there that way?  ??? any wrong syntax?

regards,

anto

Link to comment
Share on other sites

  • 3 weeks later...

maybe you should take a good look into the "whole code" first before rewriting it ;-)

Anyway: MIOS_ENC_TABLE has to be placed into main.c. it defines the type of your encoders and where you connected it.

define the entries as they are described under \include\asm\mios_enc_table.inc

after that we have to modify the make.orig file in order not to include mios_enc_table.inc during compiling process (can somebody tell me why i cant use that file?). Tk described that two post above mine.

at last you have to "modify ENC_NotifyChange in main.c

search for the funktion, its is allready defined, but the body does not contain any code yet.

fill inside the lower code between the curly brackets you posted.

Greetings

Nasrudin

Link to comment
Share on other sites

  • 2 weeks later...

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