 
     openSubmenu: (index) =>
         @selectIndex = index
-
+        console.log 'open submenu', index
         @highlightMenu()
 
         # hide all tabs and show only the current

        @buttons.push @add
        @addChild @add

        @presets = new MenuButton AppData.ASSETS.sprite.textures['ic-presets-48.png'], 'patches'
        @presets.buttonClick = =>
            @openSubmenu 2
            null
        @buttons.push @presets
        @addChild @presets

        @midi = new MenuButton AppData.ASSETS.sprite.textures['ic-midi.png'], 'midi'
        @midi.buttonClick = =>
            @openSubmenu 3
            null
        @buttons.push @midi
        @addChild @midi

        # change to new size
        App.TOGGLE_MENU.dispatch { width: AppData.SUBMENU_PANNEL + AppData.MENU_PANNEL + AppData.MENU_PANNEL_BORDER }
        null

    onMidiStateChange: (e) =>
        # only shows menu if user has midi device, if midi device is disconnected, closes menu
        if e.state is 'disconnected' and e.connection is 'closed'
            @midi.visible = false
            AppData.SHOW_MENU_PANNEL = false
            App.TOGGLE_MENU.dispatch { width: 0 }
        else if e.state is 'connected'
            @midi.visible = true
        null
