Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: additional keyboard-shortcuts / speed up  (Read 14618 times)

0 Members and 1 Guest are viewing this topic.

8ch

  • Newbie
  • Offline Offline
  • Posts: 52
  • A#4
    • View Profile
additional keyboard-shortcuts / speed up
« on: March 11, 2010, 20:43:48 »

Hey,

Not too long ago i was looking at the sources to find out how the input control handling is done and how i would be able to edit some values in order to speed things up a little. It is sometimes hard for me to express exactly what i mean when talking about features or reflecting differences between milky and ft2 without emotional touch. Me and ft2 have had a long lasting relationship, nowadays we meet each other only sparely..

Well, i needed to find out myself. With my new relationship. It has a strange name but is quite userfriendly. I asked: You wanna be my friend, milky?! It replied: Feed me samples! Wow! This shouldnt be too hard. I knew it was love but thats another story...

enough of that...

I'd like to introduce some additional keyboard-shortcuts for the SDL version. FT2-edit-mode only, but i think with a little helloworld-skills you can easily adopt it to milkytracker edit mode. I hope. Trial & error it! That's what i did ;)

CTRL-F9 (delete current pattern order)
CTRL-F10 (insert new order)
CTRL-F11 (decrease current order)
CTRL-F12 (increase current order)
SHIFT-R (toggle record button)

Those CTRL-Fx shortcuts can be used to control the song editor (pattern order editor). Rather than moving your mouse across the whole screen to the top left corner trying to hit one of the tiny plus/minus symbols, now just press CTRL-F10. Voila! Then simply copy a pattern, increase new order with CTRL-F12 and paste into. A process also known as clonebuttonless cloning..

SHIFT-R toggles the record button.

Ok. I find these shortcuts very useful in my 'everyday-tracking'. No need to touch the mouse anymore to do orderlist operations. By 'everyday-tracking' i mean 'classic-song-tracking', 'making tracks', 'getting a song done'... A 'song' is usually measured in time, it has a beginning and an end.. Without doubt it is the most complicated type of tracking.

Another type of tracking can be described as 'live-tracking' or 'dj-tracking' or maybe 'trackjaying', whatever you like. It is the process of playing songs (but more often simply patterns) in multible tabs (or different instances) in realtime (jamming). Classic (or first-generation) trackers like fasttracker for example can only load a single song at a time. Loading additional songs causes gaps in playback and unwanted volume changes. In order to 'mix' in a single fasttracker instance you'd need lots of patterns in advance that you'd play and improvise in realtime in 'play-pattern-mode'. Hitting CTRL-CURSOR-LEFT/RIGHT would make a gapless cycle through all patterns. This, however, is not possible in milkytracker. The player logic is different to ft2 in this case.

I needed a workaround. So, in most cases i have only a single pattern in my orderlist when jamming live. I then use song-play-mode on this pattern. Then open another tab, load something in, sync the bpm/spd and then use my CRTL-F11/F12 shortcuts to cycle through the patterns inna FT2-like way somehow. Since i'm in song-mode increasing or decreasing the current order causes the player to not gap between the patterns regardless of the current play-position in the pattern. Once i found this out it was like woaa, it has been there but i didnt see it!

By the way: As you know Dxx effects cannot be used correctly in pattern-play-mode. D34 for example tells the player to jump to the next pattern and start from position 34. In pattern-play mode any Dxx command is treated as D00. In single-pattern-song-playback those effects work the way they should. Useful for setting up complex Dxx loops (in case you like breakbeat). Once the loop is good enough goto export it into your instrument list or so.

My initial idea was to get exactly this pattern-behaviour. But i still needed more speed. I found the default keyboard-repeat rate to slow. The keyboard repeat and delay settings are stored in the file SDL_Main.cpp.

Look for something like:

Code: [Select]
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
                    SDL_DEFAULT_REPEAT_INTERVAL);

and replace the SDL_DEFAULT_REPEAT_xxx string with your custom value. Take something between 125-250 as delay, the lower the faster. Interval goes 30 (lower=slower).

To make mouseclicks faster look for:

Code: [Select]
(timerTicker - lButtonDownStartTime) > 25)

