 |
|
|
12-08-2018, 04:29 AM
|
#1
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
Ultraschall-API 4.75 - 1615 Lua-Functions -"Podcast Metadata"
After over 6 years of coding, I'm proud to announce the release of the
Ultraschall-API 4.75 - a 1615 Lua-functions-library for Reaper
which can be found at https://ultraschall.fm/api or installed via ReaPack, using https://github.com/Ultraschall/ultra..._api_index.xml
This API is intended to make programming Reaper much more easier, trying to give you access to many hard-to-code corners of Reaper, improving programming workflows, that are inconvenient to work with using Reaper's own API, making debugging of scripts much easier and much more.
This API was to be used within Ultraschall only, but quickly evolved into a huge 1000+ function-library, that many 3rd-party programmers and scripters may find use in, with many useful features, like:
- ReaPack-installable, add it to your ReaPack-installation and you can install it easily
- Rendering - you can render your projects without having to use the render-dialog. You can customize the rendering-workflow in every way you want. Just create a renderstring and pass it over to RenderProject_RenderCFG or RenderProjectRegions_RenderCFG
- Navigation, Follow and Arrangeview-Manipulation - get/set cursors, zoom, autoscroll-management, scroll, etc
- ArrangeView-Snapshots - you can save, retrieve snapshots of the arrangeview, including position, zoomstates to quickly jump through parts of your project
- Trackstates - you can access and set all(!) track-states available
- ProjectStates - you can access all and set many project-states available
- EventManager - run actions, when certain events occur. Which events? You decide!
- Mediaitem-states - you can access and set many mediaitem-states (more will follow)
- File access - many helperfunctions for reading, writing, copying files. No more hassle writing it yourself! e.g ReadFullFile, WriteValueToFile, etc
- Cough-Mute-management - you can write your own cough-buttons, that set the state of the mute-envelope of a track easily
- Marker - extensive set of marker functions, get, set, export, import, enumerate, etc
- Spectrogram - you can program the spectrogram-view
- Routing - you can set Sends/Receives and HWOuts more straightforward than with Reaper's own Routing-functions. Includes mastertrack as well.
- Get MediaItems - you can get all media-items within a time-range AND within the tracks you prefer; a 2D-approach e.g. GetAllMediaItemsBetween and GetMediaItemsAtPosition, etc
- Gaps between items - you can get the gaps between items in a track, using GetGapsBetweenItems
- Edit item(s) - Split, Cut, Copy, Paste, Move, RippleCut, RippleInsert, SectionCut by tracks AND time/start to endposition e.g. RippleCut, RippleInsert, SectionCut, SplitMediaItems_Position, MoveMediaItemsBefore_By, MoveMediaItemsSectionTo and many more
- Previewing MediaItems and files - you can preview MediaItems and files without having to start playback of a project
- KB-Ini-Management - manipulate the reaper-kb.ini-file with custom-settings
- Checking for Datatypes - check all datatypes introduced with Ultraschall-API and all Lua/Reaper-datatypes
- UndoManagement - functions for easily making undoing of functions as well as preventing creating an undo-point
- RunCommand for Items/Tracks - apply actions to specific items/tracks
- Checking for changed projecttabs - check, if projecttabs have been added/removed
- ExtState-Management - an extensive set of functions for working with extstates as well as ini-files
- Data Manipulation - manipulate a lot of your data, including bitwise-integers, tables, etc
- Clipboard-Management - get items from clipboard, put them to clipboard, even multiple ones
- Error Messaging System - all functions create useful error-messages that can be shown using, eg: ShowLastErrorMessage, for easier debugging
- Custom-Defer-functions, who allow you to control, how often a deferred function shall be executed (every n'th cycle/second)
- Child-Scripts, who allow starting scripts AND passing parameters/returnvalues/values between two scripts. Even multiple-instances of one script can be started, where communication with each scriptinstance is possible on an individual basis.
Means: Start Childscript.lua twice, and you can communicate with ChildScript.lua(instance1) and ChildScript.lua(instance2) individually, which is difficult to do otherwise.
- Custom-Markers and Regions, allow you to create different markertypes of the scheme _custommarker1: text of the marker
You can add, set, count, enum, delete them like normal markers. All you need to set the custommarker-name (custommarker1 in the above example) and this will be used for the custom-markers/custom-regions of your choice
- Localization of your scripts - via a translationfile. Now you can let people do translations for you without having to add them into your script by hand.
- FXStateChunk-Management - access all the nice gems the API itself doesn't, though StateChunks provide
- Parameter Modulation - code your parameter modulation. No more UI needed

- tons of other helper-functions
- my Reaper-Internals Documentation AND
it's fully documented.
Find the introduction to it here: https://mespotin.uber.space/Ultrasch..._Concepts.html
Last edited by Meo-Ada Mespotine; 12-19-2022 at 01:34 PM.
Reason: Release
|
|
|
12-08-2018, 04:30 AM
|
#3
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
Placeholder 2
|
|
|
12-08-2018, 04:30 AM
|
#4
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
Placeholder 3
|
|
|
12-08-2018, 04:31 AM
|
#5
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
Placeholder 4
|
|
|
12-08-2018, 04:32 AM
|
#6
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
Placeholder 5 for something big to come...
|
|
|
12-08-2018, 04:36 PM
|
#7
|
Human being with feelings
Join Date: Feb 2018
Posts: 121
|
i'm scared.
|
|
|
12-09-2018, 02:02 PM
|
#8
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,027
|
6 days, until you can easily
Color Items and Tracks:
Code:
-- Meo Mespotine - 30. November 2018
-- Cycles colors of MediaItems and MediaTracks. It's using a ColorTable with SonicRainboomColorStyle
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
ColorTable=ultraschall.CreateSonicRainboomColorTable() -- create ColorTable SonicRainboom-style
NumMediaItems,MediaItemArray=ultraschall.GetAllMediaItems() -- get all MediaItems in the current project as MediaItemArray
function main()
-- Let's cycle the colors
counter=counter-1
CycledColorTable=ultraschall.CycleTable(ColorTable,math.floor(counter)) -- cycle the colors in the ColorTable
retval = ultraschall.ApplyColorTableToTrackColors(CycledColorTable, 1) -- apply the cycled ColorTable to MediaTrack-colors
ultraschall.ApplyColorTableToItemColors(CycledColorTable, 1, MediaItemArray) -- apply the cycled ColorTable to MediaItem-colors
reaper.defer(main)
end
counter=0 -- a simple counter for the offset of the cycling
main() -- Let's start to boogie
or even influence brightness, contrast and saturation:
Code:
-- Ultraschall-API demoscript by Meo Mespotine 29.10.2018
--
-- change brightness, contrast and saturation of the trackcolors of all tracks.
-- will apply, by default, the Ultraschall-colorscheme "Sonic Rainboom"
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
-- Colorize Tracks
ColorTable = ultraschall.CreateSonicRainboomColorTable()
ultraschall.ApplyColorTableToTrackColors(ColorTable, 2)
gfx.init("Change Track-Color's Brightness, Contrast and Saturation",300,200,0,500,400)
gfx.setfont(1,"times",16)
brightness=0
contrast=0
saturation=0
function changecolor(value, changetype)
-- change the color, according to selected type
for i=1, reaper.CountTracks(0) do
R,G,B=ultraschall.ConvertColorReverse(reaper.GetTrackColor(reaper.GetTrack(0,i-1)))
if changetype==1 then red, green, blue = ultraschall.ChangeColorBrightness(R,G,B, value) end -- brightness
if changetype==2 then red, green, blue = ultraschall.ChangeColorContrast(R,G,B, value, 255+value) end -- contrast
if changetype==3 then red, green, blue = ultraschall.ChangeColorSaturation(R,G,B, value) end -- saturation
newcol=ultraschall.ConvertColor(red,green,blue)
reaper.SetTrackColor(reaper.GetTrack(0,i-1), newcol)
end
end
function main()
-- get pressed key
A=gfx.getchar()
-- brightness
if A==49 then changecolor(-3, 1) brightness=brightness-3 end
if A==50 then changecolor(3, 1) brightness=brightness+3 end
-- contrast
if A==51 then changecolor(-3, 2) contrast=contrast-3 end
if A==52 then changecolor(3, 2) contrast=contrast+3 end
-- saturation
if A==53 then changecolor(-3, 3) saturation=saturation-3 end
if A==54 then changecolor(3, 3) saturation=saturation+3 end
if A~=-1 then
gfx.x=0 gfx.y=0
gfx.drawstr("Change\n Brightness(keys 1 and 2): "..brightness.."\n Contrast(keys 3 and 4) : "..contrast.."\n Saturation(keys 5 and 6): "..saturation)
gfx.update()
reaper.defer(main)
end
end
A=1
main()
Last edited by Meo-Ada Mespotine; 12-09-2018 at 02:45 PM.
|
|
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:23 AM.
|