Akai APC 20 - midi question (LEDS)
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Akai APC 20 - midi question (LEDS)

    by Basic » Mon Dec 19, 2011 5:49 pm

    Hey guys and gals,

    I was hoping to get a little help and to be pointed in the right direction.

    I have mapped my apc20 exactly how i want it and even with buttons to spare! :)

    What i would like to achieve is this... when the apc is connected and switched on it maps certain colors to certain buttons

    So i can essentially see what they are mapped too For example in the pictures below the first image shows the desired effect of when the apc is connected and modul8 is running.

    the green highlights the buttons I have mapped for the clip matrix and the orange highlights the eight different decks i want to map. (Just to mention the colours dont really matter its just so i can have a visible representation of roughly whats mapped) - the other buttons have no been shown as mapped as this is purely an example.

    Image

    So when i start performing and start to press the different buttons it will correlate like so in the red - highlighting what has been pressed and staying a solid colour or even blinking to show whats been pressed.

    Image

    Too achieve this what would people recommend and also is it possible? - I've finally figured out how to map my controller to modul8 but midi still confuses me I'm really struggling with the next step.

    Thanks for your time in reading this.

    Basic :)
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: Akai APC 20 - midi question (LEDS)

    by anomad » Mon Dec 19, 2011 9:31 pm

    Basic wrote:Too achieve this what would people recommend and also is it possible? - I've finally figured out how to map my controller to modul8 but midi still confuses me I'm really struggling with the next step.

    Thanks for your time in reading this.

    Basic :)


    . i've done a little programming on the launchPad - so, I'm guessing they're similar.

    . yes, you can do this - but you're going to have to write a module. :)

    . in your Init() area - use this code to see the MIDI devices modul8 recognizes, and what they're named :

    allMidiDevices = modul8.getMidiDestinationsList()
    print "all midi ", allMidiDevices

    . (use cmd-option-o to see script output, remember to click your module before you reload it...)
    . my launchPad shows up as 'Launchpad - Launchpad', so i set a varibile

    lpName = 'Launchpad - Launchpad'

    . to set the light color, you

    modul8.sendMidi(lpName,1,'NOTE_ON',note,val)

    . this sends a MIDI NOTE_On to the launchpad (defined as lpName above) , channel 1, NOTE_ON, note is the MIDI note for which light I want to turn on. and val is the value i want to send to the launchPad..

    . a quick search finds
    0-off
    1-on green
    2-flashing green
    3-red
    4-f red
    5-orange
    6-f orange

    (from http://www.native-instruments.com/forum ... p?t=134449 )

    . so, figure out the MIDI value of the first button, then send it a val to change the led.

    . good luck!

    -james
    (a nomad. )
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Mon Dec 19, 2011 9:48 pm

    Wow this is amazing. Thank you so much for taking the time and also having a search :)

    I'll get started on this in the next few days then upload it as a module for peeps to download... the work begins :)

    Thanks
    Basic :D
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Wed Feb 01, 2012 12:16 am

    So ive finally started to get this module happening. Ive created the layout and have named the buttons which i want to map first and after this i'll continue with the rest of the module.

    Image
    (Bank 1-8 is for switching between the different media banks)
    (M 1-16 is in relation to the media panel which i want to map)

    Creating the template has been fine and pretty fun. I've been following the instructions of anomad and reading the online module manual and to be honest I've been getting a little lost :( this is a whole new world for me.

    I entered this line of code in the correct place...

    allMidiDevices = modul8.getMidiDestinationsList()
    print "all midi ", allMidiDevices

    I then viewed the code and it showed the APC20 as listed which was great.

    The problem i have at the moment is where do i put this variable - lpName = Akai APC20 - Akai APC20 - and what does it actually mean?

    @anomad you mention setting the light colour? How do i go about that again? you started a sentence but it appears to have disappeared or was that intentional? ;)

    Lastly (for now) how do i connect one of the 'M 1' buttons to M8 itself? I know i can connect between layer 1-10 but i can't see an option to connect to one of the media panel previews?

    Image

    Thanks for your time if you got this far.

    I will release this module when it is complete :)

    Cheers
    Basic.
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Wed Feb 01, 2012 2:19 am

    A little update :)

    The more im going at it the more im understanding. I have managed to map Bank 1-8 on my APC and so it corresponds... see the images to know what i mean.

    Still no LED feedback but once i get the module mapped how i want i will tackle that.

    Image
    and
    Image

    I will keep this thread updated as i progress.

    :)
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: Akai APC 20 - midi question (LEDS)

    by anomad » Thu Feb 02, 2012 5:14 am

    Basic wrote:Creating the template has been fine and pretty fun. I've been following the instructions of anomad and reading the online module manual and to be honest I've been getting a little lost :( this is a whole new world for me.

    I entered this line of code in the correct place...

    allMidiDevices = modul8.getMidiDestinationsList()
    print "all midi ", allMidiDevices

    I then viewed the code and it showed the APC20 as listed which was great.

    The problem i have at the moment is where do i put this variable - lpName = Akai APC20 - Akai APC20 - and what does it actually mean?


    . in my case, lpName is a variable name i chose to represent 'launchpad name' - you could just as easily call your variable apc20Name if you want...

    lpName = 'Launchpad - Launchpad'

    modul8.sendMidi(lpName,1,'NOTE_ON',note,val)

    . so, in my code example, lpName is the device i'm sending the midi to (a launchpad). for your situation, you could be verbose if you chose to, ie:

    module.sendMidi('Akai APC20 - Akai APC20',1,'NOTE_ON', note,val)

    @anomad you mention setting the light colour? How do i go about that again? you started a sentence but it appears to have disappeared or was that intentional? ;)

    Lastly (for now) how do i connect one of the 'M 1' buttons to M8 itself? I know i can connect between layer 1-10 but i can't see an option to connect to one of the media panel previews?


    . if the apc20 is like the launchpad, you need to know what MIDI note each button is sending and use that as a starting point.

    . if it's like the ap40, this image might help - http://4.bp.blogspot.com/_j9zS9x1UVfc/T ... c40_22.jpg.

    . if the upper left button on the grid is note 56, you could write something like :

    module.sendMidi('Akai APC20 - Akai APC20',1,'NOTE_ON', 56 ,3)

    . to turn the led in the upper right hand corner red (per the list above). i don't have an apc20, but i'm guessing something like this would work

    . you can use MIDI monitor (http://www.snoize.com/MIDIMonitor/ ) to see what MIDI data is being sent back and forth.

    . if i understand the second part of your question (and what it looks like you're trying to do from your illustrations) - you'll need to know which Media Bank you're in (1-8) and then you can set media for the current layer like this :

    modul8.setValue('ctrl_layer_media', myMediaID, 0)

    . myMediaID is a variable (my own name, nothing modul8 specific) where mediaID= 0 is bank 1, media in upper left corner - mediaID = 16 is bank 2, media in upper left corner, media=19 is bank 2, media in upper right corner, etc.- see 'Media Preview Control' in the online manual

    . i would suggest having M 1 send a value called something like mediaOffset = 0, M 2 send mediaOffset =1, M 3 send mediaOffset = 2 etc,

    . lets say you're setting a variable called mediaBank that corresponds to bank 1-8
    . then when the button is pressed, it sends a value for mediaOffset
    . then the media ID you want would be


    myMediaID = ((mediaBank -1) * 16 ) + mediaOffset
    modul8.setValue('ctrl_layer_media', myMediaID, 0)

    . so, lets say BANK1 is selected ( mediaBank = 1 )
    . and you press the M 1 button (mediaOffset = 0 )

    (( 1 -1 ) * 16 ) + 0 = 0

    so myMediaID would = 0 which is the first media asset.

    . clear as mud? :D



    -james
    (a nomad. )
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Thu Feb 02, 2012 5:31 pm

    Hi James,

    Thanks for sticking on this with me.

    I can't believe i didn't get the lpName - lp, Launch Pad, haha never mind.

    Im going to start working on this again now and its a lot more clearer!

    I'll keep the thread updated on my progress.

    One thing i did do was change the Media Buttons to Media preview buttons in a duplicated module. But from what I gather i will keep them as just buttons.

    And yeah clearer than mud :)

    Thanks again!
    Liam
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Thu Feb 02, 2012 6:34 pm

    Actually a little update...

    As previously mentioned i have Bank 1 - 8 working and corresponding correctly. (no LED Feedback but i will get to that last as i just need the basic template working first:))

    I have also successfully managed to map M 1 / M -16 to the media grid.

    The issues im having now is M1 - M16 is only mapped to the first 16 media's.

    As its in only mapped to 0-15.

    So when i am on Bank 1, Clips 0 - 15 as triggered but when i move to say Bank 2 and trigger M1 - M16 all it does is trigger the first 16 clips still.

    What i need it to do is when switched to another Bank, say bank 2 i need it to trigger clips, 16-31 and so forth for all 8 Banks.

    Is this possible?

    Im looking into other modules to see if any are similar and can help in any way :)

    Liam
    Attachments
    1_16.png
    M1 - M16
    1_16.png (10.89 KiB) Viewed 25846 times
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: Akai APC 20 - midi question (LEDS)

    by anomad » Thu Feb 02, 2012 8:38 pm

    Basic wrote:Actually a little update...

    As previously mentioned i have Bank 1 - 8 working and corresponding correctly. (no LED Feedback but i will get to that last as i just need the basic template working first:))

    I have also successfully managed to map M 1 / M -16 to the media grid.

    The issues im having now is M1 - M16 is only mapped to the first 16 media's.

    As its in only mapped to 0-15.

    So when i am on Bank 1, Clips 0 - 15 as triggered but when i move to say Bank 2 and trigger M1 - M16 all it does is trigger the first 16 clips still.

    What i need it to do is when switched to another Bank, say bank 2 i need it to trigger clips, 16-31 and so forth for all 8 Banks.

    Is this possible?


    . that was the second part of my reply :)

    . the basic outline would be :
    . user presses a bank button; change global variable name 'mediaBank' to the bank number, send a MIDI note back to the apc20 to light up the LED

    . user presses a media button (M1, M2, M3, etc) and it sets the variable 'mediaOffset' to 0-15 (depending on the button pressed) ; determine which the ID for that medai clip is (called 'myMediaID' ) ; set 'ctrl_layer_media' to that id

    myMediaID = ((mediaBank -1) * 16 ) + mediaOffset
    modul8.setValue('ctrl_layer_media', myMediaID, 0)

    . then send a MIDI note to the apc20 to change the LED color


    -james
    (a nomad. )
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Thu Feb 02, 2012 8:46 pm

    Ah right I see now :) I'm still slowly getting there.

    1 more question regarding the M1 -M16 buttons. Can i just use these 16 button i have created or do i need to create more? Sorry if i am repeating myself a little I'm just trying to fully understand it :)
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: Akai APC 20 - midi question (LEDS)

    by anomad » Fri Feb 03, 2012 5:53 am

    . i would keep the buttons you already have...

    . when i code groups of buttons, i like to have them all send the same beginning of a message (in the 'Send Message' tab) then change the last two (or sometimes three) characters in the message to differentiate them. for example, in the 'Script Connect' tab of the editor, you could have the buttons Send Message: 'mediaOffsetxx' where xx is the value you want to use

    Code: Select all

    button        Send Message
    M1            mediaOffset00
    M2            mediaOffset01
    M3            mediaOffset02
    ...
    M15           medaIOffset14
    M16           mediaOffset15

    . i use 00 and 01 instead of 0 and 1 so i can just chop off the last two characters of the message, convert them into an integer (using int() ) and have the data i need.

    . also, while we're here

    Code: Select all

    BANK1         mediaBank01
    BANK2         mediaBank02
    ....
    BANK8         mediaBank08

    . then, in the MessageEven(msg,param) part of your code :

    Code: Select all

    if  msg.startswith('mediaOffset') and param['value'] == 1 :
         mediaOffset = int(msg[11:12])     
         myMediaID = ((mediaBank -1) * 16 ) + mediaOffset
         modul8.setValue('ctrl_layer_media', myMediaID, 0)

    . i use the .startswith so i don't need an if/then statement for all 16 buttons... as long as no other messages start with mediaOffset, we'll be good. the msg[xx:yy] grabs the characters starting at position xx and goes to yy, the we convert them to an integer.

    . i'm pretty sure the msg[[11:12]) will grab the last two number of the message (i get the indices in python confused) might be 11:13 - just print myMediaID after you get the value and see what it says.

    . same w/your 'mediaBank' variables

    Code: Select all

    if msg.startswith('mediaBank') and param['value'] == 1 :
         mediaBank = int(msg[9:10])



    . btw, i think it's great you're sticking w/this... the first few modules always take the longest... just learning how things are put together, troubleshooting errors, etc. *but*, if you stick w/it... you'll find yourself needing a specific function and be able to crank out a quick module in no time... then you start thinking of pushing the boundaries of modul8 - and that's where the real power of the application lies. keep asking questions, i'm happy to assist as best that i can. :D

    -james
    (a nomad. )
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Sun Feb 05, 2012 12:04 am

    Hey James,

    Thanks, it really is that difficult for me but i can see light at the end of the tunnel :) I'll give the button advice a go to. I don't want to be digressing but going back to you first post. You created the variable

    lpName = 'Launchpad - Launchpad'

    So say i then create a variable for my APC 20 and call it.

    apc20Name = 'Akai APC20 - Akai APC20'

    Where would this code be put? Would it be in the Init() section?

    EDIT - I just re-read the thread and you did answer this question. my bad :)

    Im going through python now and trying to work out what goes where.

    Thanks for sticking with me and i hope i can make a little more headway in the next couple of days :) Issue i'm finding is starting and stopping with other things on. Once I'm in the swing of things i have to stop and then when i try and get back into it i struggle to remember it all and get the ball rolling.

    Funny you should say that I'm really looking into other module's i want to create... ha ha I best stick with just this one first.

    Cheers
    Liam :)
  • kawmoc
    junior Member
    Posts: 1
    Joined: Sun Mar 04, 2012 9:33 pm

    Re: Akai APC 20 - midi question (LEDS)

    by kawmoc » Sun Mar 04, 2012 10:00 pm

    I'm really looking for a module like that ! APC20 users support you!
    Gonna stick to this thread until the release :D
  • Basic
    activ8 member
    Posts: 74
    Joined: Thu Oct 21, 2010 10:39 pm

    Re: Akai APC 20 - midi question (LEDS)

    by Basic » Mon Mar 05, 2012 4:55 pm

    Hey everyone.

    Just a little update, I'm not as further forward as i have was hoping due to busyness but when i get more done i will let everyone know :)

    Thanks for the interest too :)
    Liam
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: Akai APC 20 - midi question (LEDS)

    by anomad » Tue Mar 06, 2012 4:06 am

    Basic wrote:Hey everyone.

    Just a little update, I'm not as further forward as i have was hoping due to busyness but when i get more done i will let everyone know :)

    Thanks for the interest too :)
    Liam


    . and that's the second hardest part about module programming, finding the time! :D

    . keep on it, i'm interested to see what you do w/it


    -james
    (a nomad. )

Who is online

Users browsing this forum: No registered users and 10 guests