and

Code: [Select]
(timerTicker - rButtonDownStartTime) > 25)

and replace the 25 by your value (lower=faster). NOTE: Use this one with caution! I've successfully tested values around 5 in milky 0.90.80 while version 0.90.85 does not like too short values here. Some buttons get 'sticky' when pressed. When clicking into the instrument selector (hold&drag) the mouse somewhat 'shivers' (jumps around). I guess the mousehandling has changed. Version 0.90.80 works fine.


Now back to the keyboard-shortcuts. The following lines must be added to the file TrackerKeyboard.cpp:

Code: [Select]
eventKeyDownBindingsFastTracker->addBinding('R', KeyModifierSHIFT, &Tracker::eventKeyDownBinding_ToggleFT2Edit);
eventKeyDownBindingsFastTracker->addBinding(VK_F9, KeyModifierCTRL, &Tracker::eventKeyDownBinding_delme1);
eventKeyDownBindingsFastTracker->addBinding(VK_F10, KeyModifierCTRL, &Tracker::eventKeyDownBinding_insme1);
eventKeyDownBindingsFastTracker->addBinding(VK_F11, KeyModifierCTRL, &Tracker::eventKeyDownBinding_decme2);
eventKeyDownBindingsFastTracker->addBinding(VK_F12, KeyModifierCTRL, &Tracker::eventKeyDownBinding_incme2);

note: SHIFT-R does not need a new function. it is already there ;) all the rest must be declared in the file Tracker.h

Add the following lines to Tracker.h

Code: [Select]
void Tracker::eventKeyDownBinding_delme1()
{
moduleEditor->deleteOrderPosition(getOrderListBoxIndex());
updateOrderlist();
playerLogic->continuePlayingSong();
return;
}

void Tracker::eventKeyDownBinding_insme1()
{
moduleEditor->insertNewOrderPosition(getOrderListBoxIndex());
updateOrderlist();
playerLogic->continuePlayingSong();
return;
}

void Tracker::eventKeyDownBinding_incme2()
{
moduleEditor->increaseOrderPosition(getOrderListBoxIndex());
updateOrderlist();
playerLogic->continuePlayingSong();
return;
}

void Tracker::eventKeyDownBinding_decme2()
{
moduleEditor->decreaseOrderPosition(getOrderListBoxIndex());
updateOrderlist();
playerLogic->continuePlayingSong();
return;
}


I hope these tips are useful. I wonder how to create sliders or value-boxes to control the keyrepeat/delay from within the config screen. I have only very basic coding skills.. well.. like ..if tracking does not count as a programming language - none. halloworld. i'm out.
« Last Edit: March 12, 2010, 01:32:38 by 8ch »
Logged

Deltafire

  • Milkytracker Moderator
  • Rising Star
  • *
  • Offline Offline
  • Posts: 196
    • View Profile
Re: additional keyboard-shortcuts / speed up
« Reply #1 on: November 20, 2010, 22:47:30 »

For some reason I haven't noticed this post until today.

Looks like you have made some useful modifications, the new shortcuts specifically; I think they could be added to Milkytracker for the next release.  Not sure about changing the keyboard/mouse speeds though, this could have undesirable consequences (and is not portable).

I've added a link to this topic in the FAQ since we get a lot of people asking about how to add/change keyboard shortcuts.
Logged

Kmuland

  • Milkytracker Moderator
  • Newbie
  • Offline Offline
  • Posts: 74
    • View Profile
Re: additional keyboard-shortcuts / speed up
« Reply #2 on: November 23, 2010, 15:40:58 »



CTRL-F9 (delete current pattern order)
CTRL-F10 (insert new order)
CTRL-F11 (decrease current order)
CTRL-F12 (increase current order)




+1

I always missed shortcuts like these.
Logged

Deltafire

  • Milkytracker Moderator
  • Rising Star
  • *
  • Offline Offline
  • Posts: 196
    • View Profile
Re: additional keyboard-shortcuts / speed up
« Reply #3 on: December 19, 2010, 14:55:22 »

These keyboard shortcuts are now added to Milkytracker, and will be available in the next release.
Logged
Pages: [1]   Go Up