View Single Post
Old 10-25-2012, 07:22 AM   #11
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Posts: 548
Default

Hey -
I don't have AutoIt installed on this machine, window spy does not seem to pick up that same information.
Also - now the docked piano roll does not show correctly anymore... not sure what changed, I did not edit anything... weird.

I was looking at the gm drum map (from stash) here's a snip.

35 B0 Acoustic Bass Drum
36 C1 Bass Drum 1
37 C#1 Side Stick
38 D1 Acoustic Snare
39 D#1 Hand Clap
40 E 1Electric Snare

A couple of questions come to mind...
1. Does edit4 get the text "Acoustic Bass Drum" for note 35?
I know the text is displayed on the key of the piano, but is that info sent to the display for edit4 in reaper (even though that display is too small for that much text...
I'm not articulating this very well...
2. Is there a standard place to put a drum map in reaper, since others will have to load it, both into reaper and into this script?
2b. Are there custom actions based on drum or piano notes for midi? I'll look from your generated list and the list of actions... doesn't look like it.

3. Where I am heading is will this be useful to someone else?
4. If they have to browse for the file to load and edit variable definitions... I want it to be useful and easy to manage for others. If not, I'll just hack to customize for myself and get something working that only you or I will understand. Yes others will as well but most will not.

Here is a test and proof of concept.

Done based on GM map from stash

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance, Force
;~ SetTitleMatchMode 2
CoordMode, Mouse, Screen
;~ SetBatchLines, -1

CustomColor = 000000  ; Can be any RGB color (it will be made transparent below).
Gui, +LastFound +AlwaysOnTop -Caption +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Font, s16 , ;courier new bold
Gui, Add, Text, vMyText cBlue, XXXXXXXXXXXXXXXX`n ; XX serve to auto-size the window.

; Make all pixels of this color transparent
WinSet, TransColor, %CustomColor%
SetTimer, UpdateOSD, 20
Gosub, UpdateOSD  ; Make the first update immediate rather than waiting for the timer.
return

UpdateOSD:
MouseGetPos, MouseX, MouseY,, MouseControl, 1
IfInString, MouseControl, MIDIWindow
{
	ControlGetText, Note, Edit4,, midiview
	ControlGetText, Position, Edit5,, midiview
	
	; =============== test for note #35; =============== 
	if note contains 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81
		{	
			if note contains 35
				{
					note = AcousticBassDrum
				}	
			if note contains 36
				{
					note = BassDrum
				}	
			if note contains 37
				{
					note = SideStick
				}	
			if note contains 38
				{
					note = AcousticSnare
				}	
			if note contains 39
				{
					note = HandClap
				}	
			if note contains 40
				{
					note = ElectricSnare
				}	
			if note contains 41
				{
					note = LowFloorTom
				}	
			if note contains 42
				{
					note = ClosedHat
				}	
			if note contains 43
				{
					note = HiFloorTom
				}	
			if note contains 44
				{
					note = PedalHat
				}	
			if note contains 45
				{
					note = LowTom
				}	
			if note contains 46
				{
					note = OpenHat
				}	
			if note contains 47
				{
					note = LowMidTom
				}	
			if note contains 48
				{
					note = HiMidTom
				}	
			if note contains 49
				{
					note = Crash
				}	
			if note contains 50
				{
					note = HiTom
				}	
			if note contains 51
				{
					note = Ride
				}	
			if note contains 52
				{
					note = ChinaCym
				}	
			if note contains 53
				{
					note = RideBell
				}	
			if note contains 54
				{
					note = Tamb
				}	
			if note contains 55
				{
					note = Splash
				}	
			if note contains 56
				{
					note = CowBell
				}	
			if note contains 57
				{
					note = Crash2
				}	
			if note contains 58
				{
					note = VibraSlap
				}	
			if note contains 59
				{
					note = Ride2
				}	
			if note contains 60
				{
					note = HiBong
				}	
			if note contains 61
				{
					note = LowBongo
				}	
			if note contains 62
				{
					note = MuteHiConga
				}	
			if note contains 63
				{
					note = OpenHiConga
				}	
			if note contains 64
				{
					note = LowConga
				}	
			if note contains 65
				{
					note = HiTimbale
				}	
			if note contains 66
				{
					note = LowTimbale
				}	
			if note contains 67
				{
					note = HiAgogo
				}	
			if note contains 68
				{
					note = LowAgogo
				}	
			if note contains 69
				{
					note = Cabasa
				}	
			if note contains 70
				{
					note = Maracas
				}	
			if note contains 71
				{
					note = ShortWhistle
				}	
			if note contains 72
				{
					note = LongWhistle
				}	
			if note contains 73
				{
					note = ShortGuiro
				}	
			if note contains 74
				{
					note = LongGuiro
				}	
			if note contains 75
				{
					note = Claves
				}	
			if note contains 76
				{
					note = HiWoodBlock
				}	
			if note contains 77
				{
					note = LowWoodBlock
				}	
			if note contains 78
				{
					note = MuteCuica
				}	
			if note contains 79
				{
					note = OpenCuica
				}	
			if note contains 80
				{
					note = MuteTriangle
				}	
			if note contains 81
				{
					note = OpenTriangle
				}	
			;end of test for drum notes
	}

	;~ ToolTip %Note%`n%Position%
	;~ StringTrimRight, Position, Position, 3  ; remove .100ths
	MouseX := MouseX + 20
	MouseY := MouseY + 20
	GuiControl,, MyText, %Note%`n%Position%

	Gui, Show, w300 x%MouseX% y%MouseY% NoActivate  ; NoActivate avoids deactivating the currently active window.
}
else
	;~ ToolTip
	Gui, hide
return

GuiClose:
ExitApp
__________________
KeyMce/GenMce - pc keyboard/midi to Mackie control emulation (built with ahk). Also - an ahk script to build your own midi programs.

Last edited by flipotto; 10-25-2012 at 10:17 AM.
flipotto is offline   Reply With Quote