Python
From CockosWiki
(Difference between revisions)
m (→Example Scripts) |
(→Example Scripts) |
||
Line 48: | Line 48: | ||
|- | |- | ||
| [[GuiTest.py]]||Short demonstration of the TK Gui - excellent stuff which solves a lot of problems||Malevol3nt | | [[GuiTest.py]]||Short demonstration of the TK Gui - excellent stuff which solves a lot of problems||Malevol3nt | ||
+ | |- | ||
+ | | [[MoveToNextEdit.py]] & [[MoveToPrevEdit.py]]||Moves the cursor to the next, or previous "edit point". In this context an edit point is a project marker, project start or end, item start and end points, and fade points. The two scripts are nearly identical with just a single variable specifying which way to search in the project.|| ThomasE | ||
|} | |} | ||
Line 54: | Line 56: | ||
[[Category:ReaScript]] | [[Category:ReaScript]] | ||
- | [[Reaper_Documentation|Reaper Documentation]] | + | [[Reaper_Documentation|Reaper Documentation]] > [[ReaScript]] |
Revision as of 22:03, 17 January 2010
Reaper Documentation/ReaScript
Contents |
Introduction
Multiple Versions of Python Installed
If you have both Python 2 and 3 installed, you can try this from Reaper 3.1415:
In REAPER.ini, the [reaper] section which is usually the top 50% of the file, add a line like this:
pythonlib=/Library/Frameworks/Python.framework/Versions/3.1/lib/libpython3.1.dylib
(Your path to the Python 3 dylib is probably different - so don't just copy the line above...)
Caveats
Recommended Script Editors
IDLE - which is included in more recent Python distributions.
Notepad++
PSPad
Coding Tips
Function Aliasing
You can use function aliasing to reduce the length of your code in cases where a function is used many times. For example:
def msg(m): RPR_ShowConsoleMsg(m) # ------------------------ # so now you can write msg() instead of RPR_ShowConsoleMsg() each time
Example Scripts
Script Name | Description | Contributed by |
---|---|---|
HappySnake.py | Coding example in the form of ASCII prank: | liteon |
RemoveTakeNamesExtensions.py | A Python version of sfzgeek's Perl script | EvilDragon |
SetCustomColour.py | This script sets the track colour if just the track is selected and the item colour if just the item is suggested | EvilDragon |
SoxConvert.py | Sample rate conversion with SOX and ReaScript | dub3000 |
QuickName.py | opens a dialog box to ask user for new media item take name | liteon |
GetSourceExtension.py | testing the extension of one selected item | EvilDragon |
GuiTest.py | Short demonstration of the TK Gui - excellent stuff which solves a lot of problems | Malevol3nt |
MoveToNextEdit.py & MoveToPrevEdit.py | Moves the cursor to the next, or previous "edit point". In this context an edit point is a project marker, project start or end, item start and end points, and fade points. The two scripts are nearly identical with just a single variable specifying which way to search in the project. | ThomasE |