Ultraschall Internals Documentation Reaper Internals Documentation Downloads Changelog of documentation Impressum and Contact
Ultraschall-logo Functions Engine GFX Engine GUI Engine Video Engine Audio Engine Doc Engine  
  Introduction/Concepts      Concepts      Concepts      Concepts      Concepts      Concepts
           Functions      Functions       Functions       Functions       Functions       Functions 



4.00Beta 2.77 - "Monkeys with Tools - Call the planet doctor" - - Build: 40673

The Functions Reference

To add the API to your script, just add


        dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
      
as first line into your script.

For more details, read the docs in the Introduction and Concepts-area of this page.

API-Helper functions

CheckActionCommandIDFormatCheckActionCommandIDFormat2ConvertFunction_FromBase64StringConvertFunction_ToBase64String
GetAllActionsGetApiVersionGetOSGetReaperAppVersion
GetReaperColorThemesPathGetReaperJSFXPathGetReaperScriptPathGetReaperWebRCPath
GetScriptFilenameFromActionCommandIDIsItemInTrackIsItemInTrack2IsItemInTrack3
IsOS_MacIsOS_OtherIsOS_WindowsIsObjectValidReaperObject
IsValidGuidIsWithinTimeRangeLoadFunctionFromExtStateMakeFunctionUndoable
OpenURLPreventCreatingUndoPointPrintProgressBarRefreshToolbar_Action
ResetProgressBarReturnTypeOfReaperObjectReturnsMinusOneInCaseOfError_ArzalaRunBackgroundHelperFeatures
RunCommandRunLuaSourceCodeSetIntConfigVar_BitfieldStoreFunctionInExtState
ToggleStateActionToggleStateButtonget_action_context_MediaItemDiffprint
print2print3print_altprint_update
tobooleantype 
Child Scripts
GetScriptIdentifierGetScriptIdentifier_DescriptionGetScriptIdentifier_TitleGetScriptParameters
GetScriptReturnvaluesGetScriptReturnvalues_SenderMIDI_OnCommandByFilenameMain_OnCommandByFilename
Main_OnCommand_LuaCodeSetScriptIdentifier_DescriptionSetScriptIdentifier_TitleSetScriptParameters
SetScriptReturnvalues  
Data Analysis
FindPatternsInString  
Data Manipulation
AddIntToCharBase64_DecoderBase64_EncoderCSV2IndividualLinesAsArray
CSV2LineCombineBytesToIntegerCompareArraysCompareStringWithAsciiValues
ConcatIntegerIndexedTablesConvertAscii2HexConvertBitsToIntegerConvertHex2Ascii
ConvertIntegerIntoString2ConvertIntegerToBitsConvertStringToAscii_ArrayConvertStringToIntegers
CountCharacterInStringCountEntriesInTable_MainCountLinesInStringCountPatternInString
CycleTableDB2MKVOLGetAllEntriesFromTableGetDuplicatesFromArrays
GetPartialStringGetSetIntConfigVarIsValidMatchingPatternKeepTableEntriesOfType
LimitFractionOfFloatMKVOL2DBMakeCopyOfTableNotes2CSV
RemoveTableEntriesOfTypeReplacePartOfStringReplacePatternInStringReturnTableAsIndividualValues
ReverseEndianess_ByteReverseTableRoundNumberSearchStringInString
SecondsToTimeSecondsToTimeString_hh_mm_ss_mssSetBitfieldSplitIntegerIntoBytes
SplitStringAtLineFeedToArraySplitStringAtNULLBytesStateChunkLayouterTimeStringToSeconds_hh_mm_ss_mss
TimeToSeconds  

API-Variables

API_TempPathApi_InstallPathApi_PathEuro
SeparatorStartTime 

Audio Management

GetHWInputs_AliasnamesGetHWOutputs_Aliasnames 

Automation Items

GetProject_AutomationItemStateChunkGetProject_CountAutomationItems 

Clipboard Functions

GetMediaItemsFromClipboardGetStringFromClipboard_SWSPutMediaItemsToClipboard_MediaItemArray

Color Management

ApplyColorTableToItemColorsApplyColorTableToTrackColorsChangeColorBrightnessChangeColorContrast
ChangeColorSaturationConvertColorConvertColorFromMacConvertColorFromWin
ConvertColorReverseConvertColorToGFXConvertColorToMacConvertColorToWin
ConvertGFXToColorCreateColorTableCreateSonicRainboomColorTableIsValidColorTable
RGB2Grayscale  

Configuration Settings

Menus
GetSetConfigActionMenu  
Preferences: Advanced UI
GetSetConfigAlwaysAllowKBGetSetConfigAudioCloseTrackWnds 
Preferences: Audio
GetSetConfigAllStereoPairsGetSetConfigAudioCloseStop 
Preferences: Device
GetSetConfigAudioThreadPr  
Preferences: Media
GetSetConfigApplyFXTail  
Preferences: Mute/Solo
GetSetConfigAutoMuteGetSetConfigAutoMuteFlags 
Preferences: Project
GetSetConfigAutoSaveIntGetSetConfigAutoSaveMode 
Preferences: Recording
GetSetConfigAdjRecLatGetSetConfigAdjRecManLatGetSetConfigAdjRecManLatIn
Preferences: Video/REX/Misc
GetSetConfigAcidImport  
Project Settings: Media
GetSetConfigAfxCfg  
Recording
GetStartNewFileRecSizeStateSetStartNewFileRecSizeState 
Render to File
GetRender_AutoIncrementFilenameGetRender_OfflineOnlineModeGetRender_ProjectSampleRateForMixGetRender_QueueDelay
GetRender_ResampleModeGetRender_SaveCopyOfProjectSetRender_AutoIncrementFilenameSetRender_OfflineOnlineMode
SetRender_ProjectSampleRateForMixSetRender_QueueDelaySetRender_ResampleModeSetRender_SaveCopyOfProject
   
Transport: Contextmenu
GetSetConfigAudioPrShift  

Configuration-Files Management

Ini-Files
CountIniFileExternalState_keyCountIniFileExternalState_secCountKeysByPatternCountSectionsByPattern
CountValuesByPatternEnumerateIniFileExternalState_keyEnumerateIniFileExternalState_secEnumerateKeysByPattern
EnumerateSectionsByPatternEnumerateValuesByPatternGetIniFileExternalStateGetIniFileValue
SetIniFileExternalStateSetIniFileValue 
Reaper-kb.ini
CountKBIniActionsCountKBIniKeysCountKBIniScriptsDeleteKBIniActions
DeleteKBIniKeysDeleteKBIniScriptsGetKBIniActionsGetKBIniActionsID_ByActionCommandID
GetKBIniFilepathGetKBIniKeysGetKBIniKeys_ByActionCommandIDGetKBIniScripts
GetKBIniScripts_ByActionCommandIDSetKBIniActionsSetKBIniKeysSetKBIniScripts
   

Defer-Management

Defer1Defer10Defer11Defer12
Defer13Defer14Defer15Defer16
Defer17Defer18Defer19Defer2
Defer20Defer3Defer4Defer5
Defer6Defer7Defer8Defer9
GetDeferIdentifierGetDeferRunStateStopDeferCycle

Developer

Error Handling
AddErrorMessageCountErrorMessage_FuncnameCountErrorMessagesDeleteAllErrorMessages
DeleteErrorMessageDeleteLastErrorMessageGetErrorMessage_FuncnameGetLastErrorMessage
GetLastErrorMessage2GetLastErrorMessage_FuncnameReadErrorMessageShowErrorMessagesInReascriptConsole
ShowLastErrorMessageSuppressErrorMessagesToggleIDE_Errormessages
Helper functions
APIExistsApiTest 

Envelope Management

Get Envelope States
GetArmState_Envelope  
Get Envelope
GetAllTrackEnvelopesGetClosestEnvelopePointIDX_ByTimeGetEnvelopePointGetEnvelopePointIDX_Between
GetLastEnvelopePoint_TrackEnvelope  
Helper functions
CheckEnvelopePointObjectCountEnvelopePointsCreateEnvelopePointObjectGetTrackEnvelope_ClickState
IsValidEnvStateChunkIsValidEnvelopePointArrayIsValidEnvelopePointObject
Set Envelope States
SetArmState_Envelope  
Set Envelope
AddEnvelopePoints_EnvelopePointArrayAddEnvelopePoints_EnvelopePointObjectDeleteEnvelopePoints_EnvelopePointArrayDeleteEnvelopePoints_EnvelopePointObject
MoveTrackEnvelopePointsBySetEnvelopeHeightSetEnvelopePoints_EnvelopePointArraySetEnvelopePoints_EnvelopePointObject
   

Event Manager

EventManager_AddEventEventManager_AddStartupEventEventManager_CountRegisteredEventsEventManager_CountStartupEvents
EventManager_EnumerateEventsEventManager_EnumerateEvents2EventManager_EnumerateStartupEventsEventManager_EnumerateStartupEvents2
EventManager_IsValidEventIdentifierEventManager_PauseEventEventManager_RemoveStartupEventEventManager_RemoveStartupEvent2
EventManager_ResumeEventEventManager_SetEventEventManager_SetStartupEventEventManager_Start
EventManager_StopEventmanager_RemoveAllEvents_ScriptEventmanager_RemoveEvent

FX-Management

Assistance functions
GetFXFromFXStateChunkGetFXStateChunkIsValidFXStateChunk
Parameter Mapping
AddParmAlias_FXStateChunkAddParmLFOLearn_FXStateChunkAddParmLearn_FXStateChunkCountParmAlias_FXStateChunk
CountParmLFOLearn_FXStateChunkCountParmLearn_FXStateChunkDeleteParmAlias_FXStateChunkDeleteParmLFOLearn_FXStateChunk
DeleteParmLearn_FXStateChunkGetParmAlias_FXStateChunkGetParmAlias_MediaTrackGetParmAudioControl_FXStateChunk
GetParmLFOLearn_FXStateChunkGetParmLFOLearn_MediaItemGetParmLFOLearn_MediaTrackGetParmLFO_FXStateChunk
GetParmLearn_FXStateChunkGetParmLearn_MediaItemGetParmLearn_MediaTrackGetParmMIDIPLink_FXStateChunk
GetParmModulationChunk_FXStateChunkSetFXStateChunkSetParmAlias_FXStateChunkSetParmLFOLearn_FXStateChunk
SetParmLearn_FXStateChunk  
Plugins
AutoDetectVSTPluginsFolderScanDXPluginsScanVSTPlugins

File Management

File Analysis
CheckForValidFileFormatsCountLinesInFileGetLengthOfFileOnlyFilesOfCertainType
   
Helper functions
CountDirectoriesAndFilesInPathCreateValidTempFileDirectoryExistsDirectoryExists2
GetAllDirectoriesInPathGetAllFilenamesInPathGetAllRecursiveFilesAndSubdirectoriesGetPath
GetReaperWorkDirSetReaperWorkDir 
Manipulate Files
MakeCopyOfFileMakeCopyOfFile_Binary 
Read Files
ReadBinaryFileFromPatternReadBinaryFileUntilPatternReadBinaryFile_OffsetReadFileAsLines_Array
ReadFullFileReadLinerangeFromFileReadValueFromFile
Write Files
WriteValueToFileWriteValueToFile_InsertWriteValueToFile_InsertBinaryWriteValueToFile_Replace
WriteValueToFile_ReplaceBinary  

Localization

LocalizeLocalize_RefreshFileLocalize_UseFile

MIDI Management

MIDI Editor
OpenItemInMidiEditorZoomHorizontal_MidiEditorZoomVertical_MidiEditor

Markers

Assistance functions
CountMarkersAndRegionsGetMarkerByScreenCoordinatesGetMarkerByTimeGetMarkerUpdateCounter
GetNextFreeRegionIndexGetRegionByScreenCoordinatesGetRegionByTimeGetTimeSignaturesByTime
GetTimesignaturesByScreenCoordinatesIsMarkerAtPositionIsRegionAtPositionMoveMarkersBy
MoveRegionsByParseMarkerStringRenumerateMarkers
Custom Markers
AddCustomMarkerAddCustomRegionAddCustomRegionCountAllCustomMarkers
CountAllCustomRegionsDeleteCustomMarkersDeleteCustomRegionsEnumerateCustomMarkers
EnumerateCustomRegionsGetAllCustomMarkersGetAllCustomRegionsIsMarkerValidCustomMarker
IsRegionValidCustomRegionSetCustomMarker 
Edit Markers and Regions
AddEditMarkerAddEditRegionCountEditMarkersCountEditRegions
DeleteEditMarkerDeleteEditRegionEditToMarkerEnumerateEditMarkers
EnumerateEditRegionExportEditMarkersToFileGetAllEditMarkersImportEditFromFile
IsMarkerEditIsRegionEditRegionMarkerToEditMarkerSetEditMarker
SetEditRegion  
General Markers and Regions
GetAllMarkersGetAllMarkersBetweenGetAllRegionsGetAllRegionsBetween
GetLastMarkerPositionGetLastRegionGetMarkerAndRegionsByIndexGetMarkerByName
GetMarkerByName_PatternImportMarkersFromFileRippleCut_RegionsSetMarkerByIndex
   
Normal Markers
AddNormalMarkerCountNormalMarkersCountNormalMarkers_NumGapDeleteNormalMarker
EnumerateNormalMarkersExportNormalMarkersToFileGetAllNormalMarkersIsMarkerNormal
SetNormalMarker  
PodRange Region
AddPodRangeRegionDeletePodRangeRegionGetPodRangeRegionIsRegionPodrange
SetPodRangeRegion  
Time Signature Markers
GetAllTimeSigMarkersGetLastTimeSigMarkerPositionMoveTimeSigMarkersBy

Media Explorer

MediaExplorer_OnCommandUpdateMediaExplorer 

MediaItem Management

Assistance functions
ApplyActionToMediaItemApplyActionToMediaItemArrayApplyActionToMediaItemArray2ApplyFunctionToMediaItemArray
CheckMediaItemArrayCheckMediaItemStateChunkArrayCopyMediaItemToDestinationTrackGetAllMediaItemGUIDs
GetGapsBetweenItemsGetItem_ClickStateGetItem_HighestRecCounterGetItem_Number
GetMediaItemArrayLengthGetMediaItemStateChunkArrayLengthGetMediaItemStateChunksFromItemsGetMediaItemStateChunksFromMediaItemArray
GetMediafileAttributesGetParentTrack_MediaItemIsItemInTimerangeIsSplitAtPosition
IsValidMediaItemArrayIsValidMediaItemStateChunkIsValidMediaItemStateChunkArrayOnlyItemsInTracksAndTimerange
OnlyMediaItemsOfTracksInTrackstringOnlyMediaItemsOfTracksInTrackstring_StateChunkPreviewMediaFilePreviewMediaItem
StopAnyPreview  
Delete
DeleteMediaItemDeleteMediaItemsFromArrayDeleteMediaItems_PositionDeleteMediaItems_Position
   
Edit
RippleCutRippleCut_ReverseSectionCutSectionCut_Inverse
SplitItemsAtPositionFromArraySplitMediaItems_Position 
Get MediaItem States
GetItemAllTakesGetItemBeatGetItemChanModeGetItemFadeFlag
GetItemFadeInGetItemFadeOutGetItemGUIDGetItemGroup
GetItemIGUIDGetItemIIDGetItemLengthGetItemLock
GetItemLoopGetItemMixFlagGetItemMuteGetItemName
GetItemPlayRateGetItemPositionGetItemRecPassGetItemSampleOffset
GetItemSelectedGetItemSnapOffsetGetItemStateChunkGetItemUSTrackNumber_StateChunk
GetItemVolPan  
Get MediaItem-Takes
GetItemSourceFile_TakeGetMediaItemTake 
Get MediaItems
EnumerateMediaItemsInTrackGetAllLockedItemsFromMediaItemArrayGetAllMediaItemsGetAllMediaItemsBetween
GetAllMediaItemsFromTrackGetAllMediaItemsInTimeSelectionGetMediaItemsAtPosition
Insert
InsertImageFileInsertMediaItemArrayInsertMediaItemFromFileInsertMediaItemStateChunkArray
InsertMediaItem_MediaItemInsertMediaItem_MediaItemStateChunkRippleInsertRippleInsert_MediaItemStateChunks
   
Manipulate
AddLockStateToMediaItemStateChunkAddLockStateTo_MediaItemStateChunkArrayApplyStateChunkToItemsChangeDeltaLengthOfMediaItems_FromArray
ChangeDeltaOffsetOfMediaItems_FromArrayChangeLengthOfMediaItems_FromArrayChangeOffsetOfMediaItems_FromArrayMoveMediaItemsAfter_By
MoveMediaItemsBefore_ByMoveMediaItemsBetween_ToMoveMediaItems_FromArrayNormalizeItems
SetItemsLockState  
Selected Items
DeselectMediaItems_MediaItemArrayGetAllSelectedMediaItemsGetSelectedMediaItemsAtPositionGetSelectedMediaItemsBetween
SelectMediaItems_MediaItemArraySetMediaItemsSelected_TimeSelection 
Set MediaItem States
SetItemLengthSetItemPositionSetItemUSTrackNumber_StateChunkSetMediaItemStateChunk_in_TrackStateChunk
   
Spectral Edit
AddItemSpectralEditCountItemSpectralEditsDeleteItemSpectralEditGetItemSpectralConfig
GetItemSpectralEditGetItemSpectralVisibilityStateSetItemSpectralConfigSetItemSpectralEdit
SetItemSpectralVisibilityState  

Metadata Management

Extension States(Guid)
GetGuidExtStateSetGuidExtState 
Extension States
DeleteProjExtState_KeyDeleteProjExtState_SectionGetProjExtState_AllKeyValues

Miscellaneous

WinterlySnowflakes  

Mute Management

Muting tracks within envelope-lanes
CountMuteEnvelopePointsDeleteMuteStateDeleteMuteState_TrackObjectGetNextMuteState
GetNextMuteState_TrackObjectGetPreviousMuteStateGetPreviousMuteState_TrackObjectIsMuteAtPosition
IsMuteAtPosition_TrackObjectToggleMuteToggleMute_TrackObject

Navigation

CenterViewToCursorGetClosestGoToPointsGetClosestNextMarkerGetClosestNextRegionEdge
GetClosestPreviousMarkerGetClosestPreviousRegionEdgeGetLastCursorPositionGetLastLoopState
GetLastPlayStateGetNextClosestItemEdgeGetPreviousClosestItemEdgeJumpBackwardBy
JumpBackwardBy_RecordingJumpForwardByJumpForwardBy_RecordingSetPlayAndEditCursor_WhenPlaying
SetPlayCursor_WhenPlayingToggleScrollingDuringPlayback 
Transport
GetLoopStateSetLoopState 

Project-Files

Helper functions
GetProjectStateChunk  
RPP-Files Set
SetProject_GroupOverride  

Project-Management

Helper functions
CheckForChangedProjectTabsConvertOldProjectToCurrentReaperVersionCountProjectTabsCreateTemporaryFileOfProjectfile
EnumProjectsGetCurrentTimeLengthOfFrameGetLengthOfFramesGetProjectFilename
GetProject_LengthGetProject_LengthGetProject_TabsIsValidProjectStateChunk
IsValidReaProjectNewProjectTab 
RPP-Files Get
GetProject_AddMediaToProjectAfterRenderGetProject_ApplyFXCFGGetProject_AutoCrossFadeGetProject_CountMarkersAndRegions
GetProject_CountMasterHWOutsGetProject_CursorPosGetProject_DefPitchModeGetProject_EnvAttach
GetProject_ExtensionsGetProject_FeedbackGetProject_GetMarkerGetProject_GetRegion
GetProject_GlobalAutoGetProject_GridGetProject_GroupDisabledGetProject_GroupName
GetProject_GroupOverrideGetProject_HorizontalZoomGetProject_ItemMixBehaviorGetProject_Lock
GetProject_LoopGetProject_LoopGranGetProject_MarkersAndRegionsGetProject_MasterAutomode
GetProject_MasterDualPanEnv2StateChunkGetProject_MasterDualPanEnvL2StateChunkGetProject_MasterDualPanEnvLStateChunkGetProject_MasterDualPanEnvStateChunk
GetProject_MasterFXBypGetProject_MasterFXListStateChunkGetProject_MasterGroupFlagsHighStateGetProject_MasterGroupFlagsState
GetProject_MasterHWOutGetProject_MasterHWPanEnvStateChunkGetProject_MasterHWVolEnvStateChunkGetProject_MasterMuteSolo
GetProject_MasterNChansGetProject_MasterPanModeGetProject_MasterPanMode_ExGetProject_MasterPlayspeed
GetProject_MasterSelGetProject_MasterTrackColorGetProject_MasterTrackHeightGetProject_MasterTrackView
GetProject_MasterVolEnv2StateChunkGetProject_MasterVolEnv3StateChunkGetProject_MasterVolEnvStateChunkGetProject_MasterVolume
GetProject_MasterWidthGetProject_MaxProjectLengthGetProject_MetronomeGetProject_MixerUIFlags
GetProject_NumberOfTracksGetProject_PanLawGetProject_PanModeGetProject_PeakGain
GetProject_PlayrateGetProject_ProjOffsetsGetProject_ProjectBayGetProject_QRenderOriginalProject
GetProject_QRenderOutFilesGetProject_ReaperVersionGetProject_RecModeGetProject_RecPath
GetProject_RecordCFGGetProject_RenderCFGGetProject_RenderDitherStateGetProject_RenderFilename
GetProject_RenderFreqNChansGetProject_RenderPatternGetProject_RenderQueueDelayGetProject_RenderRange
GetProject_RenderResampleGetProject_RenderSpeedGetProject_RenderStemsGetProject_RippleState
GetProject_SMPTESyncGetProject_SampleRateGetProject_SelectionGetProject_TakeLane
GetProject_TempoGetProject_TempoEnvExGetProject_TempoEnv_ExStateChunkGetProject_TempoTimeSignature
GetProject_TimeBaseGetProject_TimemodeGetProject_TrackMixingDepthGetProject_TrackStateChunk
GetProject_UseRecConfigGetProject_VerticalZoomGetProject_VideoConfig
RPP-Files Set
SetProject_AddMediaToProjectAfterRenderSetProject_ApplyFXCFGSetProject_AutoCrossFadeSetProject_CursorPos
SetProject_DefPitchModeSetProject_EnvAttachSetProject_FeedbackSetProject_GlobalAuto
SetProject_GridSetProject_HorizontalZoomSetProject_ItemMixBehaviorSetProject_Lock
SetProject_LoopSetProject_LoopGranSetProject_MasterAutomodeSetProject_MasterSel
SetProject_MaxProjectLengthSetProject_MixerUIFlagsSetProject_PanLawSetProject_PanMode
SetProject_PeakGainSetProject_PlayrateSetProject_ProjOffsetsSetProject_RecMode
SetProject_RecPathSetProject_RecordCFGSetProject_RenderCFGSetProject_RenderDitherState
SetProject_RenderFilenameSetProject_RenderFreqNChansSetProject_RenderPatternSetProject_RenderQueueDelay
SetProject_RenderRangeSetProject_RenderResampleSetProject_RenderSpeedSetProject_RenderStems
SetProject_RippleStateSetProject_SMPTESyncSetProject_SampleRateSetProject_Selection
SetProject_TakeLaneSetProject_TempoSetProject_TempoTimeSignatureSetProject_TimeBase
SetProject_TimemodeSetProject_TrackMixingDepthSetProject_UseRecConfigSetProject_VerticalZoom
SetProject_VideoConfig  

ReaMote

AutoSearchReaMoteSlaves  

Reaper Element Positions

Reaper Window
ConvertClient2ScreenXCoordinate_ReaperWindowConvertScreen2ClientXCoordinate_ReaperWindowGetReaperWindowPosition_LeftGetReaperWindowPosition_Right
SetReaperWindowToSize  

Rendering Projects

Analyzing Renderstrings
GetOutputFormat_RenderCfgGetRenderCFG_Settings_AIFFGetRenderCFG_Settings_AVI_VideoGetRenderCFG_Settings_AudioCD
GetRenderCFG_Settings_DDPGetRenderCFG_Settings_FLACGetRenderCFG_Settings_GIFGetRenderCFG_Settings_LCF
GetRenderCFG_Settings_M4AMacGetRenderCFG_Settings_MKV_VideoGetRenderCFG_Settings_MOVMac_VideoGetRenderCFG_Settings_MP3
GetRenderCFG_Settings_MP3ABRGetRenderCFG_Settings_MP3CBRGetRenderCFG_Settings_MP3MaxQualityGetRenderCFG_Settings_MP3VBR
GetRenderCFG_Settings_MP4Mac_VideoGetRenderCFG_Settings_OGGGetRenderCFG_Settings_OPUSGetRenderCFG_Settings_QTMOVMP4_Video
GetRenderCFG_Settings_WAVGetRenderCFG_Settings_WAVPACKGetRenderCFG_Settings_WebMVideo
Assistance functions
ApplyRenderTable_ProjectApplyRenderTable_ProjectFileCreateNewRenderTableGetLastRenderPaths
GetLastUsedRenderPatternsGetRenderTable_ProjectGetRenderTable_ProjectFileIsReaperRendering
IsValidRenderTable  
Creating Renderstrings
CreateRenderCFG_AIFFCreateRenderCFG_AVI_VideoCreateRenderCFG_AudioCDCreateRenderCFG_DDP
CreateRenderCFG_FLACCreateRenderCFG_GIFCreateRenderCFG_LCFCreateRenderCFG_M4AMAC
CreateRenderCFG_MKV_VideoCreateRenderCFG_MOVMAC_VideoCreateRenderCFG_MP3ABRCreateRenderCFG_MP3CBR
CreateRenderCFG_MP3MaxQualityCreateRenderCFG_MP3VBRCreateRenderCFG_MP4MAC_VideoCreateRenderCFG_OGG
CreateRenderCFG_OpusCreateRenderCFG_QTMOVMP4_VideoCreateRenderCFG_WAVCreateRenderCFG_WAVPACK
CreateRenderCFG_WebMVideo  
Render Presets
AddRenderPresetDeleteRenderPreset_BoundsDeleteRenderPreset_FormatOptionsGetRenderPreset_Names
GetRenderPreset_RenderTableSetRenderPreset 
RenderQueue
AddProjectFileToRenderQueueAddSelectedItemsToRenderQueueGetRenderQueuedProjectsRenderProject_RenderQueue
   
Rendering any Outputformat
RenderProjectRenderProject_RegionsRenderProject_RenderTable

Track Management

Assistance functions
AddMediaItemStateChunk_To_TrackStateChunkApplyActionToTrackCountItemsInTrackStateChunkCreateTrackString
CreateTrackStringByGUIDCreateTrackStringByMediaTracksCreateTrackStringByTracknamesCreateTrackString_AllTracks
CreateTrackString_ArmedTracksCreateTrackString_SelectedTracksCreateTrackString_UnarmedTracksDeleteTracks_TrackString
GetAllMediaItemsFromTrackStateChunkGetItemStateChunkFromTrackStateChunkGetLengthOfAllMediaItems_TrackGetTrackLength
GetTracknumberByGuidInsertTrackAtIndexInsertTrack_TrackStateChunkInverseTrackstring
IsTrackObjectTracknumberIsValidTrackStateChunkIsValidTrackStringMoveTracks
OnlyTracksInBothTrackstringsOnlyTracksInOneTrackstringRemoveDuplicateTracksInTrackstringRemoveMediaItemByGUID_TrackStateChunk
RemoveMediaItemByIGUID_TrackStateChunkRemoveMediaItem_TrackStateChunk 
Get Track States
AnyTrackMuteGetAllLockedTracksGetAllSelectedTracksGetTrackAutoRecArmState
GetTrackAutomodeStateGetTrackBeatStateGetTrackBusCompStateGetTrackBypFXState
GetTrackFreeModeStateGetTrackGroupFlagsStateGetTrackGroupFlags_HighStateGetTrackHeightState
GetTrackIDGetTrackINQStateGetTrackIPhaseStateGetTrackIcon_Filename
GetTrackIsBusStateGetTrackLayoutNamesGetTrackLockStateGetTrackMIDIOutState
GetTrackMainSendStateGetTrackMidiBankProgFnGetTrackMidiCTLGetTrackMidiColorMapFn
GetTrackMidiInputChanMapGetTrackMidiTextStrFnGetTrackMuteSoloStateGetTrackNChansState
GetTrackNameGetTrackPanModeGetTrackPeakColorStateGetTrackPerfState
GetTrackRecCFGGetTrackRecStateGetTrackScoreGetTrackSelection_TrackStateChunk
GetTrackShowInMixStateGetTrackStateChunk_TracknumberGetTrackVUStateGetTrackVolPan
GetTrackWidthSetTrackSelection_TrackStateChunk 
Hardware Out
AddTrackHWOutApplyAllHWOutsAreHWOutsTablesEqualClearRoutingMatrix
CountTrackHWOutsDeleteTrackHWOutGetAllHWOutsGetTrackHWOut
SetTrackHWOut  
Send/Receive-Routing
AddTrackAUXSendReceivesApplyAllAUXSendReceivesApplyAllMainSendStatesAreAUXSendReceivesTablesEqual
AreMainSendsTablesEqualClearRoutingMatrixCountTrackAUXSendReceivesDeleteTrackAUXSendReceives
GetAllAUXSendReceivesGetAllMainSendStatesGetTrackAUXSendReceivesSetTrackAUXSendReceives
   
Set Track States
SetAllTracksSelectedSetTrackAutoRecArmStateSetTrackAutomodeStateSetTrackBeatState
SetTrackBusCompStateSetTrackBypFXStateSetTrackFreeModeStateSetTrackGroupFlagsState
SetTrackGroupFlags_HighStateSetTrackHeightStateSetTrackIDSetTrackINQState
SetTrackIPhaseStateSetTrackIcon_FilenameSetTrackIsBusStateSetTrackLayoutNames
SetTrackLockStateSetTrackMIDIOutStateSetTrackMainSendStateSetTrackMidiBankProgFn
SetTrackMidiCTLSetTrackMidiColorMapFnSetTrackMidiInputChanMapSetTrackMidiTextStrFn
SetTrackMuteSoloStateSetTrackNChansStateSetTrackNameSetTrackPanMode
SetTrackPeakColorStateSetTrackPerfStateSetTrackRecCFGSetTrackRecState
SetTrackScoreSetTrackShowInMixStateSetTrackStateChunk_TracknumberSetTrackVUState
SetTrackVolPanSetTrackWidthSetTracksSelectedSetTracksToLocked
SetTracksToUnlocked  

Ultraschall Specific

Followmode
pause_follow_one_cycle  
Routing
GetAllAUXSendReceives2GetAllHWOuts2GetAllMainSendStates2
Track Management
GetTypeOfTrackIsTrackSoundboardIsTrackStudioLinkIsTrackStudioLinkOnAir
   
Ultraschall.ini
CountUSExternalState_keyCountUSExternalState_secDeleteUSExternalStateEnumerateUSExternalState_key
EnumerateUSExternalState_secGetUSExternalStateSetUSExternalState

User Interface

Arrangeview Management
DeleteArrangeviewSnapshotGetVerticalScrollGetVerticalZoomIsValidArrangeviewSnapshot
RestoreArrangeviewSnapshotRetrieveArrangeviewSnapshotSetVerticalRelativeScrollSetVerticalScroll
SetVerticalZoomStoreArrangeviewSnapshot 
Context Menus
ShowMenu  
Dialogs
BrowseForOpenFilesGetUserInputsMB
Menu Management
ShowAutomationItemMenuShowEnvelopeMenuShowEnvelopePointMenuShowEnvelopePointMenu_AutomationItem
ShowMediaItemMenuShowRulerMenuShowTrackAreaMenuShowTrackInputMenu
ShowTrackPanelMenuShowTrackRoutingMenu 
Miscellaneous
ConvertYCoordsMac2WinGetIDEFontSizeGetTimeByMouseXPositionSetIDEFontSize
   
Reaper-Windowhandler
GetActionsHWNDGetBatchFileItemConverterHWNDGetConsolidateTracksHWNDGetExportProjectMIDIHWND
GetMediaExplorerHWNDGetPreferencesHWNDGetProjectDirectoryCleanupHWNDGetProjectSettingsHWND
GetRenderQueueHWNDGetRenderToFileHWNDGetRenderingToFileHWNDGetSaveLiveOutputToDiskHWND
GetSaveProjectAsHWNDGetVideoHWND 
Screen Management
GetScreenHeightGetScreenWidth 
Transport
GetPlayCursorWidthSetPlayCursorWidth 
UI-Elements
GetCheckboxStateSetCheckboxState 
Window Management
CloseReaScriptConsoleGetAllReaScriptIDEWindowsGetChildSizeWithinParentHWNDGetHWND_ArrangeViewAndTimeLine
GetReaScriptConsoleWindowGetReaperWindowAttributesGetTopmostHWNDHasHWNDChildWindowNames
IsValidHWNDMoveChildWithinParentHWNDWindows_Find


^ Reaper version 5.40Lua version 5.3 GetApiVersion

Functioncall:

string version, string date, string beta, number versionnumber, string tagline = ultraschall.GetApiVersion()

Description:
returns the version, release-date and if it's a beta-version plus the currently installed hotfix

Returnvalues:
 string version the current Api-version 
 string date the release date of this api-version 
 string beta if it's a beta version, this is the beta-version-number 
 number versionnumber a number, that you can use for comparisons like, "if requestedversion>versionnumber then" 
 string tagline the tagline of the current release 
 string hotfix_date the release-date of the currently installed hotfix ($ResourceFolder/ultraschall_api/ultraschall_hotfixes.lua) 



^ Reaper version 5.965Lua version 5.3 SuppressErrorMessages

Functioncall:

boolean retval = ultraschall.SuppressErrorMessages(boolean flag)

Description:
Allows you to suppress error-messages.
If you pass true, all error messages will be suppressed, until you run the function again passing false.

Note: You should supress error-messages only temprarily and "unsuppress" them again, after your critical stuff is finished.
Otherwise, someone using your functions will have no error-messages to debug with.

Returns false, if parameter isn't boolean. Unlike most other function, this will never create an error-message!

Returnvalues:
 boolean retval true, setting was successful; false, you didn't pass a boolean as parameter 

Parameters:
 boolean flag true, suppress error-messages; false, don't suppress error-messages 


^ Reaper version 5.965Lua version 5.3 AddErrorMessage

Functioncall:

boolean retval, integer errorcount = ultraschall.AddErrorMessage(string functionname, string parametername, string errormessage, integer errorcode)

Description:
Adds a new errormessage to the Ultraschall-Api-Error-messagesystem. Returns the number of the errormessage.
Intended for your own 3rd party-functions for the API, to give the user more feedback about errors than just a cryptic errorcode.

returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 
 integer errorcount the number of the errormessage within the Ultraschall-Api-Error-messagesystem; nil, if errormessages are suppressed currently 

Parameters:
 string functionname the function, where the error happened 
 string parametername the parameter, that caused the problem 
 string errormessage a longer description of what cause the problem and a hint to a possible solution 
 integer errorcode a number, that represents the error-message. Will be -1 by default, if not given. 


^ Reaper version 5.40Lua version 5.3 StartTime

Functioncall:

ultraschall.StartTime

Description:
Contains the correct starting time of the current instance of the Ultraschall-Framework, which probably means your script, that embeds the framework.




^ Reaper version 5.40Lua version 5.3 API_TempPath

Functioncall:

ultraschall.API_TempPath

Description:
Contains the path to the temp-folder of the Ultraschall-API.




^ Reaper version 5.40Lua version 5.3 Euro

Functioncall:

ultraschall.Euro

Description:
Holds the Euro-currency-symbol, which is hard to type in Reaper's own IDE.




^ Reaper version 5.40Lua version 5.3 ApiTest

Functioncall:

ultraschall.ApiTest()

Description:
Displays a message to show, which parts of the Ultraschall-API are turned on and which are turned off.




^ Reaper version 5.40Lua version 5.3 ToggleIDE_Errormessages

Functioncall:

boolean retval = ultraschall.ToggleIDE_Errormessages(optional boolean togglevalue)

Description:
Toggles or sets, if the error-messaging system shall output it's errors to Reaper's IDE(true) or not(false).
When set true, it will show the errormessages at the bottom of the IDE, as you are used by Reaper's own functions.

Returnvalues:
 boolean retval true, if errors will be shown at the bottom of the IDE; false, if not 

Parameters:
 optional boolean togglevalue true, if errormessages shall be shown at the bottom of the IDE, false if not. If omitted, it toggles what was set before. 


^ Reaper version 5.40Lua version 5.3 ReadErrorMessage

Functioncall:

boolean retval, integer errcode, string functionname, string parmname, string errormessage, string lastreadtime, string err_creation_date, string err_creation_timestamp = ultraschall.ReadErrorMessage(integer errornumber)

Description:
Reads an error-message within the Ultraschall-ErrorMessagesystem.
Returns a boolean value, the functionname, the errormessage, the "you've already read this message"-status, the date and a timestamp of the creation of the errormessage.
returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 
 integer errcode the errorcode of this message, as set by the function that created this errormessage; -1 is default value 
 string functionname the name of the function, where the problem happened 
 string parmname the parameter, that was used wrong by the programmer; "" if no parameter was involved in this error 
 string errormessage the message of the problem with a possible hint to a solution 
 string readstatus "unread" if the message hasn't been read yet or a date_time from when the message has been read already 
 string err_creation_date the date_time of when the error-message was created 
 string err_creation_timestamp the timestamp of when the error-message was created. Usually seconds, since system got started 

Parameters:
 integer errornumber the number of the error, beginning with 1. Use CountErrorMessages to get the current number of error-messages. 


^ Reaper version 5.40Lua version 5.3 DeleteErrorMessage

Functioncall:

boolean retval = ultraschall.DeleteErrorMessage(integer errornumber)

Description:
Deletes an error-message within the Ultraschall-ErrorMessagesystem.

returns false in case of failure

Returnvalues:
 boolean retval true, if such an error exists; false if it didn't 

Parameters:
 integer errornumber the number of the error to delete, beginning with 1. Use CountErrorMessages to get the current number of error-messages. 


^ Reaper version 5.40Lua version 5.3 GetLastErrorMessage

Functioncall:

boolean retval, integer errcode, string functionname, string parmname, string errormessage, string lastreadtime, string err_creation_date, string err_creation_timestamp, integer errorcounter = ultraschall.GetLastErrorMessage()

Description:
Reads the last error-message stored in the Ultraschall-ErrorMessagesystem.
Returns a boolean value, the functionname, the errormessage, the date and a timestamp of the creation of the errormessage, the unread-status as well as the error-message-number.
returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 
 integer errcode the errorcode of this message, as set by the function that created this errormessage; -1 is default value 
 string functionname the name of the function, where the problem happened 
 string parmname the parameter, that was used wrong by the programmer; "" if no parameter was involved in this error 
 string errormessage the message of the problem with a possible hint to a solution 
 string readstatus "unread" if the message hasn't been read yet or a date_time from when the message has been read already 
 string err_creation_date the date_time of when the error-message was created 
 string err_creation_timestamp the timestamp of when the error-message was created. Usually seconds, since system got started 
 integer errorcounter the error-message-number within the Ultraschall-Error-Message-System 

Parameters:
 integer errornumber the number of the error, beginning with 1. Use CountErrorMessages to get the current number of error-messages. 


^ Reaper version 5.40Lua version 5.3 DeleteLastErrorMessage

Functioncall:

boolean retval = ultraschall.DeleteLastErrorMessage()

Description:
Deletes the last error-message and returns a boolean value.
returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 



^ Reaper version 5.40Lua version 5.3 DeleteAllErrorMessages

Functioncall:

boolean retval = ultraschall.DeleteAllErrorMessages()

Description:
Deletes all error-messages and returns a boolean value.
returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 



^ Reaper version 5.40Lua version 5.3 GetLastErrorMessage2

Functioncall:

boolean retval, array ErrorMessages = ultraschall.GetLastErrorMessage2(integer count, boolean setread)

Description:
Returns an array with the last "count" errormessages. 1 for the last, 2 for the last 2, etc.
Set setread to false, if you want to retain the unread status of the error-messages.
returns false in case of failure

Returnvalues:
 boolean retval true, if it worked; false if it didn't 
 array ErrorMessages an array, that contains all values for the chosen number of errormessages.
The fields are ErrorMessages[errornumber][x], where x stands for
"errcode" - the errorcode of this function, default is -1
"funcname" - functionname
"parmname" - name of the parameter, that caused the error
"errmsg" - errormessage
"readstate" - readstatus
"date" - errorcreation date_time
"time" - errorcreation timestamp in seconds, usually seconds since computer has been started 

Parameters:
 integer count the number of the last few errors, you want to get returned. Use CountErrorMessages to get the current number of error-messages. 


^ Reaper version 5.40Lua version 5.3 CountErrorMessages

Functioncall:

integer errorcounter = ultraschall.CountErrorMessages()

Description:
Returns the current count of errormessages in the system available.

Returnvalues:
 integer errorcounter the number of errormessages currently available in the error-message-system. Includes read and unread ones. 



^ Reaper version 5.40Lua version 5.3 ShowLastErrorMessage

Functioncall:

ultraschall.ShowLastErrorMessage()

Description:
Displays the last error message in a messagebox, if existing and unread.




^ Reaper version 5.40Lua version 5.3 Separator

Functioncall:

ultraschall.Separator

Description:
Contains the correct separator for your system. / on Mac, \ on Windows. Use them, if you want to create windows and mac-compliant scripts that have file operations.




^ Reaper version 5.40Lua version 5.3 Api_Path

Functioncall:

ultraschall.Api_Path

Description:
Contains the current path of the Ultraschall-Api-folder ResourcePath/UserPlugins/ultraschall_api/




^ Reaper version 5.40Lua version 5.3 Api_InstallPath

Functioncall:

ultraschall.Api_InstallPath

Description:
Contains the current path to the installation folder of the Ultraschall-Api(usually Resourcesfolder/UserPlugins)




^ Reaper version 5.95Lua version 5.3 GetLastErrorMessage_Funcname

Functioncall:

integer errorindex, string parametername, string errormessage, integer errorcode = ultraschall.GetLastErrorMessage_Funcname(string functionname)

Description:
Returns the last errormessage, a certain function added to the Error-Messaging-System.
Sets read-state of the error-message to the date-time of accessing it.

returns -1 in case of error

Returnvalues:
 integer errorindex the index of the error within the Error-Messaging-System 
 string parametername the parameter that produced the problem, or "" if no parameter was involved 
 string errormessage the errormessage 
 integer errorcode the errorcode the error has 

Parameters:
 string functionname the name of the function, whose last error message you want to retrieve 


^ Reaper version 5.95Lua version 5.3 CountErrorMessage_Funcname

Functioncall:

integer number_of_errormessages = ultraschall.CountErrorMessage_Funcname(string functionname)

Description:
Returns the number of available errormessages for functionname, existing in the Error-Messaging-System.

returns -1 in case of error

Returnvalues:
 integer number_of_errormessages the number of errormessages functionname has left in the Error-Messaging-System 

Parameters:
 string functionname the name of the function, whose error messages you want to count 


^ Reaper version 5.95Lua version 5.3 GetErrorMessage_Funcname

Functioncall:

integer errorindex, string parametername, string errormessage, integer errorcode = ultraschall.GetErrorMessage_Funcname(string functionname, integer index)

Description:
Returns a specific errormessage specified by index, functionname added to the Error-Messaging-System.
Sets read-state of the error-message to the date-time of accessing it.

returns -1 in case of error

Returnvalues:
 integer errorindex the index of the error within the Error-Messaging-System 
 string parametername the parameter that produced the problem, or "" if no parameter was involved 
 string errormessage the errormessage 
 integer errorcode the errorcode the error has 

Parameters:
 string functionname the name of the function, whose last error message you want to retrieve 
 integer index the index of the error-message for functionname 


^ Reaper version 5.965Lua version 5.3 ShowErrorMessagesInReascriptConsole

Functioncall:

ultraschall.ShowErrorMessagesInReascriptConsole(boolean state)

Description:
Sets, if errormessages shall be shown in the ReaScript-Console immediately, when they happen.

Will show functionname, parametername, errorcode plus errormessage and the time the error has happened.


Parameters:
 boolean state true, show error-messages in the ReaScript-Console when they happen; false, don't show errormessages 


^ Reaper version 5.95Lua version 5.3 WinterlySnowflakes

Functioncall:

integer retval = ultraschall.WinterlySnowflakes(boolean toggle, number falling_speed, integer number_snowflakes)

Description:
Exchanges the gfx.update()-function with a variant, that displays falling snowflakes everytime it is called.

returns -1 in case of error

Returnvalues:
 integer retval returns -1 in case of a'JS_Window_ListFind' n error; 1, in case of success 

Parameters:
 boolean toggle true, toggles falling snow on; false, toggles falling snow off 
 number falling_speed the falling speed of the snowflakes, 1.3 is recommended 
 integer number_snowflakes the number of falling snowflakes at the same time on screen; 2000 is recommended 


^ Reaper version 5.965SWS version 2.9.7Lua version 5.3 GetHWInputs_Aliasnames

Functioncall:

integer number_of_aliases, table aliases = ultraschall.GetHWInputs_Aliasnames()

Description:
Returns the aliasnames and their associated channels of the currently selected audio-device.

The returned table is of the format
table[index][1] - the name of the alias
table[index][2] - the hardware-input-channel, associated to this aliasname

Returnvalues:
 integer number_of_aliases the number of aliases available 
 table aliases a table, that contains all alias-names and their associated Hardware-Input-channels 



^ Reaper version 5.965SWS version 2.9.7Lua version 5.3 GetHWOutputs_Aliasnames

Functioncall:

integer number_of_aliases, table aliases = ultraschall.GetHWOutputs_Aliasnames()

Description:
Returns the aliasnames and their associated channels of the currently selected audio-device.

The returned table is of the format
table[index][1] - the name of the alias
table[index][2] - the hardware-output-channel, associated to this aliasname

Returnvalues:
 integer number_of_aliases the number of aliases available 
 table aliases a table, that contains all alias-names and their associated Hardware-Output-channels 



^ Reaper version 5.95Lua version 5.3 GetProject_AutomationItemStateChunk

Functioncall:

string AutomationItemStateChunk = ultraschall.GetProject_AutomationItemStateChunk(string projectfilename_with_path, integer idx, optional string ProjectStateChunk)

Description:
returns the idx'th automation-item from a ProjectStateChunk.

It's the entry <POOLEDENV

returns nil in case of an error

Returnvalues:
 string AutomationItemStateChunk the statechunk of the idx'th automation-item 

Parameters:
 string projectfilename_with_path the projectfile+path, from which to get the automation-item-statechunk; nil to use ProjectStateChunk 
 integer idx the number of the requested automation-item from the ProjectStateChunk with 1 for the first AutomItem. 
 optional string ProjectStateChunk a statechunk of a project, usually the contents of a rpp-project-file 


^ Reaper version 5.95Lua version 5.3 GetProject_CountAutomationItems

Functioncall:

integer automation_items_count = ultraschall.GetProject_CountAutomationItems(string projectfilename_with_path, optional string ProjectStateChunk)

Description:
returns the number of automation-items available in a ProjectStateChunk.

It's the entry <POOLEDENV
                        
returns -1 in case of an error

Returnvalues:
 integer automation_items_count the number of automation-items 

Parameters:
 string projectfilename_with_path the projectfile+path, from which to get the automation-item-count; nil to use ProjectStateChunk 
 optional string ProjectStateChunk a statechunk of a project, usually the contents of a rpp-project-file; only used, when projectfilename_with_path=nil 


^ Reaper version 5.40Lua version 5.3 GetMediaItemsFromClipboard

Functioncall:

integer count, array MediaItemStateChunkArray = ultraschall.GetMediaItemsFromClipboard()

Description:
Returns the number of mediaitems and a MediaItemStateChunkArray of the mediaitems, as stored in the clipboard.

It does it by pasting the items at the end of the project, getting them and deleting them again.

Use sparsely and with care, as it uses a lot of resources!

Returnvalues:
 integer count the number of items in the clipboard 
 array MediaItemStatechunkArray the mediaitem-statechunks of the items in the clipboard. One entry for each mediaitem-statechunk. 



^ Reaper version 5.52SWS version 2.9.7Lua version 5.3 GetStringFromClipboard_SWS

Functioncall:

string clipboard_string = ultraschall.GetStringFromClipboard_SWS()

Description:
Returns the content of the clipboard as a string. Uses the SWS-function reaper.CF_GetClipboard, but does everything for you, that is needed for proper use of this function.

Returnvalues:
 string clipboard_string the content of the clipboard as a string 



^ Reaper version 5.95Lua version 5.3 PutMediaItemsToClipboard_MediaItemArray

Functioncall:

boolean retval = ultraschall.PutMediaItemsToClipboard_MediaItemArray(MediaItemArray MediaItemArray)

Description:
Puts the items in MediaItemArray into the clipboard.

Returns false in case of an error

Returnvalues:
 boolean retval true, if successful; false, if not 

Parameters:
 MediaItemArray MediaItemArray an array with all MediaItems, that shall be put into the clipboard 


^ Reaper version 5.52Lua version 5.3 ConvertColor

Functioncall:

integer colorvalue, boolean retval = ultraschall.ConvertColor(integer r, integer g, integer b)

Description:
converts r, g, b-values to native-system-color. Works like reaper's ColorToNative, but doesn't need |0x1000000 added.

returns color-value 0, and retval=false in case of an error

Returnvalues:
 integer colorvalue the native-system-color; 0 to 33554431 

Parameters:
 integer r the red colorvalue 
 integer g the green colorvalue 
 integer b the blue colorvalue 


^ Reaper version 5.52Lua version 5.3 ConvertColorReverse

Functioncall:

integer r, integer g, integer b, boolean retval = ultraschall.ConvertColorReverse(integer colorvalue)

Description:
converts a native-system-color to r, g, b-values.

returns 0,0,0,false in case of an error

Returnvalues:
 integer r the red colorvalue 
 integer g the green colorvalue 
 integer b the blue colorvalue 
 boolean retval true, color-conversion was successful; false, color-conversion was unsuccessful 

Parameters:
 integer colorvalue the native-system-color; 0 to 33554431 


^ Reaper version 5.40Lua version 5.3 RGB2Grayscale

Functioncall:

integer graycolor = ultraschall.RGB2Grayscale(integer red, integer green, integer blue)

Description:
converts rgb to a grayscale value. Works native on Mac as well on Windows, no color conversion needed.

returns nil in case of an error

Returnvalues:
 integer graycolor the gray color-value, generated from red,blue and green. 

Parameters:
 integer red red-value between 0 and 255. 
 integer green red-value between 0 and 255. 
 integer blue red-value between 0 and 255. 


^ Reaper version 5.40Lua version 5.3 ConvertColorToGFX

Functioncall:

number r, number g, number b, number a = ultraschall.ConvertColorToGFX(integer r, integer g, integer b, integer a)

Description:
converts red,green,blue,alpha-values from 0-255 range to 0-1 range, so these values can be used by Reaper-Lua's gfx.functions().

supports negative-values up from -255 to +255, so you can use the function as well for subtraction of colorvalues.

returns nil in case of error

Returnvalues:
 number r the converted red-value between -1 and +1; nil in case of error 
 number g the converted green-value between -1 and +1 
 number b the converted blue-value between -1 and +1 
 number a the converted alpha-value between -1 and +1 

Parameters:
 integer r the red-color-value between -255 and +255 
 integer g the green-color-value between -255 and +255 
 integer b the blue-color-value between -255 and +255 
 integer a the alpha-color-value between -255 and +255 


^ Reaper version 5.40Lua version 5.3 ConvertGFXToColor

Functioncall:

integer r, integer g, integer b, integer a = ultraschall.ConvertGFXToColor(number r, number g, number b, number a)

Description:
converts red,green,blue,alpha-values from 0-1 range to 0-255 range, so these values can be used by Reaper's normal color-value-functions.

supports negative-values up from -1 to +1, so you can use the function as well for subtraction of colorvalues.

returns nil in case of error

Returnvalues:
 integer r the red-color-value between -255 and +255 
 integer g the green-color-value between -255 and +255 
 integer b the blue-color-value between -255 and +255 
 integer a the alpha-color-value between -255 and +255 

Parameters:
 number r the converted red-value between -1 and +1; nil in case of error 
 number g the converted green-value between -1 and +1 
 number b the converted blue-value between -1 and +1 
 number a the converted alpha-value between -1 and +1 


^ Reaper version 5.95Lua version 5.3 CreateColorTable

Functioncall:

array ColorTable = ultraschall.CreateColorTable(integer startr, integer startg, integer startb, integer endr, integer endg, integer endb, integer number_of_steps)

Description:
Returns a colortable to be used by color-graphics-functions.

The colorvalue for start and end can be 0 to 255 or the other way round 255 to 0

Can be used by ApplyColorTableToTrackColors

returns nil in case of an error

Returnvalues:
 array ColorTable a colortable for the colors with the number of steps of your choice;
each indexentry holds entries "r"(0-255), "g"(0-255), "b"(0-255), "nativecolor" and "gfxr"(0-1), "gfxg"(0-1), "gfxb"(0-1). 

Parameters:
 integer startr start redvalue, between 0 and 255 
 integer startg start greenvalue, between 0 and 255  
 integer startb start bluevalue, between 0 and 255 
 integer endr end redvalue, between 0 and 255 
 integer endg end greenvalue, between 0 and 255 
 integer endb end bluevalue, between 0 and 255 
 integer number_of_steps the number of steps from the lowest to the highest r,g,b-color start/end-values 


^ Reaper version 5.95Lua version 5.3 CreateSonicRainboomColorTable

Functioncall:

array ColorTable = ultraschall.CreateSonicRainboomColorTable()

Description:
Returns a colortable in Ultraschall's standard-trackcolor-setting "Sonic Rainboom"-style.

Can be used by ApplyColorTableToTrackColors

Returnvalues:
 array ColorTable a colortable with all values for Ultraschall's track-color "Sonic Rainboom" 



^ Reaper version 5.95Lua version 5.3 IsValidColorTable

Functioncall:

boolean retval = ultraschall.IsValidColorTable(array ColorTable)

Description:
Checks for valid color-tables.

returns false in case of an error

Returnvalues:
 boolean retval true, if it's a valid ColorTable; false, if it's not a valid ColorTable 

Parameters:
 array ColorTable a table to check for being a valid ColorTable 


^ Reaper version 5.95Lua version 5.3 ApplyColorTableToTrackColors

Functioncall:

boolean retval = ultraschall.ApplyColorTableToTrackColors(array ColorTable, integer Spread, integer StartTrack, integer EndTrack)

Description:
Apply a ColorTable to Tracks, to colorize MediaTracks

ColorTables can be created by CreateColorTable

returns false in case of an error

Returnvalues:
 boolean retval true, adjusting track-colors was successful; false, adjusting track-colors was unsuccessful 

Parameters:
 array ColorTable the ColorTable to apply to the MediaTrackColors 
 integer Spread 0, apply ColorTable once; will return false, if fewer colors are in ColorTable available than tracks in the project
nil or 1, repeat the colors from the ColorTable over and over again over the tracks; means: if you have 10 tracks and 5 colors, the colors will fill track 1 to 5 and then again track 6 to 10
2, spread the colors from the ColorTable over all tracks equally 
 integer StartTrack the first track to colorize; nil, to use the first track in project 
 integer EndTrack the last track to colorize; nil, to use the last track in project 


^ Reaper version 5.95Lua version 5.3 ApplyColorTableToItemColors

Functioncall:

boolean retval = ultraschall.ApplyColorTableToItemColors(array ColorTable, integer Spread, MediaItemArray MediaItemArray)

Description:
Apply a ColorTable to MediaItems in a MediaItemArray, to colorize MediaItems

ColorTables can be created by CreateColorTable

returns false in case of an error

Returnvalues:
 boolean retval true, adjusting item-colors was successful; false, adjusting item-colors was unsuccessful 

Parameters:
 array ColorTable the ColorTable to apply to the MediaItemColors 
 integer Spread 0, apply ColorTable once; will return false, if fewer colors are in ColorTable available than items in the MediaItemArray
nil or 1, repeat the colors from the ColorTable over and over again over the item; means: if you have 10 items and 5 colors, the colors will fill items 1 to 5 and then again items 6 to 10
2, spread the colors from the ColorTable over all items equally 
 MediaItemArray MediaItemArray an array with all the MediaItems to colorize 


^ Reaper version 5.95Lua version 5.3 ChangeColorBrightness

Functioncall:

integer red, integer green, integer blue, boolean retval = ultraschall.ChangeColorBrightness(integer r, integer g, integer b, integer bright_r, optional integer bright_g, optional integer bright_b)

Description:
Changes brightness of a colorvalue. If you only set brightr without setting brightg and brightb, then the value for brightr will affect g and b as well.

If a color-value becomes >255 or <0, it will be set to 255 or 0 respectively.

returns color-value 0,0,0 and retval=false in case of an error

Returnvalues:
 integer red the new red-value 
 integer green the new green-value 
 integer blue the new blue-value 
 boolean retval true, color-calculation was successful; false, color-calculation was unsuccessful 

Parameters:
 integer r the red-value to be changed 
 integer g the green-value to be changed 
 integer b the blue-value to be changed 
 integer bright_r the change in brightness for the red-color; positive, brighter; negative, darker 
 optional integer bright_g the change in brightness for the green-color; positive, brighter; negative, darker; if nil, value in bright_r will be used 
 optional integer bright_b the change in brightness for the blue-color; positive, brighter; negative, darker; if nil, value in bright_r will be used 


^ Reaper version 5.95Lua version 5.3 ChangeColorContrast

Functioncall:

integer red, integer green, integer blue, boolean retval = ultraschall.ChangeColorContrast(integer r, integer g, integer b, integer Minimum_r, optional integer Maximum_r, optional integer Minimum_g, optional integer Maximum_g, optional integer Minimum_b, optional integer Maximum_b)

Description:
Changes contrast of a colorvalue.

Minimum will set the new minimal, Maximum will set the new maximum-brightness-level.
If you set Minimum to 0 and Maximum to 255, contrast will not change.

The lower you set Minimum/Maximum, the darker it becomes; the higher, the brighter it becomes.
The farther away Minimum is from Maximum, the stronger the contrast becomes; the closer Minimum is to Maximum, the weaker the contrast becomes.

If you only set Minimum_r and Maximum_r, then these values will be applied to g and b too.

If you omit/set to nil a Maximum-value; it's default value will be 255.

If a color-value becomes >255 or <0, it will be set to 255 or 0 respectively.

returns color-value 0,0,0 and retval=false in case of an error

Returnvalues:
 integer red the new red-value 
 integer green the new green-value 
 integer blue the new blue-value 
 boolean retval true, color-calculation was successful; false, color-calculation was unsuccessful 

Parameters:
 integer r the red-value to be changed 
 integer g the green-value to be changed 
 integer b the blue-value to be changed 
 integer Minimum_r the new minimum brightness of the contrast-range of the red-color 
 optional integer Maximum_r the new maximum brightness of the contrast-range of the red-color; if nil, it will be seen as 255 
 optional integer Minimum_g the new minimum brightness of the contrast-range of the green-color; if nil, it will use the value of Minimum_r 
 optional integer Maximum_g the new maximum brightness of the contrast-range of the green-color; if nil, it will be seen as 255 
 optional integer Minimum_b the new minimum brightness of the contrast-range of the blue-color; if nil, it will use the value of Minimum_r 
 optional integer Maximum_b the new maximum brightness of the contrast-range of the blue-color; if nil, it will be seen as 255 


^ Reaper version 5.95Lua version 5.3 ChangeColorSaturation

Functioncall:

integer red, integer green, integer blue, number median, boolean retval = ultraschall.ChangeColorSaturation(integer r, integer g, integer b, integer delta)

Description:
Changes saturation of a colorvalue by delta.

If a color-value becomes >255 or <0, it will be set to 255 or 0 respectively.

returns color-value 0,0,0 and retval=false in case of an error

Returnvalues:
 integer red the new red-value 
 integer green the new green-value 
 integer blue the new blue-value 
 number median the median-value, calculated from the the old red, green and blue, values (red+green+blue)/3, which is the basis for the brightness of the unsaturated value 
 boolean retval true, color-calculation was successful; false, color-calculation was unsuccessful 

Parameters:
 integer r the red-value to be changed 
 integer g the green-value to be changed 
 integer b the blue-value to be changed 
 integer delta the saturation/desaturation-value; negative, desaturates color; positive, saturates color 


^ Reaper version 5.95Lua version 5.3 ConvertColorToMac

Functioncall:

integer mac_colorvalue, boolean retval = ultraschall.ConvertColorToMac(integer red, integer green, integer blue)

Description:
Converts a colorvalue to the correct-native-colorvalue for Mac, no matter if you're using Mac, Windows or Linux.

returns 0, false in case of an error

Returnvalues:
 integer mac_colorvalue the Mac-native-colorvalue 
 boolean retval true, if conversion succeeded; false, if conversion failed 

Parameters:
 integer red the red-value of the color 
 integer green the green-value of the color 
 integer blue the blue-value of the color 


^ Reaper version 5.95Lua version 5.3 ConvertColorToWin

Functioncall:

integer win_linux_colorvalue, boolean retval = ultraschall.ConvertColorToWin(integer red, integer green, integer blue)

Description:
Converts a colorvalue to the correct-native-colorvalue for Windows/Linux, no matter if you're using Mac, Windows or Linux.

returns 0, false in case of an error

Returnvalues:
 integer win_linux_colorvalue the Windows/Linux-native-colorvalue 
 boolean retval true, if conversion succeeded; false, if conversion failed 

Parameters:
 integer red the red-value of the color 
 integer green the green-value of the color 
 integer blue the blue-value of the color 


^ Reaper version 5.95Lua version 5.3 ConvertColorFromMac

Functioncall:

integer red, integer green, integer blue, boolean retval = ultraschall.ConvertColorFromMac(integer mac_colorvalue)

Description:
Converts a native-colorvalue to the correct rgb-color-values for Mac, no matter if you're using Mac, Windows or Linux.

returns 0, 0, 0, false in case of an error

Returnvalues:
 integer red the red-value of the color 
 integer green the green-value of the color 
 integer blue the blue-value of the color 
 boolean retval true, if conversion succeeded; false, if conversion failed 

Parameters:
 integer mac_colorvalue the Mac-native-colorvalue 


^ Reaper version 5.95Lua version 5.3 ConvertColorFromWin

Functioncall:

integer red, integer green, integer blue, boolean retval = ultraschall.ConvertColorFromWin(integer win_colorvalue)

Description:
Converts a native-colorvalue to the correct rgb-color-values for Windows/Linux, no matter if you're using Mac, Windows or Linux.

returns 0, 0, 0, false in case of an error

Returnvalues:
 integer red the red-value of the color 
 integer green the green-value of the color 
 integer blue the blue-value of the color 
 boolean retval true, if conversion succeeded; false, if conversion failed 

Parameters:
 integer win_colorvalue the Windows/Linux-native-colorvalue 


^ Reaper version 5.40Lua version 5.3 SetIniFileExternalState

Functioncall:

boolean retval = ultraschall.SetIniFileExternalState(string section, string key, string value, string ini_filename_with_path)

Description:
Sets an external state into ini_filename_with_path. Returns false, if it doesn't work.

Returnvalues:
 boolean retval true, if setting the state was successful; false, if setting was unsuccessful 

Parameters:
 string section section of the external state. No = allowed! 
 string key key of the external state. No = allowed! 
 string value value for the key 
 string filename_with_path filename of the ini-file 


^ Reaper version 5.40Lua version 5.3 GetIniFileExternalState

Functioncall:

string value = ultraschall.GetIniFileExternalState(string section, string key, string ini_filename_with_path)

Description:
Gets an external state from ini_filename_with_path. Returns -1, if the file does not exist or parameters are invalid.

Returnvalues:
 integer entrylength the length of the returned value 
 string value the value stored in a section->key in a configuration-file 

Parameters:
 string section section of the external state 
 string key key of the external state. No = allowed! 
 string filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 CountIniFileExternalState_sec

Functioncall:

integer sectioncount = ultraschall.CountIniFileExternalState_sec(string ini_filename_with_path)

Description:
Count external-state-[sections] from an ini-configurationsfile.

Returns -1, if the file does not exist.

Returnvalues:
 integer sectioncount number of sections within an ini-configuration-file 

Parameters:
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 CountIniFileExternalState_key

Functioncall:

integer keyscount = ultraschall.CountIniFileExternalState_key(string section, string ini_filename_with_path)

Description:
Count external-state-keys within a specific section, in a ini_filename_with_path.

Returns -1, if file does not exist.

Returnvalues:
 integer keyscount number of keys with section within an ini-configuration-file 

Parameters:
 string section the section within the ini-filename 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 EnumerateIniFileExternalState_sec

Functioncall:

string sectionname = ultraschall.EnumerateIniFileExternalState_sec(integer number_of_section, string ini_filename_with_path)

Description:
Returns the numberth section in an ini_filename_with_path.

Returns nil, in case of an error.

Returnvalues:
 string sectionname the name of the numberth section in the ini-file 

Parameters:
 integer number_of_section the section within the ini-filename; 1, for the first section 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 EnumerateIniFileExternalState_key

Functioncall:

string keyname = ultraschall.EnumerateIniFileExternalState_key(string section, integer number, string ini_filename_with_path)

Description:
Returns the numberth key within a section in an ini_filename_with_path.

Returns nil, in case of an error.

Returnvalues:
 string keyname the name of the numberth key within section in the ini-file 

Parameters:
 string section the name of the section 
 integer number the number of the key within a section within the ini-filename, with 1 for the first key in the section 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 CountSectionsByPattern

Functioncall:

integer number_of_sections, string sectionnames = ultraschall.CountSectionsByPattern(string pattern, string ini_filename_with_path)

Description:
Counts the number of sections within an ini-file, that fit a specific pattern.

Uses "pattern"-string to determine, how often a section with a certain pattern exists. Good for sections, that have a number in them, like [section1], [section2], [section3].
Returns the number of sections, that include that pattern as well as a string, that includes the names of all such sections, separated by a comma.

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns -1, in case of an error.

Returnvalues:
 integer number_of_sections the number of sections, that fit the pattern 
 string sectionnames a string, like: [section1],[section8],[section99] 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 CountKeysByPattern

Functioncall:

integer number_of_keys, string sections_and_keys = ultraschall.CountKeysByPattern(string pattern, string ini_filename_with_path)

Description:
Counts the number of keys within an ini-file, that fit a specific pattern.

Uses "pattern"-string to determine, how often a key with a certain pattern exists. Good for keys, that have a number in them, like key1, key2, key3.
Returns the number of keys, that include the pattern, as well as a string with all [sections] that contain keys= with a pattern, separated by a , i.e. [section1],key1=,key2=,key3=,[section2],key1=,key4=

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns -1, in case of an error.

Returnvalues:
 integer number_of_keys the number of keys, that fit the pattern 
 string sections_and_keys a string, like: [section1],Key1=,Key2=,Key3=[section2],Key7= 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 CountValuesByPattern

Functioncall:

integer number_of_keys, string sections_and_keys = ultraschall.CountValuesByPattern(string pattern, string ini_filename_with_path)

Description:
Counts the number of values within an ini-file, that fit a specific pattern.

Uses "pattern"-string to determine, how often a value with a certain pattern exists. Good for values, that have a number in them, like value1, value2, value3
Returns the number of values, that include that pattern as well as a string, that contains the [sections] and the keys= and values , the latter that contain the pattern, separated by a comma
e.g. [section1], key1=, value, key4=, value, [section4], key2=, value

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns -1, in case of an error.

Returnvalues:
 integer number_of_values the number of values, that fit the pattern 
 string sections_keys_values a string, like: [section1],key1=,value,key4=,value,[section4],key2=,value 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 EnumerateSectionsByPattern

Functioncall:

string sectionname = ultraschall.EnumerateSectionsByPattern(string pattern, integer id, string ini_filename_with_path)

Description:
Returns the numberth section within an ini-file, that fits the pattern, e.g. the third section containing "hawaii" in it.

Uses "pattern"-string to determine if a section contains a certain pattern. Good for sections, that have a number in them, like section1, section2, section3
Returns the section that includes that pattern as a string, numbered by id.

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns nil, in case of an error.

Returnvalues:
 string sectionname a string, that contains the sectionname 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 integer id the number of section, that contains pattern 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 EnumerateKeysByPattern

Functioncall:

string keyname = ultraschall.EnumerateKeysByPattern(string pattern, string section, integer id, string ini_filename_with_path)

Description:
Returns the numberth key within a section in an ini-file, that fits the pattern, e.g. the third key containing "hawaii" in it.

Uses "pattern"-string to determine if a key contains a certain pattern. Good for keys, that have a number in them, like key1=, key2=, key3=
Returns the key that includes that pattern as a string, numbered by id.

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns nil, in case of an error.

Returnvalues:
 string keyname a string, that contains the keyname 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 string section the section, in which to look for the key 
 integer id the number of key, that contains pattern 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 EnumerateValuesByPattern

Functioncall:

string value, string keyname = ultraschall.EnumerateValuesByPattern(string pattern, string section, string id, string ini_filename_with_path)

Description:
Returns the numberth value(and it's accompanying key) within a section in an ini-file, that fits the pattern, e.g. the third value containing "hawaii" in it.

Uses "pattern"-string to determine if a value contains a certain pattern. Good for values, that have a number in them, like value1, value2, value3
Returns the value that includes that pattern as a string, numbered by id, as well as it's accompanying key.

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returns nil, in case of an error.

Returnvalues:
 string value the value that contains the pattern 
 string keyname a string, that contains the keyname 

Parameters:
 string pattern the pattern itself. Case sensitive. 
 string section the section, in which to look for the key 
 integer id the number of key, that contains pattern 
 string ini_filename_with_path filename of the ini-file 


^ Reaper version 5.40Lua version 5.3 GetKBIniFilepath

Functioncall:

string kb_ini_path = ultraschall.GetKBIniFilepath()

Description:
Returns the path and filename of the Reaper-kb.ini-file.

Returnvalues:
 string kb_ini_path path and filename of the reaper-kb.ini 



^ Reaper version 5.40Lua version 5.3 CountKBIniActions

Functioncall:

integer actions = ultraschall.CountKBIniActions(string filename_with_path)

Description:
Count the number of "ACT"-Actions of the Reaper-kb.ini-file.
Returns -1, if no such file exists.

Returnvalues:
 integer actions number of actions in the reaper-kb.ini 



^ Reaper version 5.40Lua version 5.3 CountKBIniScripts

Functioncall:

integer scripts = ultraschall.CountKBIniScripts(string filename_with_path)

Description:
Count the number of "SCR"-Scripts of the Reaper-kb.ini-file.
Returns -1, if no such file exists.

Returnvalues:
 integer scripts number of scripts in the reaper-kb.ini 



^ Reaper version 5.40Lua version 5.3 CountKBIniKeys

Functioncall:

integer keys = ultraschall.CountKBIniKeys(string filename_with_path)

Description:
Count the number of "KEY"-Keybindings of the Reaper-kb.ini-file.
Returns -1, if no such file exists.

Returnvalues:
 integer keys number of keys in the reaper-kb.ini 



^ Reaper version 5.40Lua version 5.3 GetKBIniActions

Functioncall:

integer consolidate, integer section, string ActionCommandID, string description, string ActionsToBeExecuted = ultraschall.GetKBIniActions(string filename_with_path, integer idx)

Description:
Get the states of "ACT"-Action number idx. Returns consolidate, section, ActionCommandID, description, ActionsToBeExecuted.
Returns -1, if no such entry or file exists.

Returnvalues:
 integer consolidate consolidate-state
1 consolidate undo points,
2 show in Actions-Menu,
3 consolidate undo points AND show in Actions Menu;
maybe 4 and higher? 

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 integer idx the number of the action to get, beginning with 1 for the first one 


^ Reaper version 5.40Lua version 5.3 GetKBIniScripts

Functioncall:

integer terminateinstance, integer section, string ActionCommandID, string description, string scriptfile = ultraschall.GetKBIniScripts(string filename_with_path, integer idx)

Description:
Get the states of "SCR"-Scripts number idx. Returns terminateinstance, section, ActionCommandID, description, scriptfile.
Returns -1, if no such entry or file exists.

Returnvalues:
 integer terminateinstance the state of terminating instances
4 - Dialogwindow appears(Terminate, New Instance, Abort), if another instance of a given script is started, that's already running
260 - always Terminate Instances, when an instance of the script is already running
516 - always start a New Instance of the script already running 

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 integer idx the number of the action to get, beginning with 1 for the first one 


^ Reaper version 5.40Lua version 5.3 GetKBIniKeys

Functioncall:

integer keytype_modifier_midichan, integer key_midinote, string ActionCommandID, integer section = ultraschall.GetKBIniKeys(string filename_with_path, integer idx)

Description:
Get the states of "KEY"-Keybinding-number idx, for MIDI/Key-bindings. Returns keytype_modifier_midichan, key_midinote, ActionCommandID, section.

For a detailed description in how KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini.

Returns -1, if no such entry or file exists.
Does not return OSC-keybindings, as they are stored in OSC/reaper-osc-actions.ini !
returns -1 in case of an error

Returnvalues:
 integer keytype_modifier_midichan Type of Keytype, modifier or midichannel
For a detailed description in how keytype/modifier in KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini
 integer key_midinote the key(like ASCII-Codes) or midinote.
For a detailed description in how key/midinotes in KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 integer idx the number of the action to get, beginning with 1 for the first one 


^ Reaper version 5.40Lua version 5.3 GetKBIniActionsID_ByActionCommandID

Functioncall:

string retval = ultraschall.GetKBIniActionsID_ByActionCommandID(filename_with_path, ActionCommandID)

Description:
Returns the indexnumber(s) of actions by ActionCommandIDs within a reaper-kb.ini.
Returns -1, if no such entry or file exists.

Returnvalues:
 string retval the ids of actions with ActionCommandID, separated by a , 

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 string ActionCommandID the ActionCommandID 


^ Reaper version 5.40Lua version 5.3 GetKBIniScripts_ByActionCommandID

Functioncall:

string retval = ultraschall.GetKBIniScripts_ByActionCommandID(filename_with_path, ActionCommandID)

Description:
Returns the indexnumber(s) of scripts by ActionCommandIDs within a reaper-kb.ini.
Returns nil, if no such entry or file exists.

Returnvalues:
 string retval the ids of scripts with ActionCommandID, separated by a , 

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 string ActionCommandID the ActionCommandID 


^ Reaper version 5.40Lua version 5.3 GetKBIniKeys_ByActionCommandID

Functioncall:

string retval = ultraschall.GetKBIniKeys_ByActionCommandID(filename_with_path, ActionCommandID)

Description:
Returns the indexnumber(s) of keys by ActionCommandIDs within a reaper-kb.ini.
Returns nil, if no such entry or file exists.

Returnvalues:
 string retval the ids of keys with ActionCommandID, separated by a , 

Parameters:
 string filename_with_path path and filename of the reaper-kb.ini 
 string ActionCommandID the ActionCommandID 


^ Reaper version 5.40Lua version 5.3 SetKBIniActions

Functioncall:

boolean retval, integer actionnumber = ultraschall.SetKBIniActions(string filename_with_path, integer consolidate, integer section, string ActionCommandID, string Description, string ActionCommandIDs, boolean replace)

Description:
Adds or sets(if it already exists) an "ACT"-action of a reaper-kb.ini.
Returns true/false when adding or setting worked/didn't work, as well as the action-number within the reaper-kb.ini

Needs a restart of Reaper for this change to take effect!

Returnvalues:
 boolean retval true, if adding/setting worked, false if it didn't 
 integer actionnumber the entrynumber within the reaper-kb.ini of this action 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer consolidate consolidation state of this action
1 consolidate undo points,
2 show in Actions-Menu,
3 consolidate undo points AND show in Actions Menu;
maybe 4 and higher? 


^ Reaper version 5.40Lua version 5.3 SetKBIniScripts

Functioncall:

boolean retval, integer scriptnumber = ultraschall.SetKBIniScripts(string filename_with_path, integer terminate, integer section, string ActionCommandID, string Description, string Scriptname, boolean replace)

Description:
Adds or sets(if it already exists) an "SCR"-script of a reaper-kb.ini.
Returns true/false when adding or setting worked/didn't work, as well as the script-number within the reaper-kb.ini

Needs a restart of Reaper for this change to take effect!

Returnvalues:
 boolean retval true, if adding/setting worked, false if it didn't 
 integer scriptnumber the entrynumber within the reaper-kb.ini of this script 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer terminate_state state of handling mulitple running scripts
4 - Dialogwindow appears(Terminate, New Instance, Abort), if another instance of a given script is started, that's already running
260 - always Terminate Instances, when an instance of the script is already running
516 - always start a New Instance of the script already running 


^ Reaper version 5.40Lua version 5.3 SetKBIniKeys

Functioncall:

boolean retval, integer keynumber = ultraschall.SetKBIniKeys(string filename_with_path, integer keytype_modifier_midichan, integer key_midinote, string ActionCommandID, integer section, boolean replace)

Description:
Adds or sets(if it already exists) a "KEY"-key of a reaper-kb.ini.
Returns true/false when adding or setting worked/didn't work, as well as the keybinding-number within the reaper-kb.ini.
Additional keybindings cannot share the same keytype_modifier_midichan, key_midinote and section at the same time, as every such keybind must be unique.

For a detailed description in how KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini.

Does not support OSC-keybindings, as they are stored in OSC/reaper-osc-actions.ini !

Needs a restart of Reaper for this change to take effect!

returns false in case of an error

Returnvalues:
 boolean retval true, if adding/setting worked, false if it didn't 
 integer scriptnumber the entrynumber within the reaper-kb.ini of this script 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer keytype_modifier_midichan Type of Keytype, modifier or midichannel
For a detailed description in how keytype/modifier in KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini
 integer key_midinote the key(like ASCII-Codes) or midinote.
For a detailed description in how key/midinotes in KEY-entries work, refer to Reaper-Filetype-Descriptions.html#Reaper-kb.ini
 string ActionCommandID the ActionCommandID associated with this shortcut. 
 integer section the section, in which this shortcut is used
0 - Main
100 - Main (alt recording)
32060 - MIDI Editor
32061 - MIDI Event List Editor
32062 - MIDI Inline Editor
32063 - Media Explorer 


^ Reaper version 5.40Lua version 5.3 DeleteKBIniActions

Functioncall:

boolean retval = ultraschall.DeleteKBIniActions(string filename_with_path, integer idx)

Description:
Deletes an "ACT"-action of a reaper-kb.ini.
Returns true/false when deleting worked/didn't work.

Needs a restart of Reaper for this change to take effect!

Returnvalues:
 boolean retval true, if deleting worked, false if it didn't 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer idx indexnumber of the action within the reaper-kb.ini 


^ Reaper version 5.40Lua version 5.3 DeleteKBIniScripts

Functioncall:

boolean retval = ultraschall.DeleteKBIniScripts(string filename_with_path, integer idx)

Description:
Deletes an "SCR"-script of a reaper-kb.ini.
Returns true/false when deleting worked/didn't work.

Needs a restart of Reaper for this change to take effect!

Returnvalues:
 boolean retval true, if deleting worked, false if it didn't 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer idx indexnumber of the script within the reaper-kb.ini 


^ Reaper version 5.40Lua version 5.3 DeleteKBIniKeys

Functioncall:

boolean retval = ultraschall.DeleteKBIniKeys(string filename_with_path, integer idx)

Description:
Deletes a "KEY"-keybinding of a reaper-kb.ini.
Returns true/false when deleting worked/didn't work.

Needs a restart of Reaper for this change to take effect!

Returnvalues:
 boolean retval true, if deleting worked, false if it didn't 

Parameters:
 string filename_with_path filename with path for the reaper-kb.ini 
 integer idx indexnumber of the keybinding within the reaper-kb.ini 


^ Reaper version 5.965Lua version 5.3 GetIniFileValue

Functioncall:

integer length_of_value, string value = ultraschall.GetIniFileValue(string section, string key, string errval, string inifile)

Description:
Gets a value from a key of an ini-file

returns -1 in case of an error

Returnvalues:
 integer length_of_value the length of the value in bytes 
 string value the value from the key-value-pair 



^ Reaper version 5.965SWS version 2.10.0.1Lua version 5.3 SetIniFileValue

Functioncall:

integer retval = ultraschall.SetIniFileValue(string section, string key, string value, string inifile)

Description:
Sets a value of a key in an ini-file

returns -1 in case of an error

Returnvalues:
 integer retval -1, in case of an error; 1, in case of success 



^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAcidImport

Functioncall:

integer retval = ultraschall.GetSetConfigAcidImport(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "When importing media"-dropdownlist, as set in the Media with embedded tempo information-section in Preferences -> Video/REX/Misc
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "acidimport", as well as the reaper.ini-entry "REAPER -> acidimport"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
-1, an error occured
  0, Adjust media to project tempo
  1, Import media at source tempo
  2, Always prompt when importing media with embedded tempo 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
-1, an error occured
  0, Adjust media to project tempo
  1, Import media at source tempo
  2, Always prompt when importing media with embedded tempo 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigActionMenu

Functioncall:

integer retval = ultraschall.GetSetConfigActionMenu(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Show recent actions"-entry, as set in the Actions-menu.
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "actionmenu", as well as the reaper.ini-entry "REAPER -> actionmenu"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, don't show recent actions - unchecked
1, show recent actions - checked 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, don't show recent actions - unchecked
1, show recent actions - checked 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAdjRecLat

Functioncall:

integer retval = ultraschall.GetSetConfigAdjRecLat(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Use audio driver reported latency"-checkbox, as set in Preferences -> Recording
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "adjreclat", as well as the reaper.ini-entry "REAPER -> adjreclat"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, don't use audio driver reported latency(off) - unchecked
1, don't use audio driver reported latency(on) - checked 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, don't use audio driver reported latency(off) - unchecked
1, don't use audio driver reported latency(on) - checked 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAdjRecManLat

Functioncall:

integer retval = ultraschall.GetSetConfigAdjRecManLat(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Output manual offset-samples"-inputbox, as set in Preferences -> Recording
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "adjrecmanlat", as well as the reaper.ini-entry "REAPER -> adjrecmanlat"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value; 0 to 2147483647; in samples 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value; 0 to 2147483647; in samples 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAfxCfg

Functioncall:

integer retval = ultraschall.GetSetConfigAfxCfg(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of the audioformat for "Apply FX, Glue, Freeze, etc", as set in the Project Settings->Media-dialog
Only sets the format, not the individual format-settings(like bitrate, etc)!
To keep the setting for new projects as standard-setting after restart of Reaper, set persist=true

This alters the configuration-variable "afxcfg", as well as the reaper.ini-entry "REAPER -> afxcfg"

returns -1 in case of an error

Returnvalues:
 integer retval the current/newly set audioformat
0, not set yet
1179012432, Video (ffmpeg/libav encoder)
1195984416, Video (GIF)
1279477280, Video (LCF)
1332176723, OGG Opus
1634297446, AIFF
1684303904, DDP
1718378851, FLAC
1769172768, Audio CD Image(CUE/BIN format)
1836069740, MP3 (encoder by LAME project)
1869047670, OGG Vorbis
2002876005, WAV
2004250731, WavPack lossless compressor 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the new set audioformat
1179012432, Video (ffmpeg/libav encoder)
1195984416, Video (GIF)
1279477280, Video (LCF)
1332176723, OGG Opus
1634297446, AIFF
1684303904, DDP
1718378851, FLAC
1769172768, Audio CD Image(CUE/BIN format)
1836069740, MP3 (encoder by LAME project)
1869047670, OGG Vorbis
2002876005, WAV
2004250731, WavPack lossless compressor 
 boolean persist true, this setting will be standard-setting for new projects after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAllStereoPairs

Functioncall:

integer retval = ultraschall.GetSetConfigAllStereoPairs(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Show non-standard stereo channel pairs(i.e Input2/Input3 etc)"-checkbox in the Channel naming/mapping-section, as set in Preferences -> Audio
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "allstereopairs", as well as the reaper.ini-entry "REAPER -> allstereopairs"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, don't show non standard stereo channel pairs(off) - unchecked
1, show non standard stereo channel pairs(on) - checked 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, don't show non standard stereo channel pairs(off) - unchecked
1, show non standard stereo channel pairs(on) - checked 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAlwaysAllowKB

Functioncall:

integer retval = ultraschall.GetSetConfigAlwaysAllowKB(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Allow keyboard commands even when mouse-editing"-checkbox, as set in Preferences -> General ->Advanced UI/system tweaks
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "alwaysallowkb", as well as the reaper.ini-entry "REAPER -> alwaysallowkb"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value; 0(don't allow) to 1(allow) 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value; 0 to 1 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigApplyFXTail

Functioncall:

integer retval = ultraschall.GetSetConfigApplyFXTail(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Tail length when using Apply FX to items"-inputbox in milliseconds, as set in Preferences -> Media
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "applyfxtail", as well as the reaper.ini-entry "REAPER -> applyfxtail"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value; 0 to 2147483647 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value; 0 to 2147483647 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAdjRecManLatIn

Functioncall:

integer retval = ultraschall.GetSetConfigAdjRecManLatIn(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Input manual offset-samples"-inputbox, as set in Preferences -> Recording
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "adjrecmanlatin", as well as the reaper.ini-entry "REAPER -> adjrecmanlatin"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAudioPrShift

Functioncall:

integer retval = ultraschall.GetSetConfigAudioPrShift(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Preserve pitch in audio items when changing master playrate", as set in the contextmenu of the master-playrate in the transport-area as well as toggled by action 40671(all sections)
This is a project-setting. That means, setting persist to true will have an effect on new projects create, but only after you restarted Reaper!

This alters the configuration-variable "audioprshift", as well as the reaper.ini-entry "REAPER -> audioprshift"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, don't preserve pitch - unchecked
1, preserve pitch - checked 

Parameters:
 boolean set true, set a new value; false, return the current value
0, don't preserve pitch - unchecked
1, preserve pitch - checked 
 integer setting the current/new setting-value 
 boolean persist true, this setting will be kept for new projects, but only after restart of Reaper; false, old standard-project-setting will be kept 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAudioCloseStop

Functioncall:

integer retval = ultraschall.GetSetConfigAudioCloseStop(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Close audio device when stopped and active(less responsive)"-checkbox, as set in Preferences -> Audio  
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "audioclosestop", as well as the reaper.ini-entry "REAPER -> audioclosestop"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAudioThreadPr

Functioncall:

integer retval = ultraschall.GetSetConfigAudioThreadPr(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Audio thread priority"-dropdownlist, as set in Preferences -> Device  
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "audiothreadpr", as well as the reaper.ini-entry "REAPER -> audiothreadpr"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
-1, ASIO Default / MMCSS Pro Audio / Time Critical  
0, Normal  
1, Above normal  
2, Highest  
3, Time Critical  
4, MMCSS / Time Critical   

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
-1, ASIO Default / MMCSS Pro Audio / Time Critical  
0, Normal  
1, Above normal  
2, Highest  
3, Time Critical  
4, MMCSS / Time Critical   
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAudioCloseTrackWnds

Functioncall:

integer retval = ultraschall.GetSetConfigAudioCloseTrackWnds(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Allow snap grid/track envelope/routing windows to stay open"-checkbox in Preferences -> General -> Advanced UI/system tweaks.  
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "autoclosetrackwnds", as well as the reaper.ini-entry "REAPER -> autoclosetrackwnds"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, it is allowed(on) - checked  
1, it is not allowed(off) - unchecked   

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, it is allowed(on) - checked  
1, it is not allowed(off) - unchecked   
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAutoMute

Functioncall:

integer retval = ultraschall.GetSetConfigAutoMute(boolean set, integer setting, boolean persist)

Description:
Gets/Sets the value of "Automute-dropdownlist in the section Mute"-settings, as set in Preferences -> Mute/Solo
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "automute", as well as the reaper.ini-entry "REAPER -> automute"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, No automatic muting  
1, Automatically mute master track  
2, Automatically mute any track   

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, No automatic muting  
1, Automatically mute master track  
2, Automatically mute any track   
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAutoMuteFlags

Functioncall:

integer retval = ultraschall.GetSetConfigAutoMuteFlags(boolean set, integer setting, boolean persist)

Description:
Sets the "Reset on playback start"-checkbox in section Mute-settings, as set in Preferences -> Mute/Solo  
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "automuteflags", as well as the reaper.ini-entry "REAPER -> automuteflags"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, Reset on playback start(on) - checked  
1, Reset on playback start(off) - unchecked   

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, Reset on playback start(on) - checked  
1, Reset on playback start(off) - unchecked   
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAutoSaveInt

Functioncall:

integer retval = ultraschall.GetSetConfigAutoSaveInt(boolean set, integer setting, boolean persist)

Description:
Sets the "Every x minutes"-inputbox from the Project saving-section, as set in Preferences -> Project.
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "autosaveint", as well as the reaper.ini-entry "REAPER -> autosaveint"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0 to 2147483647; in seconds; higher values become negative 

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0 to 2147483647 in seconds 
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetSetConfigAutoSaveMode

Functioncall:

integer retval = ultraschall.GetSetConfigAutoSaveMode(boolean set, integer setting, boolean persist)

Description:
Sets the "Every x minutes"-dropdownlist from the Project saving-section, as set in Preferences -> Project.
To keep the setting after restart of Reaper, set persist=true

This alters the configuration-variable "autosavemode", as well as the reaper.ini-entry "REAPER -> autosavemode"

returns -1 in case of an error

Returnvalues:
 integer retval the current/new setting-value
0, when not recording  
1, when stopped  
2, any time   

Parameters:
 boolean set true, set a new value; false, return the current value 
 integer setting the current/new setting-value
0, when not recording  
1, when stopped  
2, any time   
 boolean persist true, this setting will be kept after restart of Reaper; false, setting will be lost after exiting Reaper 


^ Reaper version 5.975SWS version 2.10.0.1Julian Sader's plugin version 0.972Lua version 5.3 SetRender_OfflineOnlineMode

Functioncall:

boolean retval = ultraschall.SetRender_OfflineOnlineMode(integer mode)

Description:
sets the current mode of the offline/online-render-dropdownlist from the Render to File-dialog

Returns false in case of an error

Returnvalues:
 boolean retval true, setting it was successful; false, setting it was unsuccessful 

Parameters:
 integer mode the mode, that you want to set
0, Full-speed Offline
1, 1x Offline
2, Online Render
3, Offline Render (Idle)
4, 1x Offline Render (Idle) 


^ Reaper version 5.975SWS version 2.10.0.1Julian Sader's plugin version 0.972Lua version 5.3 GetRender_OfflineOnlineMode

Functioncall:

integer mode = ultraschall.GetRender_OfflineOnlineMode()

Description:
gets the current mode of the offline/online-render-dropdownlist from the Render to File-dialog

Returnvalues:
 integer mode the mode, that is set
0, Full-speed Offline
1, 1x Offline
2, Online Render
3, Offline Render (Idle)
4, 1x Offline Render (Idle) 



^ Reaper version 5.975SWS version 2.10.0.1Julian Sader's plugin version 0.972Lua version 5.3 GetRender_ResampleMode

Functioncall:

integer mode = ultraschall.GetRender_ResampleMode()

Description:
gets the current mode of the "Resample mode (if needed)"-dropdownlist from the Render to File-dialog

Returnvalues:
 integer mode the mode, that is set
  0, Medium (64pt Sinc),
  1, Low (Linear Interpolation),
  2, Lowest (Point Sampling),
  3, Good(192pt Sinc),
  4, Better(384pt Sinc),
  5, Fast (IIR + Linear Interpolation),
  6, Fast (IIRx2 + Linear Interpolation),
  7, Fast (16pt sinc) - Default,
  8, HQ (512pt Sinc),
  9, Extreme HQ (768pt HQ Sinc) 



^ Reaper version 5.975SWS version 2.10.0.1Julian Sader's plugin version 0.972Lua version 5.3 SetRender_ResampleMode

Functioncall:

boolean retval = ultraschall.SetRender_ResampleMode(integer mode)

Description:
sets the current mode of the "Resample mode (if needed)"-dropdownlist from the Render to File-dialog

Returns false in case of an error

Returnvalues:
 boolean retval true, setting it was successful; false, setting it was unsuccessful 

Parameters:
 integer mode the mode, that is set
  0, Medium (64pt Sinc),
  1, Low (Linear Interpolation),
  2, Lowest (Point Sampling),
  3, Good(192pt Sinc),
  4, Better(384pt Sinc),
  5, Fast (IIR + Linear Interpolation),
  6, Fast (IIRx2 + Linear Interpolation),
  7, Fast (16pt sinc) - Default,
  8, HQ (512pt Sinc),
  9, Extreme HQ (768pt HQ Sinc) 


^ Reaper version 5.941SWS version 2.9.7Lua version 5.3 GetStartNewFileRecSizeState

Functioncall:

boolean start_new_files, boolean offset_file_switches, integer max_rec_size = ultraschall.GetStartNewFileRecSizeState()

Description:
Returns, if Reaper shall start a file after a specified amount of MegaBytes as well, if the fileswitches shall be offset when multitrack-recording and the maximum filesize before starting a new file.

see SetStartNewFileRecSizeState for setting the current settings.

Returnvalues:
 boolean start_new_files true, Reaper starts a new file, when a recorded file reaches max_rec_size; false, files are as long until recording stops 
 boolean offset_file_switches true, When recording multiple tracks, offset file switches for better performance; false, don't offset file-switches 
 integer max_rec_size the maximum length of a recorded file in MegaBytes, before Reaper shall start a new file; only applied when When recording multiple tracks, offset file switches for better performance=true 



^ Reaper version 5.941SWS version 2.9.7Lua version 5.3 SetStartNewFileRecSizeState

Functioncall:

boolean retval = ultraschall.SetStartNewFileRecSizeState(boolean start_new_files, boolean offset_file_switches, integer maxrecsize, boolean persist)

Description:
Sets, if Reaper shall start a file after a specified amount of MegaBytes as well, if the fileswitches shall be offset when multitrack-recording and the maximum filesize before starting a new file.

see GetStartNewFileRecSizeState for getting the current settings.

Returns false in case of an error

Returnvalues:
 boolean retval true, setting was successful; false, setting was unsuccessful 

Parameters:
 boolean start_new_files true, Reaper starts a new file, when a recorded file reaches max_rec_size; false, files are as long until recording stops 
 boolean offset_file_switches true, When recording multiple tracks, offset file switches for better performance; false, don't offset file-switches 
 integer max_rec_size the maximum length of a recorded file in MegaBytes, before Reaper shall start a new file; only applied when When recording multiple tracks, offset file switches for better performance=true 
 boolean persist true, set the setting to reaper.ini so it persists after restarting Reaper; false, set it only for the time, until Reaper is restarted 


^ Reaper version 5.965Lua version 5.3 GetDeferIdentifier

Functioncall:

string defer_identifier = ultraschall.GetDeferIdentifier(integer deferinstance, optional string scriptidentifier)

Description:
returns the identifier for a specific ultraschall-defer-function.

This defer-indentifier can be used to stop this defer-loop from the in- and outside of the script.
Be aware: This returns the defer-identifier even if the defer-loop in question isn't running currently!

returns nil in case of an error.

Returnvalues:
 string defer_identifier a specific and unique defer-identifier for this script-instance, of the format:
ScriptIdentifier: scriptfilename-guid.ext.deferXX
where XX is the defer-function-number. XX is between 1 and 20 



^ Reaper version 5.965Lua version 5.3 GetDeferRunState

Functioncall:

string defer_identifier = ultraschall.GetDeferRunState(integer deferinstance, optional string scriptidentifier)

Description:
returns the run-state of a Ultraschall-defer-loop in a specific scriptinstance

returns nil in case of an error.

Returnvalues:
 string defer_identifier a specific and unique defer-identifier for this script-instance, of the format:
ScriptIdentifier: scriptfilename-guid.ext.deferXX
where XX is the defer-function-number. XX is between 1 and 20 



^ Reaper version 5.965Lua version 5.3 Defer1

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer1(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 StopDeferCycle

Functioncall:

boolean retval = ultraschall.StopDeferCycle(string defer_identifier)

Description:
Stops a running ultraschall.Defer-instance of a script-instance.

returns false in case of an error

Returnvalues:
 boolean retval true, stopping this defer-cycle was successful; false, it wasn't successful 

Parameters:
 string defer_identifier the identifier of the defer-cycle of a script-instance 


^ Reaper version 5.965Lua version 5.3 Defer2

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer2(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer3

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer3(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer4

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer4(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer5

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer5(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer6

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer6(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer7

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer7(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer8

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer8(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer9

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer9(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer10

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer10(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer11

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer11(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer12

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer12(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer13

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer13(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer14

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer14(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer15

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer15(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer16

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer16(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer17

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer17(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer18

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer18(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer19

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer19(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.965Lua version 5.3 Defer20

Functioncall:

boolean retval, string defer_identifier = ultraschall.Defer20(function func, optional integer mode, optional number timer_counter)

Description:
runs a custom-defer-cycle, which can be individualized.

You can set, how often this script shall be run(every x defer-cycle or every x seconds) and even stop the defer-cycle from in- and outside of the script, using the defer_identifier.

Don't run this twice in your script. It you need more than one such defer-cycle, use

Defer1, Defer2, Defer3, Defer4, Defer5, Defer6, Defer7, Defer8, Defer9, Defer10,
Defer11, Defer12, Defer13, Defer14, Defer15, Defer16, Defer17, Defer18, Defer19, Defer20

where every such defer-instance can be controlled individually, including stopping it.
It will return, if the defer-cycle could be started and a defer-identifier, which can be used to stop it from the in/outside of the script-instance.

When this defer-instance is stopped, it will return true, nil, otherwise it will return true, defer_identifier

To stop such a defer-cycle, use StopDeferCycle

returns false in case of an error (e.g. already 1024 defer-cycles are running in the current script-instance)

Returnvalues:
 boolean retval true, running this defer-cycle was successful; false, it wasn't successful 
 string defer_identifier an identifier-string, that can be used to stop the defer-cycle 

Parameters:
 function func the function, you would love to defer to 
 optional integer mode 0 or nil, just run as regular defer-cycle
1, run the defer-cycle only every timer_counter-cycle
2, run the defer-cycle only every timer_counter-seconds 
 optional number timer_counter the timer for the defer-cycle
   mode=1: 1 and higher, the next defer-cycle that shall be used by function func. Use 1 for every cycle, 2 for every second cycle.
               30 cycles are approximately 1 second.
   mode=2: 0 and higher, the amount of seconds to wait, until the function func is run the next time. 


^ Reaper version 5.40Lua version 5.3 IsValidEnvStateChunk

Functioncall:

boolean valid = ultraschall.IsValidEnvStateChunk(string EnvelopeStateChunk)

Description:
returns, if a EnvelopeStateChunk is a valid statechunk

returns false, in case of an error

Returnvalues:
 boolean valid true, if the string is a valid statechunk; false, if not a valid statechunk 

Parameters:
 string EnvelopeStateChunk a string to check, if it's a valid EnvelopeStateChunk 


^ Reaper version 5.40Lua version 5.3 MoveTrackEnvelopePointsBy

Functioncall:

integer retval = ultraschall.MoveTrackEnvelopePointsBy(number startposition, number endposition, number moveby, MediaTrack MediaTrack, boolean cut_at_border)

Description:
Moves the envelopepoints between startposition and endposition by moveby in MediaTrack.
It moves all trackenvelope-points for all track-envelopes available.

Does NOT move item-envelopepoints!

Returns -1 in case of failure.

Returnvalues:
 integer retval -1 in case of failure 

Parameters:
 number startposition the startposition in seconds 
 number endposition the endposition in seconds 
 number moveby in seconds, negative values: move toward beginning of project, positive values: move toward the end of project 
 MediaTrack MediaTrack the MediaTrack object of the track, where the EnvelopsPoints shall be moved 
 boolean cut_at_border true, cut envelope-points, that would move outside section between startposition and endposition 


^ Reaper version 5.40Lua version 5.3 GetEnvelopePoint

Functioncall:

number time, number value, integer shape, number tension, boolean selected, number dBVal, array EnvelopePointObject = ultraschall.GetEnvelopePoint(integer Tracknumber, string EnvelopeName, integer idx)

Description:
Returns the values for the idxth envelope point in Tracknumber->EnvelopeName.

returns -1 in case of error

Returnvalues:
 number time the time of the envelope point 
 number value the raw-value of the envelope point 
 integer shape the shape of this envelope
0 - Linear
1 - Square
2 - Slow start/end
3 - Fast start
4 - Fast end
5 - Bezier 
 number tension the intensity of the tension of the shape 
 boolean selected true, if this point is selected; false if not 
 number dBVal the envelopevalue converted to dB 
 array EnvelopePointObject an array with all elements of an envelopepoint
[1] - TrackEnvelope-object
[2] - Envelope-idx, beginning with 0 for the first one
[3] - time
[4] - value
[5] - shape
[6] - tension
[7] - selected
[8] - dBValue converted from value 

Parameters:
 integer Tracknumber the number of the track, beginning with 1. Use 0 for Master Track. 
 string EnvelopeName the name of the envelope-lane 
 integer idx the number of the envelope-point, beginning with 0 


^ Reaper version 5.40Lua version 5.3 GetClosestEnvelopePointIDX_ByTime

Functioncall:

integer idxpre, array EnvelopePointObjectPre, integer idxpost, array EnvelopePointObjectPost = ultraschall.GetClosestEnvelopePointIDX_ByTime(integer Tracknumber, string EnvelopeName, number CheckTime)

Description:
Returns the idxs and EnvelopePointObject of the envelope-points closest to timeposition CheckTime
returns -1 in case of error

Returnvalues:
 integer idxpre the idx of the closest envelopepoint at or before CheckTime 
 array EnvelopePointObjectPre an EnvelopePointObject of idxpre 
 integer idxpost the idx of the closest envelopepoint after CheckTime 
 array EnvelopePointObjectPost an EnvelopePointObject of idxpost 

Parameters:
 integer Tracknumber the number of the track, beginning with 1. Use 0 for Master Track. 
 string EnvelopeName the name of the envelope-lane 
 number CheckTime the time in seconds to check for the closest envelope-points 


^ Reaper version 5.40Lua version 5.3 GetEnvelopePointIDX_Between

Functioncall:

string EnvelopeString, array EnvelopePointArray = ultraschall.GetEnvelopePointIDX_Between(integer Tracknumber, string EnvelopeName, number startposition, number endposition)

Description:
Returns a string and an EnvelopePointArray with all idx/EnvelopePointObjects of all envelopepoints between startposition and endposition in the EnvelopeName-lane.
returns -1 in case of error

Returnvalues:
 string EnvelopeString a string with all envelope-point-idx in the selection, separated by commas. 
 array EnvelopePointArray an array with all EnvelopePointObjects of all envelope-points in selection. 

Parameters:
 integer Tracknumber the number of the track. 1 for track 1, 2 for track 2, etc. 0 for Master-track. 
 string EnvelopeName the name of the envelope-lane, where you want to have the envelope-points of. 
 number startposition the startposition of the selection in seconds. Must be bigger than or equal 0. 
 number endposition the endposition of the selection in seconds. Must be bigger than startposition. 


^ Reaper version 5.40Lua version 5.3 CheckEnvelopePointObject

Functioncall:

boolean retval = ultraschall.CheckEnvelopePointObject(array EnvelopePointObject)

Description:
Checks, if EnvelopePointObject is valid or not.

returns false in case of an error

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointObject an array with all information of an envelope point 


^ Reaper version 5.40Lua version 5.3 IsValidEnvelopePointObject

Functioncall:

boolean retval = ultraschall.IsValidEnvelopePointObject(array EnvelopePointObject)

Description:
Checks, if EnvelopePointObject is valid or not.

returns false in case of an error

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointObject an array with all information of an envelope point 


^ Reaper version 5.40Lua version 5.3 SetEnvelopePoints_EnvelopePointObject

Functioncall:

boolean retval = ultraschall.SetEnvelopePoints_EnvelopePointObject(array EnvelopePointObject, boolean sort_in)

Description:
Sets an envelope-point, as defined in EnvelopePointObject.

returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointObject an array with all information of an envelope point 
 boolean sort_in set true, if setting multiple points at once and call Envelope_SortPoints when done. 


^ Reaper version 5.40Lua version 5.3 SetEnvelopePoints_EnvelopePointArray

Functioncall:

boolean retval = ultraschall.SetEnvelopePoints_EnvelopePointArray(array EnvelopePointArray, boolean sort_in)

Description:
Sets envelope-points, as defined in the EnvelopePointObjects, in the EnvelopePointArray.

returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointArray an array with all EnvelopePointObjects you want to insert 
 boolean sort_in set true, if setting multiple points at once and call Envelope_SortPoints when done. 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 DeleteEnvelopePoints_EnvelopePointObject

Functioncall:

boolean retval = ultraschall.DeleteEnvelopePoints_EnvelopePointObject(array EnvelopePointObject)

Description:
Deletes an envelope-point, as defined in EnvelopePointObject.

returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointObject an array with all information of an envelope point 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 DeleteEnvelopePoints_EnvelopePointArray

Functioncall:

boolean retval = ultraschall.DeleteEnvelopePoints_EnvelopePointArray(array EnvelopePointArray)

Description:
Deletes the envelope-points, as defined in the EnvelopePointObjects, in the EnvelopePointArray.
returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointArray an array with all EnvelopePointObjects you want to insert 


^ Reaper version 5.40Lua version 5.3 AddEnvelopePoints_EnvelopePointObject

Functioncall:

boolean retval = ultraschall.AddEnvelopePoints_EnvelopePointObject(array EnvelopePointObject, boolean sort_in)

Description:
Adds an envelope-point, as defined in EnvelopePointObject.
returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointObject an array with all information of an envelope point 
 boolean sort_in set true, if setting multiple points at once and call Envelope_SortPoints when done. 


^ Reaper version 5.40Lua version 5.3 AddEnvelopePoints_EnvelopePointArray

Functioncall:

boolean retval = ultraschall.AddEnvelopePoints_EnvelopePointArray(array EnvelopePointArray, boolean sort_in)

Description:
Adds the envelope-points, as defined in the EnvelopePointObjects, in the EnvelopePointArray.
returns true in case of success, false in case of failure.

Returnvalues:
 boolean retval true, if it's a valid EnvelopePointObject; false if not 

Parameters:
 array EnvelopePointArray an array with all EnvelopePointObjects you want to insert 
 boolean sort_in set true, if setting multiple points at once and call Envelope_SortPoints when done. 


^ Reaper version 5.40Lua version 5.3 CreateEnvelopePointObject

Functioncall:

boolean retval, array EnvelopePointObject = ultraschall.CreateEnvelopePointObject(TrackEnvelope TrackEnvelope, integer idx, number time, number value, integer shape, number tension, boolean selected)

Description:
Creates a new EnvelopePointObject, that can be used by other ultraschall-api-envelope-functions

returns false in case of error

Returnvalues:
 boolean retval false in case of error, true in case of success. 
 array EnvelopePointObject an array with all elements of the envelopepoint
[1] - TrackEnvelope-object
[2] - Envelope-idx, beginning with 0 for the first one
[3] - time
[4] - value
[5] - shape
[6] - tension
[7] - selected
[8] - dBValue converted from value 

Parameters:
 TrackEnvelope env the track-envelope, in which this EnvelopePointObject shall be 
 integer idx the number of the envelope-point, beginning with 0 
 number time the time of the envelope point in seconds 
 number value the raw-value of the envelope point 
 integer shape the shape of this envelope
0 - Linear
1 - Square
2 - Slow start/end
3 - Fast start
4 - Fast end
5 - Bezier 
 number tension the intensity of the tension of the shape 
 boolean selected true, if this point is selected; false if not 


^ Reaper version 5.40Lua version 5.3 CountEnvelopePoints

Functioncall:

integer envpoint_count = ultraschall.CountEnvelopePoints(integer Tracknumber, string EnvelopeName)

Description:
Counts and returns the number of envelope-points in track Tracknumber, envelopelane EnvelopeName.

returns -1 in case of error

Returnvalues:
 integer envpoint_count the number of envelope-points in requested track+envelope-lane 

Parameters:
 integer Tracknumber the number of the track, beginning with 1. Use 0 for Master Track. 
 string EnvelopeName the name of the envelope-lane 


^ Reaper version 5.52Lua version 5.3 SetEnvelopeHeight

Functioncall:

boolean retval, string TrackEnvelopeStateChunk = ultraschall.SetEnvelopeHeight(integer Height, boolean Compacted, TrackEnvelope TrackEnvelope, string TrackEnvelopeStateChunk)

Description:
Changes the Envelope-lane-height and compactible state of TrackEnvelope or TrackEnvelopeStateChunk.

returns false in case of an error

Returnvalues:
 boolean retval true in case of success; false in case of error 
 string TrackEnvelopeStateChunk the altered TrackEnvelopeStateChunk 

Parameters:
 integer Height the height of the envelopelane in pixels when not compacted. Reaper accepts 24-443 currently. Nil keeps old value. 
 boolean Compacted shall the envelopelane be compacted(true) or not(false). Nil keeps old value. 
 TrackEnvelope TrackEnvelope the TrackEnvelope to alter, or nil to use the TrackEnvelopeStateChunk instead 
 optional string TrackEnvelopeStateChunk the TrackEnvelopeStateChunk you want to alter. Will be used only, if TrackEnvelope is set to nil 


^ Reaper version 5.52Lua version 5.3 GetAllTrackEnvelopes

Functioncall:

array TrackEnvelopeArray, integer number_of_tracks, integer FirstEnvelopeTrackNumber, integer FirstEnvelopeMaster = ultraschall.GetAllTrackEnvelopes()

Description:
returns all TrackEnvelopes of the current project as a table, number of tracks, the first track that has an envelope, if the master track has an envelope(0) or not (-1)

Returnvalues:
 array TrackEnvelopeArray a table with all envelopes of the current project
the table works as follows:
TrackEnvelopeArray[Tracknumber][0] - number of envelopes for track Tracknumber
TrackEnvelopeArray[Tracknumber][1][Envelopenumber] - the envelope Envelopenumber of track Tracknumber

tracknumber of 0 is for the master track 
 integer number_of_tracks the number of tracks, covered in the TrackEnvelopeArray 
 integer FirstEnvelopeTrackNumber the number of the first track to have an envelope; -1 if theres none 
 integer FirstEnvelopeMaster 0, if the master-track has an envelope, -1 if not. 



^ Reaper version 5.941Lua version 5.3 IsValidEnvelopePointArray

Functioncall:

boolean retval = ultraschall.IsValidEnvelopePointArray(EnvelopePointArray EnvelopePointArray)

Description:
Checks, if an EnvelopePointArray is a valid one.

Returns false in case of an error

Returnvalues:
 boolean retval true, EnvelopePointArray is a valid one; false, EnvelopePointArray isn't valid 

Parameters:
 EnvelopePointArray EnvelopePointArray the EnvelopePointArray to check for it's validity 


^ Reaper version 5.975Lua version 5.3 GetLastEnvelopePoint_TrackEnvelope

Functioncall:

boolean retval, optional integer envpointidx, optional number time, optional number value, optional integer shape, optional number tension, optional boolean selected = ultraschall.GetLastEnvelopePoint_TrackEnvelope(TrackEnvelope Envelope)

Description:
Gets the values of the last envelope-point in TrackEnvelope/MediaItemEnvelope.

Note: there's a "hidden" last envelopepoint in every Envelope, which will be ignored by this function. It will return the last visible envelope-point instead!

Returns false in case of an error

Returnvalues:
 boolean retval true, getting the envelopepoint was successful; false, in case of an error 
 optional integer envpointidx the idx of the found envelope-point; with 0 for the first one on the Envelope 
 optional number time the time of the envelope-point in seconds 
 optional number value the value of the envelope-point 
 optional integer shape the shape of the envelope-point
0 - Linear
1 - Square
2 - Slow start/end
3 - Fast start
4 - Fast end
5 - Bezier 
 optional number tension the intensity of the tension of the shape 
 optional boolean selected true, envelope-point is selected; false, it is not selected 

Parameters:
 TrackEnvelope Envelope the Trackenvelope/MediaItemenvelope, whose last point you want 


^ Reaper version 5.95Lua version 5.3 GetArmState_Envelope

Functioncall:

integer retval = ultraschall.GetArmState_Envelope(TrackEnvelope TrackEnvelope, optional string EnvelopeStateChunk)

Description:
Returns the current armed-state of a TrackEnvelope-object.

returns nil in case of error

Returnvalues:
 integer retval 0, unarmed; 1, armed 

Parameters:
 TrackEnvelope TrackEnvelope the TrackEnvelope, whose armed-state you want to know; nil, to use parameter EnvelopeStateChunk instead 
 optional string EnvelopeStateChunk if TrackEnvelope is set to nil, you can pass an EnvelopeStateChunk into this parameter, to get that armed state 


^ Reaper version 5.95Lua version 5.3 SetArmState_Envelope

Functioncall:

boolean retval, optional string EnvelopeStateChunk = ultraschall.SetArmState_Envelope(TrackEnvelope TrackEnvelope, integer state, optional string EnvelopeStateChunk)

Description:
Sets the new armed-state of a TrackEnvelope-object.

returns false in case of error

Returnvalues:
 boolean retval true, setting was successful; false, setting was unsuccessful 
 optional string EnvelopeStateChunk the altered EnvelopeStateChunk, when parameter TrackEnvelope is set to nil 

Parameters:
 TrackEnvelope TrackEnvelope the TrackEnvelope, whose armed-state you want to change 
 integer state 0, unarmed; 1, armed 
 optional string EnvelopeStateChunk if parameter TrackEnvelope is set to nil, you can pass an EnvelopeStateChunk into this parameters and change its arm-state 


^ Reaper version 5.981SWS version 2.10.0.1Lua version 5.3 GetTrackEnvelope_ClickState

Functioncall:

boolean clickstate, number position, MediaTrack track, TrackEnvelope envelope, integer EnvelopePointIDX = ultraschall.GetTrackEnvelope_ClickState()

Description:
Returns the currently clicked Envelopepoint and TrackEnvelope, as well as the current timeposition.

Works only, if the mouse is above the EnvelopePoint while having it clicked!

Returns false, if no envelope is clicked at

Returnvalues:
 boolean clickstate true, an envelopepoint has been clicked; false, no envelopepoint has been clicked 
 number position the position, at which the mouse has clicked 
 MediaTrack track the track, from which the envelope and it's corresponding point is taken from 
 TrackEnvelope envelope the TrackEnvelope, in which the clicked envelope-point lies 
 integer EnvelopePointIDX the id of the clicked EnvelopePoint 



^ Reaper version 5.982Lua version 5.3 EventManager_EnumerateStartupEvents

Functioncall:

string EventIdentifier, string Eventname, string CallerScriptIdentifier, number CheckAllXSeconds, number CheckForXSeconds, boolean StartActionsOnceDuringTrue, function CheckFunction, number NumberOfActions, table Actions = ultraschall.EventManager_EnumerateStartupEvents(integer index)

Description:
Enumerates already existing startupevents, that shall be automatically run at startup of the Ultraschall Event Manager.

That means, if you start the EventManager, it will be started automatically to the EventManager-checking-queue, without the need of registering it by hand.

returns nil in case of an error

Returnvalues:
 string EventIdentifier the EventIdentifier of the startup-event 
 string EventName a name for the startupevent 
 string CallerScriptIdentifier the ScriptIdentifier of the script, which added this event to the StartUpEvents 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 function CheckFunction the function, which shall check if the event occurred 
 integer NumberOfActions the number of actions currently registered with this event 
 table Actions a table which holds all actions and their accompanying sections, who are run when the event occurred
each entry of the table is of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0" 

Parameters:
 integer index the index of the StartUp-event, whose attributes you want to get; 1 for the first, etc 


^ Reaper version 5.982Lua version 5.3 EventManager_EnumerateStartupEvents2

Functioncall:

integer index, string EventIdentifier, string Eventname, string CallerScriptIdentifier, number CheckAllXSeconds, number CheckForXSeconds, boolean StartActionsOnceDuringTrue, function CheckFunction, number NumberOfActions, table Actions = ultraschall.EventManager_EnumerateStartupEvents2(string EventIdentifier)

Description:
Enumerates already existing startupevents by an EventIdentifier.

StartupEvents are events, that shall be automatically run at startup of the Ultraschall Event Manager.
That means, if you start the EventManager, it will be started automatically to the EventManager-checking-queue, without the need of registering it by hand.

returns nil in case of an error

Returnvalues:
 integer index the index of the StartUp-event, whose attributes you want to get; 1 for the first, etc 
 string EventIdentifier the EventIdentifier of the startup-event 
 string EventName a name for the startupevent 
 string CallerScriptIdentifier the ScriptIdentifier of the script, which added this event to the StartUpEvents 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 function CheckFunction the function, which shall check if the event occurred 
 integer NumberOfActions the number of actions currently registered with this event 
 table Actions a table which holds all actions and their accompanying sections, who are run when the event occurred
each entry of the table is of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0" 

Parameters:
 string EventIdentifier the identifier of the StartupEvent, that you want to enumerate 


^ Reaper version 5.982Lua version 5.3 EventManager_AddEvent

Functioncall:

string event_identifier = ultraschall.EventManager_AddEvent(string EventName, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, table Actions)

Description:
Adds a new event to the Ultraschall Event Manager-checking-queue.

returns nil in case of an error

Returnvalues:
 string event_identifier the unique identifier for this registered event, which can be used later for setting, deleting, etc 

Parameters:
 string EventName a name for the event, which you can choose freely; duplicated eventnames are allowed 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 boolean EventPaused false, register the event and check for it immediately; true, register the event but don't check for it yet 
 function CheckFunction the function, which shall check if the event occurred
this function must return true if the event occurred and false, if not
No global variables allowed! Instead, the eventmanager will pass to it as first parameter a table which can be used for storing information 
 table Actions a table which holds all actions and their accompanying sections, who shall be run when the event occurred
each entry of the table must be of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0"

You can have as many actions as you like, but be aware, that running too many actions may delay further eventchecking! 


^ Reaper version 5.982Lua version 5.3 EventManager_IsValidEventIdentifier

Functioncall:

boolean valid, boolean valid_inuse = ultraschall.EventManager_IsValidEventIdentifier(string event_identifier)

Description:
Checks, if a string is a valid EventIdentifier (valid) and currently registered with an event(valid_inuse) in the Ultraschall-EventManager-checking-queue.

returns false in case of an error

Returnvalues:
 boolean valid true, valid EventIdentifier; false, no valid EventIdentifier 
 boolean valid_inuse true, valid EventIdentifier, which is currently registered and in use by the EventManager; false, no currently registered EventIdentifier 

Parameters:
 string event_identifier the unique identifier of the registered event, that you want to check 


^ Reaper version 5.982Lua version 5.3 Eventmanager_RemoveEvent

Functioncall:

boolean retval = ultraschall.Eventmanager_RemoveEvent(string event_identifier)

Description:
Removes a new event to the Ultraschall Event Manager-checking-queue.

returns false in case of an error

Returnvalues:
 boolean retval true, removing was successful; false, removing was unsuccessful 

Parameters:
 string event_identifier the unique identifier of the registered event, which you want to remove from the EventManager 


^ Reaper version 5.982Lua version 5.3 Eventmanager_RemoveAllEvents_Script

Functioncall:

boolean retval = ultraschall.Eventmanager_RemoveAllEvents_Script(string ScriptIdentifier)

Description:
Removes all registered events from a script with a certain ScriptIdentifier in the Ultraschall Event Manager-checking-queue.

returns false in case of an error

Returnvalues:
 boolean retval true, removing was successful; false, removing was unsuccessful 

Parameters:
 string ScriptIdentifier the unique identifier of the registered event, which you want to remove from the EventManager 


^ Reaper version 5.982Lua version 5.3 EventManager_SetEvent

Functioncall:

string event_identifier = ultraschall.EventManager_SetEvent(string EventIdentifier, string EventName, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, table Actions)

Description:
Sets the attributes of an already added event in the Ultraschall Event Manager-checking-queue.

returns nil in case of an error

Returnvalues:
 string event_identifier the unique identifier for this registered event, which can be used later for setting, deleting, etc 

Parameters:
 string EventIdentifier the EventIdentifier of the registered event, which you want to set 
 string EventName a name for the event, which you can choose freely; duplicated eventnames are allowed 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 boolean EventPaused false, register the event and check for it immediately; true, register the event but don't check for it yet 
 function CheckFunction the function, which shall check if the event occurred
this function must return true if the event occurred and false, if not
No global variables allowed! Instead, the eventmanager will pass to the function as first parameter a table which can be used for storing information 
 table Actions a table which holds all actions and their accompanying sections, who shall be run when the event occurred
each entry of the table must be of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0"

You can have as many actions as you like, but be aware, that running too many actions may delay further eventchecking! 


^ Reaper version 5.982Lua version 5.3 EventManager_EnumerateEvents

Functioncall:

string EventIdentifier, string EventName, string CallerScriptIdentifier, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, integer NumberOfActions, table Actions = ultraschall.EventManager_EnumerateEvents(integer id)

Description:
Gets the attributes of an already added event in the Ultraschall Event Manager-checking-queue.

returns nil in case of an error

Returnvalues:
 string EventIdentifier the EventIdentifier of the registered event 
 string EventName the name of the event 
 string CallerScriptIdentifier the ScriptIdentifier of the script, who registered the event 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once
    false, run until the CheckFunction returns false again 
 boolean EventPaused true, eventcheck is currently paused; false, eventcheck is currently running 
 function CheckFunction the function, which shall check if the event occurred, as Base64-encoded string 
 integer NumberOfActions the number of actions currently registered with this event 
 table Actions a table which holds all actions and their accompanying sections, who are run when the event occurred
each entry of the table is of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0" 

Parameters:
 integer id the id of the currently registered event, of which you want to have the attributes; starting with 1 for the first 


^ Reaper version 5.982Lua version 5.3 EventManager_EnumerateEvents2

Functioncall:

string EventIdentifier, string EventName, string CallerScriptIdentifier, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, integer NumberOfActions, table Actions = ultraschall.EventManager_EnumerateEvents2(string EventIdentifier)

Description:
Gets the attributes of an already added event in the Ultraschall Event Manager-checking-queue.

returns nil in case of an error

Returnvalues:
 string EventIdentifier the EventIdentifier of the registered event 
 string EventName the name of the event 
 string CallerScriptIdentifier the ScriptIdentifier of the script, who registered the event 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once
    false, run until the CheckFunction returns false again 
 boolean EventPaused true, eventcheck is currently paused; false, eventcheck is currently running 
 function CheckFunction the function, which shall check if the event occurred, as Base64-encoded string 
 integer NumberOfActions the number of actions currently registered with this event 
 table Actions a table which holds all actions and their accompanying sections, who are run when the event occurred
each entry of the table is of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0" 

Parameters:
 string Eventidentifier the id of the currently registered event, of which you want to have the attributes; starting with 1 for the first 


^ Reaper version 5.982Lua version 5.3 EventManager_CountRegisteredEvents

Functioncall:

integer count_of_registered_events = ultraschall.EventManager_CountRegisteredEvents()

Description:
Returns the number of currently registered events in the EventManager-checking-queue

Returnvalues:
 integer count_of_registered_events the number of currently registered events 



^ Reaper version 5.982Lua version 5.3 EventManager_PauseEvent

Functioncall:

boolean retval = ultraschall.EventManager_PauseEvent(string event_identifier)

Description:
Pauses a registered event in the Ultraschall Event Manager-checking-queue.

returns false in case of an error

Returnvalues:
 boolean retval true, pausing was successful; false, pausing was unsuccessful 

Parameters:
 string event_identifier the unique identifier of the registered event, which you want to pause in the EventManager 


^ Reaper version 5.982Lua version 5.3 EventManager_ResumeEvent

Functioncall:

boolean retval = ultraschall.EventManager_ResumeEvent(string event_identifier)

Description:
Resumes a registered and paused event in the Ultraschall Event Manager-checking-queue.

returns false in case of an error

Returnvalues:
 boolean retval true, resuming was successful; false, resuming was unsuccessful 

Parameters:
 string event_identifier the unique identifier of the registered event, which you want to resume in the EventManager 


^ Reaper version 5.982Lua version 5.3 EventManager_Start

Functioncall:

ultraschall.EventManager_Start()

Description:
Starts the Ultraschall-EventManager, if it has not been started yet.




^ Reaper version 5.982Lua version 5.3 EventManager_Stop

Functioncall:

ultraschall.EventManager_Stop(optional boolean force, optional string ScriptIdentifier)

Description:
Unregisters the current script; will stop the EventManager if no scripts are registered anymore to the EventManager.

You can use the parameter force to force stopping of the EventManager immediately.


Parameters:
 optional boolean force true, stops the EventManager, even if other scripts have registered events to it; false or nil, don't force stop 
 optional string ScriptIdentifier if you want to unregister events from a different script, pass here the ScriptIdentifier of this script; nil, use the ScriptIdentifier of the current script 


^ Reaper version 5.982Lua version 5.3 EventManager_AddStartupEvent

Functioncall:

string event_identifier = ultraschall.EventManager_AddStartupEvent(string EventName, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, table Actions)

Description:
Adds a new event, that shall be automatically registered at startup of the Ultraschall Event Manager.

That means, if you start the EventManager, it will be added automatically to the EventManager-checking-queue, without the need of registering it by hand.

returns nil in case of an error

Returnvalues:
 string event_identifier the unique identifier for this registered event, which can be used later for setting, deleting, etc 

Parameters:
 string EventName a name for the event, which you can choose freely; duplicated eventnames are allowed 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 boolean EventPaused false, register the event and check for it immediately; true, register the event but don't check for it yet 
 function CheckFunction the function, which shall check if the event occurred
this function must return true if the event occurred and false, if not
No global variables allowed! Instead, the eventmanager will pass to the function as first parameter a table which can be used for storing information 
 table Actions a table which holds all actions and their accompanying sections, who shall be run when the event occurred
each entry of the table must be of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0"

You can have as many actions as you like, but be aware, that running too many actions may delay further eventchecking! 


^ Reaper version 5.982Lua version 5.3 EventManager_RemoveStartupEvent2

Functioncall:

boolean retval = ultraschall.Eventmanager_RemoveEvent2(integer id)

Description:
Removes a startup-event from the config-file of the Ultraschall Event Manager.

returns false in case of an error

Returnvalues:
 boolean retval true, removing was successful; false, removing was unsuccessful 

Parameters:
 string event_identifier the unique identifier of the startup event, which you want to remove from the EventManager-startup-procedure 


^ Reaper version 5.982Lua version 5.3 EventManager_RemoveStartupEvent

Functioncall:

boolean retval = ultraschall.EventManager_RemoveStartupEvent(string event_identifier)

Description:
Removes a startup-event from the config-file of the Ultraschall Event Manager.

returns false in case of an error

Returnvalues:
 boolean retval true, removing was successful; false, removing was unsuccessful 

Parameters:
 string event_identifier the unique identifier of the startup event, which you want to remove from the EventManager-startup-procedure 


^ Reaper version 5.982Lua version 5.3 EventManager_CountStartupEvents

Functioncall:

integer count_startup_events = ultraschall.EventManager_CountStartupEvents()

Description:
Counts the currently available startup-events

Returnvalues:
 integer count_startup_events the number of currently available start-up-events for the EventManager 



^ Reaper version 5.982Lua version 5.3 EventManager_SetStartupEvent

Functioncall:

string event_identifier = ultraschall.EventManager_SetStartupEvent(string EventIdentifier, string EventName, integer CheckAllXSeconds, integer CheckForXSeconds, boolean StartActionsOnceDuringTrue, boolean EventPaused, function CheckFunction, table Actions)

Description:
Sets an already existing startupevent, that shall be automatically run at startup of the Ultraschall Event Manager.

That means, if you start the EventManager, it will be started automatically to the EventManager-checking-queue, without the need of registering it by hand.

returns nil in case of an error

Returnvalues:
 string event_identifier the unique identifier for this registered event, which can be used later for setting, deleting, etc 

Parameters:
 string EventIdentifier the EventIdentifier of the startup-event, which you want to set 
 string EventName a name for the event, which you can choose freely; duplicated eventnames are allowed 
 integer CheckAllXSeconds only check all x seconds; 0, for constant checking
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 integer CheckForXSeconds only check for x seconds; 0, check until the event is removed
this value will be used as approximate time, not necessarily exact. That means, 2 seconds given may be 2.5 in some cases!
This is due general limitations with backgroundscripts. 
 boolean StartActionsOnceDuringTrue if the event occurred:
    true, run the actions only once;
    false, run until the CheckFunction returns false again 
 boolean EventPaused false, register the event and check for it immediately; true, register the event but don't check for it yet 
 function CheckFunction the function, which shall check if the event occurred
this function must return true if the event occurred and false, if not
No global variables allowed! Instead, the eventmanager will pass to the function as first parameter a table which can be used for storing information 
 table Actions a table which holds all actions and their accompanying sections, who shall be run when the event occurred
each entry of the table must be of the format "actioncommandid,section", e.g.:

Actions[1]="1007,0"
Actions[2]="1012,0"

You can have as many actions as you like, but be aware, that running too many actions may delay further eventchecking! 


^ Reaper version 5.40Lua version 5.3 ReadFullFile

Functioncall:

string contents, integer length_of_file, integer number_of_lines = ultraschall.ReadFullFile(string filename_with_path, boolean binary)

Description:
Return contents of filename_with_path.

Returns nil in case of an error.

Returnvalues:
 string contents the contents of the whole file. 
 integer length_of_file the number of bytes of the file 
 integer number_of_lines number of lines in file (-1 if parameter binary is set to true) 

Parameters:
 string filename_with_path filename of the file to be read 
 boolean binary true if the file shall be read as a binary file; false if read as ASCII. Default is ASCII. 


^ Reaper version 5.40Lua version 5.3 ReadValueFromFile

Functioncall:

string contents, string linenumbers, integer numberoflines, integer number_of_foundlines = ultraschall.ReadValueFromFile(string filename_with_path, string value)

Description:
Return contents of filename_with_path.

If "value" is given, it will return all lines, containing the value in the file "filename_with_path".
The second line-numbers return-value is very valuable when giving a "value". "Value" is not case-sensitive.
The value can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

Returnvalues:
 string contents the contents of the file, or the lines that contain parameter value in it, separated by a newline 
 string linenumbers a string, that contains the linenumbers returned as a , separated csv-string 
 integer numberoflines_in_file the total number of lines in the file 
 integer number_of_foundlines the number of found lines 

Parameters:
 string filename_with_path filename of the file to be read 
 string value the value to look in the file for. Not case-sensitive. 


^ Reaper version 5.40Lua version 5.3 ReadLinerangeFromFile

Functioncall:

string contents, boolean correctnumberoflines, integer number_of_lines = ultraschall.ReadLinerangeFromFile(string filename_with_path, integer firstlinenumber, integer lastlinenumber)

Description:
Return contents of filename_with_path, from firstlinenumber to lastlinenumber. Counting of linenumbers starts with 1 for the first line.
The returned string contains all requested lines, separated by a newline.

Returns nil, if the linenumbers are invalid.

Returnvalues:
 string contents the contents the lines of the file, that you requested 
 boolean correctnumberoflines true, if the number of lines are returned, as requested; false if fewer lines are returned 
 integer number_of_lines the number of read lines 

Parameters:
 string filename_with_path filename of the file to be read 
 integer firstlinenumber the first linenumber to be returned. First line in the file begins with 1! 
 integer lastlinenumber the last linenumber to be returned; -1, for the whole file 


^ Reaper version 5.40Lua version 5.3 MakeCopyOfFile

Functioncall:

boolean retval = ultraschall.MakeCopyOfFile(string input_filename_with_path, string output_filename_with_path)

Description:
Copies input_filename_with_path to output_filename_with_path.
Only textfiles! For binary-files use MakeCopyOfFile_Binary() instead!

Returns true, if it worked, false if it didn't.

Returnvalues:
 boolean retval true, if copy worked, false if it didn't. 

Parameters:
 string input_filename_with_path filename of the file to copy 
 string output_filename_with_path filename of the copied file to be created. 


^ Reaper version 5.40Lua version 5.3 MakeCopyOfFile_Binary

Functioncall:

boolean retval = ultraschall.MakeCopyOfFile_Binary(string input_filename_with_path, string output_filename_with_path)

Description:
Copies input_filename_with_path to output_filename_with_path as binary-file.

returns false in case of an error

Returnvalues:
 boolean retval returns true, if copy worked; false if it didn't 

Parameters:
 string input_filename_with_path filename of the file to copy 
 string output_filename_with_path filename of the copied file, that shall be created 


^ Reaper version 5.40Lua version 5.3 ReadBinaryFileUntilPattern

Functioncall:

integer length, string content = ultraschall.ReadBinaryFileUntilPattern(string input_filename_with_path, string pattern)

Description:
Returns a binary file, up until a pattern. The pattern is not case-sensitive.

Pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

returns false in case of an error

Returnvalues:
 integer length the length of the returned data 
 string content the content of the file, that has been read until pattern 

Parameters:
 string filename_with_path filename of the file to be read 
 string pattern a pattern to search for. Case-sensitive. 


^ Reaper version 5.40Lua version 5.3 ReadBinaryFileFromPattern

Functioncall:

integer length, string content = ultraschall.ReadBinaryFileFromPattern(string input_filename_with_path, string pattern)

Description:
Returns a binary file, from pattern onwards. The pattern is not case-sensitive.

The pattern can also contain patterns for pattern matching. Refer the LUA-docs for pattern matching.
i.e. characters like ^$()%.[]*+-? must be escaped with a %, means: %[%]%(%) etc

returns false in case of an error

Returnvalues:
 integer length the length of the returned data 
 string content the content of the file, that has been read from pattern to the end 

Parameters:
 string filename_with_path filename of the file to be read 
 string pattern a pattern to search for. Case-sensitive. 


^ Reaper version 5.40Lua version 5.3 CountLinesInFile

Functioncall:

integer linesinfile = ultraschall.CountLinesInFile(string filename_with_path)

Description:
Counts lines in a textfile. In binary files, the number of lines may be weird and unexpected!
Returns -1, if no such file exists.

Returnvalues:
 integer linesinfile number of lines in a textfile; -1 in case of error 

Parameters:
 string filename_with_path filename of the file to be read 


^ Reaper version 5.40Lua version 5.3 ReadFileAsLines_Array

Functioncall:

array contents, boolean correctnumberoflines, integer number_of_lines = ultraschall.ReadFileAsLines_Array(string filename_with_path, integer firstlinenumber, integer lastlinenumber)

Description:
Return contents of filename_with_path, from firstlinenumber to lastlinenumber as an array. Counting of linenumbers starts with 1 for the first line.
The returned array contains all requested lines, which each entry holding one returned line.

Returns nil, if the linenumbers are invalid.

Returnvalues:
 array contents the contents the lines of the file, that you requested as an array, in which each entry hold one line of the file 
 boolean correctnumberoflines true, if the number of lines are returned, as you requested; false if fewer lines are returned 
 integer number_of_lines the number of lines returned 

Parameters:
 string filename_with_path filename of the file to be read 
 integer firstlinenumber the first linenumber to be returned. First line in the file begins with 1! 
 integer lastlinenumber the last linenumber to be returned; -1, read all lines in the file 


^ Reaper version 5.40Lua version 5.3 ReadBinaryFile_Offset

Functioncall:

integer length, string content = ultraschall.ReadBinaryFile_Offset(string input_filename_with_path, integer startoffset, integer numberofbytes)

Description:
Returns the contents of a binary file from startoffset until startoffset+numberofbytes.

When setting startoffset to a negative value, it will read from the end of the file, means:
-100 will start -100 characters before the end of the file and numberofbytes will read from that point on    

Returns false, if file can not be opened.

Returnvalues:
 integer length the length of the returned part of the file, might be shorter than requested, if file ends before 
 string content the content of the file, that has been read 

Parameters:
 string input_filename_with_path filename of the file to be read 
 integer startoffset the offset, at where to begin the fileread. 0 for the beginning of the file; negative values set offset from the end of the file 
 integer numberofbytes the number of bytes to read. -1 for until the end of the file. If there are fewer bytes than requested, the returned string will be shorter. 


^ Reaper version 5.40Lua version 5.3 GetLengthOfFile

Functioncall:

integer lengthoffile = ultraschall.GetLengthOfFile(string filename_with_path)

Description:
Returns the length of the file filename_with_path in bytes.
Will return -1, if no such file exists.

Returnvalues:
 integer lengthoffile the length of the file in bytes. -1 in case of error 

Parameters:
 string filename_with_path filename to write the value to 


^ Reaper version 5.77Lua version 5.3 CountDirectoriesAndFilesInPath

Functioncall:

integer filecount, integer dircount = ultraschall.CountDirectoriesAndFilesInPath(string path)

Description:
returns the number of files and directories in path

returns -1, in case of error

Returnvalues:
 integer filecount the number of files found in path 
 integer dircount the number of directories found in path 

Parameters:
 string path the path to count the files and directories from 


^ Reaper version 5.77Lua version 5.3 GetAllFilenamesInPath

Functioncall:

integer filecount, array files = ultraschall.GetAllFilenamesInPath(string path)

Description:
returns the number of files and the filenames in path

returns -1, in case of error

Returnvalues:
 integer filecount the number of files found in path 
 array files the filenames found in path 

Parameters:
 string path the path to get the filenames from 


^ Reaper version 5.77Lua version 5.3 GetAllDirectoriesInPath

Functioncall:

integer filecount, array directories = ultraschall.GetAllDirectoriesInPath(string path)

Description:
returns the number of directories and the directorynames in path

returns -1, in case of error

Returnvalues:
 integer filecount the number of directories found in path 
 array files the directories found in path 

Parameters:
 string path the path to get the directories from 


^ Reaper version 5.40Lua version 5.3 CheckForValidFileFormats

Functioncall:

string fileformat, boolean supported_by_reaper, string mediatype = ultraschall.CheckForValidFileFormats(string filename_with_path)

Description:
Returns the fileformat of a Reaper-supported-file, images, audios(opus and m4a missing, though!), and video(mp4-video missing, though!).
Note: Checks the file itself and does not check for correct file-extension. Reaper needs the correct file-extension or it can't read an otherwise valid imagefile.
      For example: if you want to import a GIF, renamed to filename.JPG, Reaper will not be able to read it. Only when the extension is the same as the file itself(filename.GIF).

Returns nil in case of an error

Returnvalues:
 string fileformat the format of the file; JPG, PNG, GIF, LCF, ICO, WAV, AIFF, ASF/WMA/WMV, MP3, MP3 -ID3TAG, FLAC, MKV/MKA/MKS/MK3D/WEBM, AVI, RPP_PROJECT, unknown 
 boolean supported_by_reaper true, if importing of the fileformat is supported by Reaper; false, if not 
 string mediatype the type of the media; Image, Audio, Audio/Video, Video, Reaper 

Parameters:
 string filename_with_path the file to check for it's image-fileformat 


^ Reaper version 5.77Lua version 5.3 DirectoryExists

Functioncall:

boolean retval = ultraschall.DirectoryExists(string path, string directory)

Description:
Checks, if a directory exists in path.

On Linux: path and directory are case-sensitive!

Returns false in case of error.

Returnvalues:
 boolean retval true, directory exists; false, directory does not exist 

Parameters:
 string path the path, in which to look for the existence of parameter directory 
 string directory the name of the directory to check for in path 


^ Reaper version 5.95Lua version 5.3 OnlyFilesOfCertainType

Functioncall:

integer foundfilecount, array foundfilearray = ultraschall.OnlyFilesOfCertainType(array filearray, string filetype)

Description:
Returns the filenames_with_path from a filearray, that are of a certain filetype

returns -1 in case of an error

Returnvalues:
 integer foundfilecount the number of files that contain the right filetype 
 array foundfilearray an array with all the files that contain the right filetype 

Parameters:
 array filearray an array with files to check for; index is 1-based 
 string fileformat the format of the file; JPG, PNG, GIF, LCF, ICO, WAV, AIFF, ASF/WMA/WMV, MP3, MP3 -ID3TAG, FLAC, MKV/MKA/MKS/MK3D/WEBM, AVI, RPP_PROJECT, unknown 


^ Reaper version 5.95Lua version 5.3 GetReaperWorkDir

Functioncall:

string current_workdir = ultraschall.GetReaperWorkDir()

Description:
returns the current workdir, which is the directory. If you create a file without giving a path, this file will be created in this work-dir.

Returnvalues:
 string current_workdir the current workdir of Reaper 



^ Reaper version 5.95Lua version 5.3 DirectoryExists2

Functioncall:

boolean retval = ultraschall.DirectoryExists2(string Path)

Description:
returns, if Path is an existing path.

returns false in case of an error

Returnvalues:
 boolean retval true, if path exists; false, if not 

Parameters:
 string Path the path to check for 


^ Reaper version 5.95Lua version 5.3 SetReaperWorkDir

Functioncall:

boolean retval = ultraschall.SetReaperWorkDir(string Path)

Description:
sets a new current working directory for Reaper. This requires a restart of Reaper to take effect, due API-limitations!
                        
returns false in case of an error

Returnvalues:
 boolean retval true, if path could be set; false, if not 

Parameters:
 string Path the path to set as new current working directory 


^ Reaper version 5.40Lua version 5.3 GetPath

Functioncall:

string path, string filename = ultraschall.GetPath(string str, optional string sep)

Description:
returns the path of a filename-string

returns "", "" in case of error

Returnvalues:
 string path the path as a string 
 string filename the filename, without the path 

Parameters:
 string str the path with filename you want to process 
 string sep a separator, with which the function knows, how to separate filename from path; nil to use the last useful separator in the string, which is either / or \\ 


^ Reaper version 5.40Lua version 5.3 CreateValidTempFile

Functioncall:

string tempfilename = ultraschall.CreateValidTempFile(string filename_with_path, boolean create, string suffix, boolean retainextension)

Description:
Tries to determine a valid temporary filename. Will check filename_with_path with an included number between 0 and 16384 to create such a filename.
You can also add your own suffix to the filename.

The pattern is: filename_with_path$Suffix~$number.ext (when retainextension is set to true!)

If you wish, you can also create this temporary-file as an empty file.

The path of the tempfile is always the same as the original file.

Returns nil in case of failure.

Returnvalues:
 string tempfilename the valid temporary filename found 

Parameters:
 string filename_with_path the original filename 
 boolean create true, if you want to create that temporary file as an empty file; false, just return the filename 
 string suffix if you want to alter the temporary filename with an additional suffix, use this parameter 
 boolean retainextension true, keep the extension(if existing) at the end of the tempfile; false, just add the suffix~number at the end. 


^ Reaper version 5.40Lua version 5.3 WriteValueToFile

Functioncall:

integer retval = ultraschall.WriteValueToFile(string filename_with_path, string value, optional boolean binarymode, optional boolean append)

Description:
Writes value to filename_with_path. Will replace any previous content of the file if append is set to false. Returns -1 in case of failure, 1 in case of success.

returns -1 in case of an error

Returnvalues:
 integer retval -1 in case of failure, 1 in case of success 

Parameters:
 string filename_with_path the filename with it's path 
 string value the value to export, can be a long string that includes newlines and stuff. nil is not allowed! 
 boolean binarymode true or nil, it will store the value as binary-file; false, will store it as textstring 
 boolean append true, add the value to the end of the file; false or nil, write value to file and erase all previous data in the file 


^ Reaper version 5.40Lua version 5.3 WriteValueToFile_Insert

Functioncall:

integer retval = ultraschall.WriteValueToFile_Insert(string filename_with_path, integer linenumber, string value)

Description:
Inserts value into a file at linenumber. All lines, up to linenumber-1 come before value, all lines at linenumber to the end of the file will come after value.
Will return -1, if no such line exists.

Note: non-binary-files only!

Returnvalues:
 integer retval 1, in case of success, -1 in case of error 

Parameters:
 string filename_with_path filename to write the value to 
 integer linenumber the linenumber, at where to insert the value into the file 
 string value the value to be inserted into the file 


^ Reaper version 5.40Lua version 5.3 WriteValueToFile_Replace

Functioncall:

integer retval = ultraschall.WriteValueToFile_Replace(string filename_with_path, integer startlinenumber, integer endlinenumber, string value)

Description:
Replaces the linenumbers startlinenumber to endlinenumber in a file with value. All lines, up to startlinenumber-1 come before value, all lines at endlinenumber+1 to the end of the file will come after value.
Will return -1, if no such lines exists.

Note: non-binary-files only!

Returnvalues:
 integer retval 1, in case of success, -1 in case of error 

Parameters:
 string filename_with_path filename to write the value to 
 integer startlinenumber the first linenumber, to be replaced with value in the file 
 integer endlinenumber the last linenumber, to be replaced with value in the file 
 string value the value to be inserted into the file 


^ Reaper version 5.40Lua version 5.3 WriteValueToFile_InsertBinary

Functioncall:

integer retval = ultraschall.WriteValueToFile_InsertBinary(string filename_with_path, integer byteposition, string value)

Description:
Inserts value into a file at byteposition. All bytes, up to byteposition-1 come before value, all bytes at byteposition to the end of the file will come after value.
Will return -1, if no such line exists.

Note: good for binary files

Returnvalues:
 integer retval 1, in case of success, -1 in case of error 

Parameters:
 string filename_with_path filename to write the value to 
 integer byteposition the byteposition, at where to insert the value into the file 
 string value the value to be inserted into the file 


^ Reaper version 5.40Lua version 5.3 WriteValueToFile_ReplaceBinary

Functioncall:

integer retval = ultraschall.WriteValueToFile_ReplaceBinary(string filename_with_path, integer startbyteposition, integer endbyteposition, string value)

Description:
Replaces content in the file from startbyteposition to endbyteposition-1 with value. All bytes, up to startbyteposition-1 come before value, all bytes from (and including)endbyteposition to the end of the file will come after value.
Will return -1, if no such line exists.

Note: good for binary files

Returnvalues:
 integer retval 1, in case of success, -1 in case of error 

Parameters:
 string filename_with_path filename to write the value to 
 integer startbyteposition the first byte in the file to be replaced, starting with 1, if you want to replace at the beginning of the file. Everything before startposition will be kept. 
 integer endbyteposition the first byte after the replacement. Everything from endbyteposition to the end of the file will be kept. 
 string value the value to be inserted into the file 


^ Reaper version 5.965Lua version 5.3 GetAllRecursiveFilesAndSubdirectories

Functioncall:

integer found_dirs, array dirs_array, integer found_files, array files_array = ultraschall.GetAllRecursiveFilesAndSubdirectories(string path)

Description:
Returns all subdirectories and files within a given path.

Might take some time with many folders/files.


Returns -1 in case of an error.

Returnvalues:
 integer found_dirs the number of directories found; -1, in case of an error 
 array dirs_array the full path to the found directories as an array 
 integer found_files the number of files found 
 array files_array the full path to the found files as an array 

Parameters:
 string path the path from where to retrieve the files and subdirectories 


^ Reaper version 5.975Lua version 5.3 IsValidFXStateChunk

Functioncall:

boolean retval = ultraschall.IsValidFXStateChunk(string StateChunk)

Description:
Returns, if a StateChunk is a valid FXStateChunk.
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

Returns false in case of an error

Returnvalues:
 boolean retval true, it is a valid FXStateChunk; false, it is not 

Parameters:
 string StateChunk the StateChunk, which you want to check, whether it's a valid FXStateChunk 


^ Reaper version 5.975Lua version 5.3 GetFXFromFXStateChunk

Functioncall:

string fx = ultraschall.GetFXFromFXStateChunk(string FXStateChunk, integer id)

Description:
Returns all lines of a specific TrackFX/ItemFX from a StateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

Returns nil in case of an error

Returnvalues:
 string fx all lines of an fx from a statechunk 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the FX-entries 
 integer id the id of the FX-entries you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLearn_FXStateChunk

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns a parameter-learn-setting from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It is the PARMLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLearn 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmLearn-settings 
 integer fxid the fx, of which you want to get the parameter-learn-settings 
 integer id the id of the ParmLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLearn_MediaItem

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLearn_MediaItem(MediaItem MediaItem, integer fxid, integer id)

Description:
Returns a parameter-learn-setting from a MediaItem

It is the PARMLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLearn 

Parameters:
 MediaItem MediaItem the MediaItem, whose ParmLearn-setting you want to get 
 integer fxid the fx, of which you want to get the parameter-learn-settings 
 integer id the id of the ParmLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLearn_MediaTrack

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLearn_MediaTrack(MediaTrack MediaTrack, integer fxid, integer id)

Description:
Returns a parameter-learn-setting from a MediaTrack

It is the PARMLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-messages
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLearn 

Parameters:
 MediaTrack MediaTrack the MediaTrack, whose ParmLearn-setting you want to get 
 integer fxid the fx, of which you want to get the parameter-learn-settings 
 integer id the id of the ParmLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmAlias_FXStateChunk

Functioncall:

integer parm_idx, string parm_aliasname = ultraschall.GetParmAlias_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns a parameter-alias-setting from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

Parameter-aliases are only stored for MediaTracks.

It is the PARMALIAS-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parm_aliasname the alias-name of the parameter 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmAlias-settings 
 integer fxid the fx, of which you want to get the parameter-alias-settings 
 integer id the id of the ParmAlias-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmAlias_MediaTrack

Functioncall:

integer parm_idx, string parm_aliasname = ultraschall.GetParmAlias_MediaTrack(MediaTrack MediaTrack, integer fxid, integer id)

Description:
Returns a parameter-aliasname-setting from a MediaTrack

It is the PARMALIAS-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parm_aliasname the alias-name of the parameter 

Parameters:
 MediaTrack MediaTrack the MediaTrack, whose ParmAlias-setting you want to get 
 integer fxid the fx, of which you want to get the parameter-alias-settings 
 integer id the id of the ParmAlias-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmModulationChunk_FXStateChunk

Functioncall:

string parm_modulation_chunk = ultraschall.GetParmModulationChunk_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns a parameter-modulation-chunk from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It's the <PROGRAMENV entry

Returns nil in case of an error

Returnvalues:
 string parm_modulation_chunk a chunk of the parameter-modulation settings 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the Parameter-modulation-settings 
 integer fxid the fx, of which you want to get the parameter-modulation-chunk-settings 
 integer id the id of the Parameter-modulation you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLFOLearn_FXStateChunk

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLFOLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns a parameter-lfo-learn-setting from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It is the LFOLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLFOLearn 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmLFOLearn-settings 
 integer fxid the fx, of which you want to get the parameter-lfo-learn-settings 
 integer id the id of the ParmLFOLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLFOLearn_MediaItem

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLFOLearn_MediaItem(MediaItem MediaItem, integer fxid, integer id)

Description:
Returns a parameter-lfo-learn-setting from a MediaItem

It is the LFOLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLFOLearn 

Parameters:
 MediaItem MediaItem the MediaItem, whose ParmLFOLearn-setting you want to get 
 integer fxid the fx, of which you want to get the parameter-lfo-learn-settings 
 integer id the id of the ParmLFOLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLFOLearn_MediaTrack

Functioncall:

integer parm_idx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message = ultraschall.GetParmLFOLearn_MediaTrack(MediaTrack MediaTrack, integer fxid, integer id)

Description:
Returns a parameter-lfo-learn-setting from a MediaTrack

It is the LFOLEARN-entry

Returns nil in case of an error

Returnvalues:
 integer parm_idx the idx of the parameter; order is exactly like the order in the contextmenu of Parameter List -> Learn 
 string parmname the name of the parameter, though usually only wet or bypass 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-messages
  examples:
          0,   OSC is used
          176, MIDI Chan 1 CC 0
          ...
          432, MIDI Chan 1 CC 1
          ...
          9360, MIDI Chan 1 Note 36
          9616, MIDI Chan 1 Note 37
          9872, MIDI Chan 1 Note 38
            ...
            
      CC Mode-dropdownlist:
         set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
          &65536 &131072 &262144
             0       0       0,      Absolute
             1       0       0,      Relative 1(127=-1, 1=+1)
             0       1       0,      Relative 2(63=-1, 65=+1)
             1       1       0,      Relative 3(65=-1, 1=+1)
             0       0       1,      Toggle (>0=toggle) 
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
0, no checkboxes
1, enable only when track or item is selected
2, Soft takeover (absolute mode only)
3, Soft takeover (absolute mode only)+enable only when track or item is selected
4, enable only when effect configuration is focused
20, enable only when effect configuration is visible 
 optional string osc_message the osc-message, that triggers the ParmLFOLearn 

Parameters:
 MediaTrack MediaTrack the MediaTrack, whose ParmLFOLearn-setting you want to get 
 integer fxid the fx, of which you want to get the parameter-lfo-learn-settings 
 integer id the id of the ParmLFOLearn-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmAudioControl_FXStateChunk

Functioncall:

integer parmidx, string parmname, integer parameter_modulation, number parmbase, integer audioctrl, number audioctrlstrength, integer audioctrl_direction, integer channels, integer stereo, integer rms_attack, integer rms_release, number db_lo, number db_hi, number audioctrlshaping_x, number audioctrlshaping_y = ultraschall.GetParmAudioControl_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns the parameter-modulation-settings of the Audio control signal-settings from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It is entries from the <PROGRAMENV-chunk

Returns nil in case of an error

Returnvalues:
 integer parmidx the id of the parameter, that shall be modulated; order like in the dropdownlist 
 string parmname the name of the parameter, usually bypass or wet 
 integer parameter_modulation the "Enable parameter modulation, baseline value(envelope overrides)"-checkbox; 0, enabled; 1, disabled 
 number parmbase parameter-modulation-baseline-slider; between 0.0000 and 1.0000; default is 0.2500 
 integer audioctrl "Audio control signal (sidechain)"-checkbox - 0, disabled; 1, enabled 
 number audioctrlstrength the strength-slider for AudioControlSignal; 0.0000(0%) to 1.000(100%); 0.493(49.3%); default is 1 
 integer audioctrl_direction the direction-radiobuttons for AudioControlSignal; -1, Negative; 0, Centered; 1, Positive 
 integer channels the Track audio channel-dropdownlist; linked to entry parameter stereo as well
-1, no channel selected(yet) (default)
0 and higher, track 1 and higher is selected 
 integer stereo linked to channels as well
0, mono(use only the channel set in CHAN); 1, stereo(use the channel set in CHAN and CHAN+1) 
 integer rms_attack rms attack in milliseconds; 0 to 1000; default is 300 
 integer rms_release rms release in milliseconds; 0 to 1000; default is 300 
 number db_lo db_lo decides the lowest value possible for parameter db_hi; db_hi decides the highest volume for db_lo
Min volume-slider in dB; maximum valuerange possible is -60dB to 11.9dB 
 number db_hi db_lo decides the lowest value possible for parameter db_hi; db_hi decides the highest volume for db_lo
Max volume-slider in dB; maximum valuerange possible is -59.9dB to 12dB 
 number audioctrlshaping_x the x-position of the shaping-dragging-point; between 0.000000 and 1.000000 
 number audioctrlshaping_y the y-position of the shaping-dragging-point; between 0.000000 and 1.000000 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmModulation-settings 
 integer fxid the fx, of which you want to get the parameter-modulation-settings 
 integer id the id of the ParmModulation-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmLFO_FXStateChunk

Functioncall:

integer parmidx, string parmname, integer parameter_modulation, number parmbase, integer lfo, number lfo_strength, integer lfo_direction, integer lfo_shape, integer temposync, integer unknown, integer phase_reset, number lfo_speed, number lfo_speedphase = ultraschall.GetParmLFO_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns the parameter-modulation-settings of the LFO-settings from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It is entries from the <PROGRAMENV-chunk

Returns nil in case of an error

Returnvalues:
 integer parmidx the id of the parameter, that shall be modulated; order like in the dropdownlist 
 string parmname the name of the parameter, usually bypass or wet 
 integer parameter_modulation the "Enable parameter modulation, baseline value(envelope overrides)"-checkbox; 0, enabled; 1, disabled 
 number parmbase parameter-modulation-baseline-slider; between 0.0000 and 1.0000; default is 0.2500 
 integer lfo LFO checkbox; 0, disabled; 1, enabled 
 number lfo_strength Strength-slider in the LFO parameter-modulation; 0.0000(0%) to 1.000(100%); 0.493(49.3%); default is 1 
 integer lfo_direction Direction-radiobuttons in the LFO parameter modulation; -1, Negative; 0, Centered; 1, Positive 
 integer lfo_shape the shape of the LFO
0, sine
1, square
2, saw L
3, saw R
4, triangle
5, random 
 integer temposync the Tempo sync-checkbox in the LFO parameter-modulation; 0, disabled; 1, enabled 
 integer unknown unknown 
 integer phase_reset phase-reset-dropdownlist
0, On seek/loop (deterministic output)
1, Free-running (non-deterministic output) 
 number lfo_speed Speed-slider in the LFO parameter-modulation; either Hz(temposync=0) or QN(temposync=1)
Hz: 0(0.0039Hz) to 1(8.0000Hz); higher values are possible, lower values go into negative; default is 0.124573(1.0000Hz)
QN: 0(8.0000QN) to 1(0.2500QN); lower values are possible; higher values go into negative; default is 0.9(1.0000QN) 
 number lfo_speedphase Phase-slider in the LFO parameter-modulation; 0.000 to to 1.000; default is 0.5 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmModulation-settings 
 integer fxid the fx, of which you want to get the parameter-modulation-settings 
 integer id the id of the ParmModulation-settings you want to have, starting with 1 for the first 


^ Reaper version 5.975Lua version 5.3 GetParmMIDIPLink_FXStateChunk

Functioncall:

integer parmidx, string parmname, integer parameter_modulation, number parmbase, boolean plink_enabled, number scale, integer midi_fx_idx, integer midi_fx_idx2, integer linked_parmidx, number offset, optional integer bus, optional integer channel, optional integer category, optional integer midi_note = ultraschall.GetParmMIDIPLink_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Returns the parameter-modulation-settings of the Parameter-Link-Modulation-settings from an FXStateChunk
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

It is entries from the <PROGRAMENV-chunk

Returns nil in case of an error

Returnvalues:
 integer parmidx the id of the parameter, that shall be modulated; order like in the dropdownlist 
 string parmname the name of the parameter, usually bypass or wet 
 integer parameter_modulation the "Enable parameter modulation, baseline value(envelope overrides)"-checkbox; 0, enabled; 1, disabled 
 number parmbase parameter-modulation-baseline-slider; between 0.0000 and 1.0000; default is 0.2500 
 boolean plink_enabled true, parameter-linking is enabled; false, parameter linking is disabled 
 number scale the scale-slider; -1.00(-100%) to 1.00(100%); default is 0(0%) 
 integer midi_fx_idx the big MIDI/FX-button in the "Link from MIDI or FX parameter"-area
  -1, nothing selected
  -100, MIDI-parameter-settings
  0 - the first fx
  1 - the second fx
  2 - the third fx, etc 
 integer midi_fx_idx2 the big MIDI/FX-button in the "Link from MIDI or FX parameter"-area; Reaper stores the idx for idx using two values, where this is the second one
it is unknown why, so I include it in here anyway
  -1, nothing selected
  -100, MIDI-parameter-settings
  0 - the first fx
  1 - the second fx
  2 - the third fx, etc 
 integer linked_parmidx the parameter idx, that you want to link;
When MIDI:
     16
When FX-parameter:
     0 to n; 0 for the first; 1, for the second, etc 
 number offset Offset-slider; -1.00(-100%) to 1.00(100%); default is 0(0%)  
 optional integer bus the MIDI-bus; 0 to 15 for bus 1 to 16; only available, when midi_fx_idx=-100, otherwise nil 
 optional integer channel the MIDI-channel; 0, omni; 1 to 16 for channel 1 to 16; only available, when midi_fx_idx=-100, otherwise nil 
 optional integer category the MIDI-category, which affects the meaning of parameter midi_note; only available, when midi_fx_idx=-100, otherwise nil
144, MIDI note
160, Aftertouch
176, CC 14Bit and CC
192, Program Change
208, Channel Pressure
224, Pitch 
 optional integer midi_note the midi_note/command, whose meaning depends on parameter category; only available, when midi_fx_idx=-100, otherwise nil
   When MIDI note:
        0(C-2) to 127(G8)
   When Aftertouch:
        0(C-2) to 127(G8)
   When CC14 Bit:
        128 to 159; see dropdownlist for the commands(the order of the list is the same as this numbering)
   When CC:
        0 to 119; see dropdownlist for the commands(the order of the list is the same as this numbering)
   When Program Change:
        0
   When Channel Pressure:
        0
   When Pitch:
        0 

Parameters:
 string FXStateChunk the FXStateChunk, from which you want to retrieve the ParmLinkModulation-settings 
 integer fxid the fx, of which you want to get the parameter-linking-modulation-settings 
 integer id the id of the ParmLinkModulation-settings you want to have, starting with 1 for the first 


^ Reaper version 5.977SWS version 2.10.0.1Julian Sader's plugin version 0.986Lua version 5.3 ScanDXPlugins

Functioncall:

ultraschall.ScanDXPlugins(optional boolean re_scan)

Description:
(Re-)scans all DX-Plugins.


Parameters:
 optional boolean clear_cache true, re-scan all DX-plugins; false or nil, only scan new DX-plugins 


^ Reaper version 5.979Lua version 5.3 DeleteParmLearn_FXStateChunk

Functioncall:

boolean retval, string alteredFXStateChunk = ultraschall.DeleteParmLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Deletes a ParmLearn-entry from an FXStateChunk.

returns false in case of an error

Returnvalues:
 boolean retval true, if deletion was successful; false, if the function couldn't delete anything 
 string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, which you want to delete a ParmLearn from 
 integer fxid the id of the fx, which holds the to-delete-ParmLearn-entry; beginning with 1 
 integer id the id of the ParmLearn-entry to delete; beginning with 1 


^ Reaper version 5.979Lua version 5.3 DeleteParmAlias_FXStateChunk

Functioncall:

boolean retval, string alteredFXStateChunk = ultraschall.DeleteParmAlias_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Deletes a ParmAlias-entry from an FXStateChunk.

It's the PARMALIAS-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if deletion was successful; false, if the function couldn't delete anything 
 string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, which you want to delete a ParmAlias from 
 integer fxid the id of the fx, which holds the to-delete-ParmAlias-entry; beginning with 1 
 integer id the id of the ParmAlias-entry to delete; beginning with 1 


^ Reaper version 5.979Lua version 5.3 DeleteParmLFOLearn_FXStateChunk

Functioncall:

boolean retval, string alteredFXStateChunk = ultraschall.DeleteParmLFOLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id)

Description:
Deletes a ParmLFO-Learn-entry from an FXStateChunk.

It's the LFOLEARN-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if deletion was successful; false, if the function couldn't delete anything 
 string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, which you want to delete a ParmLFO-Learn-entry from 
 integer fxid the id of the fx, which holds the to-delete-ParmLFO-Learn-entry; beginning with 1 
 integer id the id of the ParmLFO-Learn-entry to delete; beginning with 1 


^ Reaper version 5.979Lua version 5.3 SetParmLFOLearn_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.SetParmLFOLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id, integer midi_note, integer checkboxflags, optional string osc_message)

Description:
Sets an already existing ParmLFO-Learn-entry of an FX-plugin from an FXStateChunk.

It's the LFOLEARN-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLFO) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a ParmLFO-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-ParmLFO-Learn-entry; beginning with 1 
 integer id the id of the ParmLFO-Learn-entry to set; beginning with 1 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
    examples:
            0,   OSC is used
            176, MIDI Chan 1 CC 0
            ...
            432, MIDI Chan 1 CC 1
            ...
            9360, MIDI Chan 1 Note 36
            9616, MIDI Chan 1 Note 37
            9872, MIDI Chan 1 Note 38
              ...
              
        CC Mode-dropdownlist:
           set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
            &65536 &131072 &262144
               0       0       0,      Absolute
               1       0       0,      Relative 1(127=-1, 1=+1)
               0       1       0,      Relative 2(63=-1, 65=+1)
               1       1       0,      Relative 3(65=-1, 1=+1)
               0       0       1,      Toggle (>0=toggle)  
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
    0, no checkboxes
    1, enable only when track or item is selected
    2, Soft takeover (absolute mode only)
    3, Soft takeover (absolute mode only)+enable only when track or item is selected
    4, enable only when effect configuration is focused
    20, enable only when effect configuration is visible  
 optional string osc_message the osc-message, that triggers the ParmLFOLearn, only when midi_note is set to 0! 


^ Reaper version 5.979Lua version 5.3 SetParmLearn_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.SetParmLearn_FXStateChunk(string FXStateChunk, integer fxid, integer id, integer midi_note, integer checkboxflags, optional string osc_message)

Description:
Sets an already existing Parm-Learn-entry of an FX-plugin from an FXStateChunk.

It's the PARMLEARN-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLearn) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-Parm-Learn-entry; beginning with 1 
 integer id the id of the Parm-Learn-entry to set; beginning with 1 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
    examples:
            0,   OSC is used
            176, MIDI Chan 1 CC 0
            ...
            432, MIDI Chan 1 CC 1
            ...
            9360, MIDI Chan 1 Note 36
            9616, MIDI Chan 1 Note 37
            9872, MIDI Chan 1 Note 38
              ...
              
        CC Mode-dropdownlist:
           set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
            &65536 &131072 &262144
               0       0       0,      Absolute
               1       0       0,      Relative 1(127=-1, 1=+1)
               0       1       0,      Relative 2(63=-1, 65=+1)
               1       1       0,      Relative 3(65=-1, 1=+1)
               0       0       1,      Toggle (>0=toggle)  
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
    0, no checkboxes
    1, enable only when track or item is selected
    2, Soft takeover (absolute mode only)
    3, Soft takeover (absolute mode only)+enable only when track or item is selected
    4, enable only when effect configuration is focused
    20, enable only when effect configuration is visible  
 optional string osc_message the osc-message, that triggers the ParmLearn, only when midi_note is set to 0! 


^ Reaper version 5.979Lua version 5.3 SetParmAlias_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.SetParmAlias_FXStateChunk(string FXStateChunk, integer fxid, integer id, string parmalias)

Description:
Sets an already existing Parm-Learn-entry of an FX-plugin from an FXStateChunk.

It's the PARMALIAS-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLearn) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-Parm-Learn-entry; beginning with 1 
 integer id the id of the Parm-Learn-entry to set; beginning with 1 
 string parmalias the new aliasname of the parameter 


^ Reaper version 5.979Lua version 5.3 SetFXStateChunk

Functioncall:

boolean retval, optional string alteredStateChunk = ultraschall.SetFXStateChunk(string StateChunk, string FXStateChunk)

Description:
Sets an FXStateChunk into a TrackStateChunk or a MediaItemStateChunk.

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful 
 optional string alteredStateChunk the altered StateChunk 

Parameters:
 string StateChunk the TrackStateChunk, into which you want to set the FXChain 
 string FXStateChunk the FXStateChunk, which you want to set into the TrackStateChunk 
 optional integer TakeFXChain_id when using MediaItemStateChunks, this allows you to choose the take of which you want the FXChain; default is 1 


^ Reaper version 5.975Lua version 5.3 GetFXStateChunk

Functioncall:

string FXStateChunk = ultraschall.GetFXStateChunk(string StateChunk, optional integer TakeFXChain_id)

Description:
Returns an FXStateChunk from a TrackStateChunk or a MediaItemStateChunk.

An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.

Returns nil in case of an error or if no FXStateChunk has been found.

Returnvalues:
 string FXStateChunk the FXStateChunk, stored in the StateChunk 

Parameters:
 string StateChunk the StateChunk, from which you want to retrieve the FXStateChunk 
 optional integer TakeFXChain_id when using MediaItemStateChunks, this allows you to choose the take of which you want the FXChain; default is 1 


^ Reaper version 5.979Lua version 5.3 AddParmLFOLearn_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.AddParmLFOLearn_FXStateChunk(string FXStateChunk, integer fxid, integer parmidx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message)

Description:
Adds a new Parm-LFOLearn-entry to an FX-plugin from an FXStateChunk.

It's the LFOLEARN-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLearn) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-Parm-Learn-entry; beginning with 1 
 integer parmidx the parameter, whose alias you want to add 
 string parmname the name of the parameter, usually \"\" or \"byp\" for bypass or \"wet\" for wet; when using wet or bypass, these are essential to give! 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
    examples:
            0,   OSC is used
            176, MIDI Chan 1 CC 0
            ...
            432, MIDI Chan 1 CC 1
            ...
            9360, MIDI Chan 1 Note 36
            9616, MIDI Chan 1 Note 37
            9872, MIDI Chan 1 Note 38
              ...
              
        CC Mode-dropdownlist:
           set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
            &65536 &131072 &262144
               0       0       0,      Absolute
               1       0       0,      Relative 1(127=-1, 1=+1)
               0       1       0,      Relative 2(63=-1, 65=+1)
               1       1       0,      Relative 3(65=-1, 1=+1)
               0       0       1,      Toggle (>0=toggle)  
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
    0, no checkboxes
    1, enable only when track or item is selected
    2, Soft takeover (absolute mode only)
    3, Soft takeover (absolute mode only)+enable only when track or item is selected
    4, enable only when effect configuration is focused
    20, enable only when effect configuration is visible  
 optional string osc_message the osc-message, that triggers the ParmLFOLearn, only when midi_note is set to 0! 


^ Reaper version 5.979Lua version 5.3 AddParmLearn_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.AddParmLearn_FXStateChunk(string FXStateChunk, integer fxid, integer parmidx, string parmname, integer midi_note, integer checkboxflags, optional string osc_message)

Description:
Adds a new Parm-Learn-entry to an FX-plugin from an FXStateChunk.

It's the PARMLEARN-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLearn) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-Parm-Learn-entry; beginning with 1 
 integer parmidx the parameter, whose alias you want to add 
 string parmname the name of the parameter, usually \"\" or \"byp\" for bypass or \"wet\" for wet; when using wet or bypass, these are essential to give! 
 integer midi_note an integer representation of the MIDI-note, which is set as command; 0, in case of an OSC-message
    examples:
            0,   OSC is used
            176, MIDI Chan 1 CC 0
            ...
            432, MIDI Chan 1 CC 1
            ...
            9360, MIDI Chan 1 Note 36
            9616, MIDI Chan 1 Note 37
            9872, MIDI Chan 1 Note 38
              ...
              
        CC Mode-dropdownlist:
           set the following flags to their specific values (0=0, 1=the value beginning &, like &65536 or &131072 or &262144)
            &65536 &131072 &262144
               0       0       0,      Absolute
               1       0       0,      Relative 1(127=-1, 1=+1)
               0       1       0,      Relative 2(63=-1, 65=+1)
               1       1       0,      Relative 3(65=-1, 1=+1)
               0       0       1,      Toggle (>0=toggle)  
 integer checkboxflags the checkboxes checked in the MIDI/OSC-learn dialog
    0, no checkboxes
    1, enable only when track or item is selected
    2, Soft takeover (absolute mode only)
    3, Soft takeover (absolute mode only)+enable only when track or item is selected
    4, enable only when effect configuration is focused
    20, enable only when effect configuration is visible  
 optional string osc_message the osc-message, that triggers the ParmLearn, only when midi_note is set to 0! 


^ Reaper version 5.979Lua version 5.3 AddParmAlias_FXStateChunk

Functioncall:

boolean retval, optional string alteredFXStateChunk = ultraschall.AddParmAlias_FXStateChunk(string FXStateChunk, integer fxid, string parmalias)

Description:
Adds a new Parm-Alias-entry to an FX-plugin from an FXStateChunk.

It's the PARMALIAS-entry

returns false in case of an error

Returnvalues:
 boolean retval true, if setting new values was successful; false, if setting was unsuccessful(e.g. no such ParmLearn) 
 optional string alteredFXStateChunk the altered FXStateChunk 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to set a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-set-Parm-Learn-entry; beginning with 1 
 integer parmidx the parameter, whose alias you want to add 
 string parmalias the new aliasname of the parameter 


^ Reaper version 5.979Lua version 5.3 CountParmAlias_FXStateChunk

Functioncall:

integer count = ultraschall.CountParmAlias_FXStateChunk(string FXStateChunk, integer fxid)

Description:
Counts already existing Parm-Alias-entries of an FX-plugin from an FXStateChunk.

It's the PARMALIAS-entry

returns -1 in case of an error

Returnvalues:
 integer count the number of ParmAliases found 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to count a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-count-Parm-Learn-entry; beginning with 1 


^ Reaper version 5.979Lua version 5.3 CountParmLearn_FXStateChunk

Functioncall:

integer count = ultraschall.CountParmLearn_FXStateChunk(string FXStateChunk, integer fxid)

Description:
Counts already existing Parm-Learn-entries of an FX-plugin from an FXStateChunk.

It's the PARMLEARN-entry

returns -1 in case of an error

Returnvalues:
 integer count the number of ParmLearn-entried found 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to count a Parm-Learn-entry 
 integer fxid the id of the fx, which holds the to-count-Parm-Learn-entry; beginning with 1 


^ Reaper version 5.979Lua version 5.3 CountParmLFOLearn_FXStateChunk

Functioncall:

integer count = ultraschall.CountParmLFOLearn_FXStateChunk(string FXStateChunk, integer fxid)

Description:
Counts already existing Parm-LFOLearn-entries of an FX-plugin from an FXStateChunk.

It's the LFOLEARN-entry

returns -1 in case of an error

Returnvalues:
 integer count the number of LFOLearn-entried found 

Parameters:
 string FXStateChunk the FXStateChunk, in which you want to count a Parm-LFOLearn-entry 
 integer fxid the id of the fx, which holds the to-count-Parm-LFOLearn-entry; beginning with 1 


^ Reaper version 5.977SWS version 2.10.0.1Julian Sader's plugin version 0.986Lua version 5.3 ScanVSTPlugins

Functioncall:

ultraschall.ScanVSTPlugins(optional boolean clear_cache)

Description:
Re-scans all VST-Plugins.


Parameters:
 optional boolean clear_cache true, clear cache before re-scanning; false or nil, just scan vts-plugins 


^ Reaper version 5.977SWS version 2.10.0.1Julian Sader's plugin version 0.986Lua version 5.3 AutoDetectVSTPluginsFolder

Functioncall:

ultraschall.AutoDetectVSTPluginsFolder()

Description:
Auto-detects the vst-plugins-folder.




^ Reaper version 5.965Lua version 5.3 print2

Functioncall:

print2(parameter_1 to parameter_n)

Description:
replaces Lua's own print-function.

Converts all parametes given into string using tostring() and displays them as a MessageBox, separated by two spaces.


Parameters:
 parameter_1 to parameter_n the parameters, that you want to have printed out 


^ Reaper version 5.965Lua version 5.3 print_alt

Functioncall:

print_alt(parameter_1 to parameter_n)

Description:
replaces Lua's own print-function, that is quite useless in Reaper.

like print, but separates the entries by a two spaced, not a newline


Parameters:
 parameter_1 to parameter_n the parameters, that you want to have printed out 


^ Reaper version 5.965Lua version 5.3 print

Functioncall:

print(parameter_1 to parameter_n)

Description:
replaces Lua's own print-function, that is quite useless in Reaper.

Converts all parametes given into string using tostring() and displays them in the ReaScript-console, separated by a newline and ending with a newline.


Parameters:
 parameter_1 to parameter_n the parameters, that you want to have printed out 


^ Reaper version 5.40Lua version 5.3 SplitStringAtLineFeedToArray

Functioncall:

integer count, array split_string = ultraschall.SplitStringAtLineFeedToArray(string unsplitstring)

Description:
Splits the string unsplitstring at linefeed/tabs/control characters and puts each of these splitpieces into an array, each splitpiece one array-entry.
The linefeeds will not(!) be returned in the array's entries.
Returns the number of entries in the array, as well as the array itself
If there are no control characters or linefeeds in the string, the array will have only one entry with unsplitstring in it.

returns -1 in case of failure

Returnvalues:
 integer count number of entries in the split_string-array 
 array split_string an array with all the individual "postsplit"-pieces of the string 

Parameters:
 string unsplitstring the string, that shall be split at LineFeed/Tabs/Control Characters. Nil is not allowed. 


^ Reaper version 5.40Lua version 5.3 CountCharacterInString

Functioncall:

integer count, array positions = ultraschall.CountCharacterInString(string checkstring, string character)

Description:
Counts, how often character appears in checkstring and returns the count, as well as a array an with the position-numbers.

returns -1 in case of error

Returnvalues:
 integer count the number of occurences of character in checkstring 
 array positions the positionnumbers of the character in checkstring 

Parameters:
 string checkstring the string to check search through 
 string character the character to search for. Only single characters are allowed. Controlcodes like \n \t count as single character. Case sensitive. 


^ Reaper version 5.77Lua version 5.3 IsValidMatchingPattern

Functioncall:

boolean retval = ultraschall.IsValidMatchingPattern(string patstring)

Description:
Returns, if patstring is a valid pattern-matching-string

Returnvalues:
 boolean retval true, patstring is a valid pattern-matching-string; false, patstring isn't a valid pattern-matching-string 

Parameters:
 string patstring the string to check for, if it's a valid pattern-matching-string 


^ Reaper version 5.40Lua version 5.3 CSV2IndividualLinesAsArray

Functioncall:

integer count, array individual_values = ultraschall.CSV2IndividualLinesAsArray(string csv_line, optional string separator)

Description:
convert a csv-string to an array of the individual values. If separator cannot be found, it'll return the original string

returns nil in case or error

Returnvalues:
 integer count the number of entries 
 array individual_values all values, each in an individual array-position 

Parameters:
 string csv_line a string as a csv, with all values included and separated by parameter separator 
 string separator the separator, that separates the individual entries; use nil for commas; separators will be removed from the final strings! 


^ Reaper version 5.40Lua version 5.3 RoundNumber

Functioncall:

integer retval = ultraschall.RoundNumber(number num)

Description:
returns a rounded value of the parameter number. %.5 and higher rounds up, lower than %.5 round down.

returns nil in case of an error

Returnvalues:
 integer retval the rounded number 

Parameters:
 number num the floatingpoint number, you'd like to have rounded. 


^ Reaper version 5.40Lua version 5.3 GetPartialString

Functioncall:

string partial_string = ultraschall.GetPartialString(string str, string sep1, string sep2)

Description:
returns the part of a filename-string between sep1 and sep2

returns nil if it doesn't work, no sep1 or sep2 exist

Returnvalues:
 string partial_string the partial string between sep1 and sep2 

Parameters:
 string str string to be processed 
 string sep1 separator on the "left" side of the partial string 
 string sep2 separator on the "right" side of the partial string 


^ Reaper version 5.40Lua version 5.3 RunCommand

Functioncall:

integer retval = ultraschall.RunCommand(string actioncommand_id)

Description:
runs a command by its ActionCommandID(instead of the CommandID-number)

returns -1 in case of error

Returnvalues:
 integer retval -1, in case of error 

Parameters:
 string actioncommand_id the ActionCommandID of the Command/Script/Action you want to run; must be either a number or the ActionCommandID beginning with an underscore _ 


^ Reaper version 5.40Lua version 5.3 Notes2CSV

Functioncall:

string csv_retval = ultraschall.Notes2CSV()

Description:
Gets the project's notes and returns it as a CSV.

Returnvalues:
 string csv_retval the project notes, returned as a csv-string; entries separated by a comma 



^ Reaper version 5.40Lua version 5.3 CSV2Line

Functioncall:

string values = ultraschall.CSV2Line(string csv_line)

Description:
converts a string of csv-values into a string with all values and without the ,-separators

returns nil in case of error

Returnvalues:
 string values all values in one string 



^ Reaper version 5.40Lua version 5.3 IsItemInTrack

Functioncall:

boolean retval = ultraschall.IsItemInTrack(integer tracknumber, integer itemIDX)

Description:
checks, whether a given item is part of the track tracknumber

returns true, if the itemIDX is part of track tracknumber, false if not, nil if no such itemIDX or Tracknumber available

Returnvalues:
 boolean retval true, if item is in track, false if item isn't in track 

Parameters:
 integer itemIDX the number of the item to check of 
 integer tracknumber the number of the track to check in, with 1 for track 1, 2 for track 2, etc. 


^ Reaper version 5.40Lua version 5.3 CheckActionCommandIDFormat

Functioncall:

boolean retval = ultraschall.CheckActionCommandIDFormat(action_command_id)

Description:
Checks, whether an action command id is a valid commandid(which is a number) or a valid _action_command_id (which is a string with an _underscore in the beginning).

Does not check, whether this action_command_id is a useable one, only if it's "syntax" is correct!

returns falsein case of an error

Returnvalues:
 boolean retval true, valid action_command_id; false, not a valid action_command_id 

Parameters:
 actioncommand_id the ActionCommandID you want to check; either a number or an action_command_id with an underscore at the beginning 


^ Reaper version 5.40Lua version 5.3 CheckActionCommandIDFormat2

Functioncall:

boolean retval = ultraschall.CheckActionCommandIDFormat2(action_command_id)

Description:
Checks, whether an action command id is a valid commandid(which is a number) or a valid _action_command_id (which is a string with an _underscore in the beginning).

Unlike CheckActionCommandIDFormat, this checks whether an action-command-id-string is an actual registered one(case sensitive!).

returns false in case of an error

Returnvalues:
 boolean retval true, valid action_command_id; false, not a valid action_command_id 

Parameters:
 actioncommand_id the ActionCommandID you want to check; either a number or an action_command_id with an underscore at the beginning 


^ Reaper version 5.40Lua version 5.3 ToggleStateAction

Functioncall:

integer retval = ultraschall.ToggleStateAction(integer section, string actioncommand_id, integer state)

Description:
Toggles state of an action using the actioncommand_id(instead of the CommandID-number)

returns current state of the action after toggling or -1 in case of error.

Returnvalues:
 integer retval state if the action, after it has been toggled 

Parameters:
 integer section the section of the action(see ShowActionlist-dialog)
0 - Main
100 - Main (alt recording)
32060 - MIDI Editor
32061 - MIDI Event List Editor
32062 - MIDI Inline Editor
32063 - Media Explorer 
 string actioncommand_id the ActionCommandID of the action to toggle 
 integer state 1 or 0 


^ Reaper version 5.40Lua version 5.3 RefreshToolbar_Action

Functioncall:

ultraschall.RefreshToolbar_Action(integer section, string actioncommand_id)

Description:
Refreshes a toolbarbutton with an ActionCommandID(instead of the CommandID-number)

returns -1 in case of error


Parameters:
 integer section section
0 - Main
100 - Main (alt recording)
32060 - MIDI Editor
32061 - MIDI Event List Editor
32062 - MIDI Inline Editor
32063 - Media Explorer 
 string actioncommand_id ActionCommandID of the action, associated with the toolbarbutton  


^ Reaper version 5.40Lua version 5.3 ToggleStateButton

Functioncall:

boolean retval = ultraschall.ToggleStateButton(integer section, string actioncommand_id, integer state)

Description:
Toggles state and refreshes the button of an actioncommand_id

returns false in case of error

Returnvalues:
 boolean retval true, toggling worked; false, toggling didn't work 

Parameters:
 integer section the section of the action(see ShowActionlist-dialog)
0 - Main
100 - Main (alt recording)
32060 - MIDI Editor
32061 - MIDI Event List Editor
32062 - MIDI Inline Editor
32063 - Media Explorer 
 string actioncommand_id the ActionCommandID of the action to toggle 
 integer state 1 or 0 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 SecondsToTime

Functioncall:

string time_string = ultraschall.SecondsToTime(number pos)

Description:
converts timeposition in seconds(pos) to a timestring (h)hh:mm:ss.mss

returns nil in case of error

Returnvalues:
 string time_string timestring in (h)hh:mm:ss.mss 

Parameters:
 number pos timeposition in seconds 


^ Reaper version 5.40SWS version 2.8.8Lua version 5.3 TimeToSeconds

Functioncall:

number position = ultraschall.TimeToSeconds(string timestring)

Description:
converts a timestring days:hours:minutes:seconds.milliseconds to timeposition in seconds
it is ok, to have only some of the last ones given, so i.e. excluding days and hours is ok. Though excluding values inbetween does not work!

A single integer in timestring will be seen as seconds.
To only specifiy milliseconds in particular, start the number with a .
all other values are separated by :

returns -1 in case of error, timestring is a nil or if you try to add an additional value, added before days

does not check for valid timeranges, so 61 minutes is possible to give, even if hours are present in the string

Returnvalues:
 number position the converted position 

Parameters:
 string timestring a string like: days:hours:minutes:seconds.milliseconds , i.e. 1:16:27:50.098 


^ Reaper version 5.40Lua version 5.3 SecondsToTimeString_hh_mm_ss_mss

Functioncall:

string timestring = ultraschall.SecondsToTimeString_hh_mm_ss_mss(number time)

Description:
Converts the parameter time into a timestring of the format hh:mm:ss.mss
Valid timeranges are from 0 to 359999.99 seconds(about 99 hours).

returns -1 in case of error

Returnvalues:
 string timestring the converted timestring. It will always follow the format hh:mm:ss.mss and fill up digits with zeros, if necessary. 

Parameters:
 number time the time in seconds to be converted into the timestring 


^ Reaper version 5.40Lua version 5.3 TimeStringToSeconds_hh_mm_ss_mss

Functioncall:

number time = ultraschall.TimeStringToSeconds_hh_mm_ss_mss(string timestring)

Description:
Converts the parameter timestring of the format hh:mm:ss.mss into seconds
The timestring must follow strictly this format, or the function returns -1 as result.

returns -1 in case of error

Returnvalues:
 number time the time in seconds to be converted into the timestring, -1 in case of an error 

Parameters:
 string timestring the converted timestring. It must always follow the format hh:mm:ss.mss. Fill up digits with zeros, if necessary. 


^ Reaper version 5.52Lua version 5.3 CountPatternInString

Functioncall:

integer count, array positions = ultraschall.CountPatternInString(string sourcestring, string searchstring, boolean non_case_sensitive)

Description:
returns the count and an array with all positions of searchstring in sourcestring.

Returnvalues:
 integer count the number of appearances of searchstring in sourcestring 
 array positions an array with count-entries, where every entry contains the position of searchstring in sourcestring 

Parameters:
 string sourcestring the string, you want to search through 
 string searchstring the string, you want to search for in sourcestring 
 boolean non_case_sensitive true, the search does not care about case-sensitivity; false, case of searchstring will be kept 


^ Reaper version 5.40Lua version 5.3 toboolean

Functioncall:

boolean retval = toboolean(string value)

Description:
Converts the string "value" to a boolean, if applicable; means: if it contains either true or false in it.
If it contains both or other characters(except spaces or tabs), it will not convert.
Works basially like Lua's own tostring() or tonumber()-functions.

Returns nil, if conversion isn't possible.

Note: Unlike other ultraschall-api-functions, toboolean() has no ultraschall. in it's functionname!

Returnvalues:
 boolean retval true or false, depending on the input variable value 

Parameters:
 string value the value to be converted to a boolean. True and false can be upper-, lower and camelcase. 


^ Reaper version 5.40Lua version 5.3 OpenURL

Functioncall:

integer retval = ultraschall.OpenURL(string url)

Description:
Opens the URI with the standard-browser installed in your system.

returns -1 in case of an error


Parameters:
 string url the url to be opened in the browser; will check for :// in it for validity! 


^ Reaper version 5.40Lua version 5.3 CountEntriesInTable_Main

Functioncall:

integer count, table subtables, integer count_of_subtables = ultraschall.CountEntriesInTable_Main(table the_table)

Description:
Counts the number of entries in an indexed table.
Will only count the entries from the main-table, not it's subtables. If you want to know the number of subtables, this function returns a table that includes all subtables found in the main-table,
as well as the number of found subtables.

Returns -1 if table isn't a valid table

Returnvalues:
 integer count the number of entries in the table 
 table subtables if an entry of table has a table as value, that table-value will be included in this subtables-table(for recursive counting-usecases) 
 integer count_of_subtables the number of entries in the subtables-table 

Parameters:
 table table the table, whose entries you want to count 


^ Reaper version 5.40Lua version 5.3 CompareArrays

Functioncall:

table diff_array = ultraschall.CompareArrays(table Array, table CompareArray2)

Description:
Compares Array using parameter CompareArray2 and returns an array with all entries in CompareArray2, that are not in Array.
The comparable arrays must be indexed by integer-numbers.

Returns nil in case of an error

Returnvalues:
 table diff_array an array with all entries from CompareArray2, that are not in Array 

Parameters:
 table Array the reference-array 
 table CompareArray2 the array you want to check against Array; all entries in CompareArray2 that are not in Array will be returned 


^ Reaper version 5.40Lua version 5.3 GetOS

Functioncall:

string operating_system, integer bits = ultraschall.GetOS()

Description:
Returns operating system and if it's a 64bit/32bit-operating system.

Returnvalues:
 string operating_system the operating system used; usually "Win", "Mac" or "Other"(e.g. when Linux is used) 
 integer bits the number of bits of the operating-system. Either 32 or 64 bit. 



^ Reaper version 5.40Lua version 5.3 IsOS_Windows

Functioncall:

boolean is_windows, integer number_of_bits = ultraschall.IsOS_Windows()

Description:
returns, if the current operating system is windows

Returnvalues:
 boolean is_windows true, if the operating-system is windows; false if not 
 integer bits the number of bits of the operating-system. Either 32 or 64 bit; nil if is_win==false 



^ Reaper version 5.40Lua version 5.3 IsOS_Mac

Functioncall:

boolean is_mac, integer number_of_bits = ultraschall.IsOS_Mac()

Description:
returns, if the current operating system is mac-osx

Returnvalues:
 boolean is_mac true, if the operating-system is mac-osx; false if not 
 integer bits the number of bits of the operating-system. Either 32 or 64 bit.; nil if is_mac=false 



^ Reaper version 5.40Lua version 5.3 IsOS_Other

Functioncall:

boolean is_other, integer number_of_bits = ultraschall.IsOS_Other()

Description:
returns, if the current operating system is neither mac or win

Returnvalues:
 boolean is_other true, if the operating-system is neither mac or win; false if not 
 integer bits the number of bits of the operating-system. Either 32 or 64 bit.; nil if is_other=false 



^ Reaper version 5.975Lua version 5.3 GetReaperAppVersion

Functioncall:

integer majorversion, integer subversion, string bits, string operating_system, boolean portable, optional string betaversion = ultraschall.GetReaperAppVersion()

Description:
Returns operating system and if it's a 64bit/32bit-operating system.

Returnvalues:
 integer majorversion the majorversion of Reaper. Can be used for comparisions like "if version<5 then ... end". 
 integer subversion the subversion of Reaper. Can be used for comparisions like "if subversion<96 then ... end". 
 string bits the number of bits of the reaper-app 
 string operating_system the operating system, either "Win", "OSX" or "Other" 
 boolean portable true, if it's a portable installation; false, if it isn't a portable installation 
 optional string betaversion if you use a pre-release of Reaper, this contains the beta-version, like "rc9" or "+dev0423" or "pre6" 



^ Reaper version 5.77Lua version 5.3 LimitFractionOfFloat

Functioncall:

number altered_number = ultraschall.LimitFractionOfFloat(number number, integer length_of_fraction, boolean roundit)

Description:
limits the fraction of a float-number to a specific length of fraction(digits). You can also choose to round the value or not.

returns nil in case of error

Returnvalues:
 number altered_number the altered number with the new fraction-length. Will be equal to parameter number, if number was integer or fraction less digits than length_of_fraction 

Parameters:
 number number the number, whose fraction shall be limited 
 integer length_of_fraction the number of digits in the fraction 
 boolean roundit false, no rounding; true, rounds the fraction. Rounding-precision is only length_of_fraction+1, all the other digits will be ignored. If length_of_fraction+1>=5, it will be rounded up, otherwise down. 


^ Reaper version 5.77Lua version 5.3 GetAllEntriesFromTable

Functioncall:

integer count, table foundtypes, table returned_table = ultraschall.GetAllEntriesFromTable(table table)

Description:
Gets an iterable version of table. Good for analysing unknown tables.

Returns the number of entries, a table(array) with the datatypes of each entry and the table with all it's entries in the same order as in the foundtypes-table.

This doesn't treat table recursivley, means: each "Subtable" within the table is treated as one entry of the type "table". That means, that these tables must be analysed themselves in an extra step!
A[1]=1
A[2][1]=2
A[2][2]=3.4
will return two(!) entries, the first being of type "integer", the second being of type "table". Next step would be to run use this function to analyse A[2] as well, which would result in two entries: the first being of type "integer" and the second of type "float", etc.

returns -1 in case of error

Returnvalues:
 integer count the number of table-entries found 
 table foundtypes a table, with count-entries, each entry having the type of each entry in the returned_table as string.
The types can be "nil", "integer", "float", "string", "boolean", "table", "function", "thread", "userdata" 
 table returned_table an iterable version of table. The type of each entry can be found in the accompanying entry of foundtypes
the format is returned_table[indexnr][1] - indexname/number of the original table-entry
               returned_table[indexnr][2] - the value of the original table-entry
the indexnr is 1 to count, while [indexnr][1] is the indexnr of the original-table-entry, which might be a string, functionname or something else as well 

Parameters:
 table table the table to get the individual entries from 


^ Reaper version 5.77Lua version 5.3 APIExists

Functioncall:

boolean retval = ultraschall.APIExists(string functionname)

Description:
returns true, if a certain function/variable exists in ultraschall.

returns false if nothing has been found

Returnvalues:
 boolean retval true, if element exists; false if it doesn't exist 

Parameters:
 string functionname the name of the function to check for; only the functionname without ultraschall. ! 


^ Reaper version 5.40Lua version 5.3 IsValidGuid

Functioncall:

boolean retval = ultraschall.IsValidGuid(string guid, boolean strict)

Description:
Checks, if guid is a valid guid. Can also be used for strings, that contain a guid somewhere in them(strict=false)

A valid guid is a string that follows the following pattern:
{........-....-....-....-............}
where . is a hexadecimal value(0-F)

Returns false in case of error

Returnvalues:
 boolean retval true, guid is/contains a valid guid; false, guid isn't/does not contain a valid guid 

Parameters:
 string guid the guid to check for validity 
 boolean strict true, guid must only be the valid guid; false, guid must contain a valid guid somewhere in it(means, can contain trailing or preceding characters) 


^ Reaper version 5.40Lua version 5.3 SetGuidExtState

Functioncall:

integer retval = ultraschall.SetGuidExtState(string guid, string key, string value, integer savelocation, boolean overwrite, boolean persists)

Description:
Sets an extension-state using a given guid. Good for storing additional metadata of objects like MediaTracks, MediaItems, MediaItem_Takes, etc(everything, that has a guid).
The state can be saved as either global extension state or "local" extension-project-state(in the currently opened project)
The guid can have additional text, but must contain a valid guid somewhere in it!
A valid guid is a string that follows the following pattern:
{........-....-....-....-............}
where . is a hexadecimal value(0-F)

Returns -1 in case of error

Returnvalues:
 integer retval the idx of the extstate(if a project extension state); 1, successful(with extension states), -1, unsuccessful 

Parameters:
 string guid the guid of the object, for whom you want to store a key/value-pair; can have additional characters before and after the guid, but must contain a valid guid! 
 string key the key for this guid 
 string value the value to store into the key/value-store 
 integer savelocation 0, store as project extension state(into the currently opened project); 1, store as global extension state(when persist=true, into reaper-extstate.ini in the resourcesfolder) 
 boolean overwrite true, overwrite a previous given value; false, don't overwrite, if a value exists already 
 boolean persists true, make extension state persistent(available after Reaper-restart); false, don't make it persistent; Only with global extension states 


^ Reaper version 5.40Lua version 5.3 SetBitfield

Functioncall:

integer new_integer_bitfield = ultraschall.SetBitfield(integer integer_bitfield, boolean set_to, integer bit_1, integer bit_2, ... integer bit_n)

Description:
Alters an integer-bitfield.

Returns nil in case of error, like invalid bit-values

Returnvalues:
 integer new_integer_bitfield the newly altered bitfield 

Parameters:
 integer integer_bitfield the old integer-bitfield that you want to alter 
 boolean set_to true, set the bits to 1; false, set the bits to 0; nil, toggle the bits 
 integer bit1..n one or more parameters, that include the bitvalues toset/unset/toggle with 1 for the first bit; 2 for the second, 4 for the third, 8 for the fourth, etc 


^ Reaper version 5.40Lua version 5.3 PreventCreatingUndoPoint

Functioncall:

ultraschall.PreventCreatingUndoPoint()

Description:
Prevents creation of an Undo-point. Only useful in non-defer-scripts.




^ Reaper version 5.40SWS version 2.9.7Lua version 5.3 SetIntConfigVar_Bitfield

Functioncall:

boolean retval, integer new_integer_bitfield = ultraschall.SetIntConfigVar_Bitfield(string configvar, boolean set_to, integer bit_1, integer bit_2, ... integer bit_n)

Description:
Alters an integer-bitfield stored by a ConfigVariable.

Returns false in case of error, like invalid bit-values, etc

Returnvalues:
 boolean retval true, if altering was successful; false, if not successful 
 integer new_integer_bitfield the newly altered bitfield 

Parameters:
 string configvar the config-variable, that is stored as an integer-bitfield, that you want to alter. 
 boolean set_to true, set the bits to 1; false, set the bits to 0; nil, toggle the bits 
 integer bit1..n one or more parameters, that include the bitvalues toset/unset/toggle with 1 for the first bit; 2 for the second, 4 for the third, 8 for the fourth, etc 


^ Reaper version 5.40Lua version 5.3 MakeCopyOfTable

Functioncall:

table table_copy = ultraschall.MakeCopyOfTable(table table)

Description:
Creates a true copy of a table(not only references).

adapted from Tyler Neylon's function, found at Stack Overflow

Returns nil if table isn't a valid table

Returnvalues:
 table table_copy the true copy of the table; nil in case of error 

Parameters:
 table table the table to create a copy from. 


^ Reaper version 5.40Lua version 5.3 ConvertStringToAscii_Array

Functioncall:

integer length, table byte_array = ultraschall.ConvertStringToAscii_Array(string string)

Description:
Converts a string into it's individual characters and numerical-representation as a table and after that returns its number of table-entries and the table.

Returns -1 if string isn't a valid string

Returnvalues:
 integer length the number of characters in the string/entries in the returned table byte_array 
 table byte_array the ByteArray as a table, with the format
     ByteArray[idx][1]="A" -- the byte itself
     ByteArray[idx][2]=65  -- the numerical representation of the byte 

Parameters:
 string string the string to be converted 


^ Reaper version 5.40Lua version 5.3 CompareStringWithAsciiValues

Functioncall:

boolean retval, integer errorposition = ultraschall.CompareStringWithAsciiValues(string string, integer bytevalue_1, integer bytevalue_2, ... integer bytevalue_n)

Description:
Compares a string with a number of byte-values(like ASCII-values).
Bytevalues can be either decimal and hexadecimal.
-1, if you want to skip checking of a specific position in string.

Returns false in case of error

Returnvalues:
 boolean retval true, if check was successful; false, if not successful 
 integer errorposition if retval is false, this will contain the position in string, where the checking failed; nil, if retval is true 

Parameters:
 string string the string to check against the bytevalues 
 integer bytevalue_1..n one or more parameters, that include the bytevalues to check against the accompanying byte in string; -1, if you want to skip check for that position 


^ Reaper version 5.40SWS version 2.9.7Lua version 5.3 ReturnsMinusOneInCaseOfError_Arzala

Functioncall:

integer retval = ultraschall.ReturnsMinusOneInCaseOfError_Arzala()

Description:
Returns -1 in case of an error

Returnvalues:
 integer retval returns -1 in case of error 



^ Reaper version 5.77Lua version 5.3 CountLinesInString

Functioncall:

integer number_of_lines = ultraschall.CountLinesInString(string String)

Description:
Counts the lines in a string. It counts them by counting \n-newlines(not carriage returns!)

Returns -1 in case of an error

Returnvalues:
 integer number_of_lines number of lines of the string 

Parameters:
 string String the string to count the lines of 


^ Reaper version 5.40Lua version 5.3 ReturnTypeOfReaperObject

Functioncall:

string objecttype = ultraschall.ReturnTypeOfReaperObject(Reaperobject object)

Description:
returns the type of a Reaper-object.

Returnvalues:
 string objecttype the type of the parameter of object
the following types can be returned:
ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source, None 

Parameters:
 Reaperobject object a Reaper-object of the following types:
ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source
returns None if the object isn't a valid Reaper-object 


^ Reaper version 5.40Lua version 5.3 IsObjectValidReaperObject

Functioncall:

boolean retval, string objecttype = ultraschall.IsObjectValidReaperObject(Reaperobject object)

Description:
checks, if object is a valid Reaper-object. It also returns the type of that Reaper-object.

Returnvalues:
 boolean retval true, if it's a valid Reaper-object; false, if not 
 string objecttype the type of the parameter of object
the following types can be returned:
ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source, None 

Parameters:
 Reaperobject object a Reaper-object of the following types:
ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source
returns None if the object isn't a valid Reaper-object 


^ Reaper version 5.40Lua version 5.3 KeepTableEntriesOfType

Functioncall:

table alteredtable = ultraschall.KeepTableEntriesOfType(table worktable, string keeptype)

Description:
Removes all entries from worktable, that are not of the datatype as given by keeptype.

returns nil in case of error

Returnvalues:
 table alteredtable the table, that contains only the entries of the type as given by parameter keeptype 

Parameters:
 table worktable the unaltered source-table for processing 
 string keeptype the type that shall remain in table
allowed are boolean, integer, float, number, table, string, userdata, thread, ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source 


^ Reaper version 5.40Lua version 5.3 RemoveTableEntriesOfType

Functioncall:

table alteredtable = ultraschall.RemoveTableEntriesOfType(table worktable, string removetype)

Description:
Removes all entries from worktable, that are of the datatype as given by removetype.

returns nil in case of error

Returnvalues:
 table alteredtable the table, that contains only the entries that are nt of the type as given by parameter removetype 

Parameters:
 table worktable the unaltered source-table for processing 
 string removetype the type that shall be removed from table
allowed are boolean, integer, float, number, table, string, userdata, ReaProject, MediaTrack, MediaItem, MediaItem_Take, TrackEnvelope, PCM_source 


^ Reaper version 5.40Lua version 5.3 IsItemInTrack3

Functioncall:

boolean retval = ultraschall.IsItemInTrack3(MediaItem MediaItem, string trackstring)

Description:
Checks, whether a MediaItem is in any of the tracks, given by trackstring.

see IsItemInTrack to use itemidx instead of the MediaItem-object.
see IsItemInTrack2 to check against only one track.

returns nil in case of error

Returnvalues:
 boolean retval true, if item is in track; false, if not 
 string trackstring a string with all tracknumbers, separated by commas; 1 for track 1, 2 for track 2, etc 

Parameters:
 MediaItem MediaItem the MediaItem, of which you want to know the track is is placed in 
 string trackstring a string with all tracknumbers, separated by commas; 1 for track 1, 2 for track 2, etc 


^ Reaper version 5.77Lua version 5.3 AddIntToChar

Functioncall:

string new_character = ultraschall.AddIntToChar(string character, integer int)

Description:
Adds/subtracts int to/from the numeric representation of character. It will return the new character.
It will not(!) include "overflows" into the adding/subtraction. That said, if you want to add a value resulting in a character above ASCII-code 255, it will fail!

Returns nil in case of an error

Returnvalues:
 string new_character the new character, after parameter int has been added/subtracted from/to character 

Parameters:
 string character the character, onto which you want to add/subtract parameter int; only single character allowed 
 integer int the value, that you want to add to the numerical representation of parameter character 


^ Reaper version 5.92Lua version 5.3 MakeFunctionUndoable

Functioncall:

boolean retval, string current_UndoMessage, retvals_1, ..., retvals_2 = ultraschall.MakeFunctionUndoable(function Func, string UndoMessage, integer Flag, Func_parameters_1, ... Func_parameters_n)

Description:
Run the function Func and create an undopoint for this function. You can also give an UndoMessage and a flag for Reaper to use.
All parameters needed by Func follow after parameter Flag, as if it would be the normal parameters.
This should make creating undo-points much much easier...

Note: Reaper will use the undo-point only for functions, who do "undo"-able things. If you don't have something of that kind(no creating a track or something), Reaper will not create an undo-point.

Returns false in case of an error

Returnvalues:
 boolean retval true, undoing was successful; false, undoing wasn't successful 
 string current_UndoMessage the current UndoMessage for the last action done by Reaper. Use this so see, if getting an undo-point was successful 
 retvals_1 ... retvals_2 the returnvalues, as returned by function Func 

Parameters:
 function Func the function, that you want to create an undo-point for 
 string UndoMessage the undo-message to be displayed by Reaper in the Undo-history 
 integer Flag you can set a flag, if you want, for this undo-point 
 Func_parameters_1, ... Func_parameters_n the parameters, as needed by the function Func; will be given to Func as provided by you 


^ Reaper version 5.92Lua version 5.3 ReturnTableAsIndividualValues

Functioncall:

retval1, retval2, retval3, ... , retval64 = ultraschall.ReturnTableAsIndividualValues(table Table)

Description:
Returns the first 64 entries of an numerical-indexed table as returnvalues

Returnvalues:
 retval1 ... retval64 the values from Table returned 

Parameters:
 table Table the table, whose values you want to return. It will only return values with index 1...64! 


^ Reaper version 5.77Lua version 5.3 type

Functioncall:

string type_of_object, optional boolean isnumber = ultraschall.type(identifier object)

Description:
Returns the type of the object.
Supported types are Lua's own datatypes as well as Reaper's own datatypes.

Due API-limitations, SWS-specific datatypes are not supported in this function!

Returnvalues:
 string type_of_object the type of the object; the following are valid:
nil, number: integer, number: float, boolean, string, function, table, thread, userdata,
ReaProject, MediaItem, MediaItem_Take, MediaTrack, TrackEnvelope, AudioAccessor, joystick_device, PCM_source
userdata will be shown, if object isn't of any known type 
 optional boolean isnumber true, if object is a number(either integer or number) 

Parameters:
 identifier object the object, whose type you want to know 


^ Reaper version 5.95Lua version 5.3 ConcatIntegerIndexedTables

Functioncall:

integer numentries, array concatenated_table = ultraschall.ConcatIntegerIndexedTables(array table1, array table2)

Description:
Concatenates the entries of two tables into one table. The entries of each table must be indexed by integers

The new table still has the same references as the old table, means: if you remove the old tables/entries in the old tables, the concatenated table/accompanying entries will loose elements.
To get a "true"-concatenated copy, you should first create new copies of the tables, using MakeCopyOfTable.

Returnvalues:
 integer numentries the number of entries in the new table 
 array concatenated_table the new concatenated table 

Parameters:
 array table1 the first table to be concatenated; the entries must be indexed by integer-numbers! 
 array table2 the second table to be concatenated; the entries must be indexed by integer-numbers! 


^ Reaper version 5.40Lua version 5.3 ReverseTable

Functioncall:

table reversed_table, integer entry_count = ultraschall.ReverseTable(table the_table)

Description:
reversed the order of the entries of a table, means, the last entry will become the first, the first become the last, etc.
The table must be indexed by integers.

Returns nil if table isn't a valid table

Returnvalues:
 table reversed_table the resulting table with the reversed order of all entries 
 integer entry_count the number of entries in the reversed_table 

Parameters:
 table table the table, whose entries you want to reverse 


^ Reaper version 5.95Lua version 5.3 GetDuplicatesFromArrays

Functioncall:

integer duplicate_count, array duplicate_array, integer originalscount_array1, array originals_array1, integer originalscount_array2, array originals_array2 = ultraschall.GetDuplicatesFromArrays(array array1, array array2)

Description:
Returns the duplicates and the originals(entries only in one of the arrays) of two arrays. It will also return the number of entries.

This works only on arrays with integer-indexed entries; index must start with index 1!

returns -1 in case of an error

Returnvalues:
 integer duplicate_count the number of entries in both arrays 
 array duplicate_array the entries in both arrays 
 integer originalscount_array1 the number of entries only in array1 
 array originals_array1 the entries that are only existing in array1 
 integer originalscount_array2 the number of entries only in array2 
 array originals_array2 the entries that are only existing in array2 

Parameters:
 array array1 the first array to check for duplicates and "original"-entries 
 array array2 the second array to check for duplicates and "original"-entries 


^ Reaper version 5.95SWS version 2.9.7Lua version 5.3 GetScriptFilenameFromActionCommandID

Functioncall:

string scriptfilename_with_path = ultraschall.GetScriptFilenameFromActionCommandID(string action_command_id)

Description:
returns the filename with path of a script, associated to a ReaScript.
Command-ID-numbers do not work!
                        
returns false in case of an error

Returnvalues:
 string scriptfilename_with_path the scriptfilename with path associated with this ActionCommandID 

Parameters:
 string Path the path to set as new current working directory 


^ Reaper version 5.95Lua version 5.3 CombineBytesToInteger

Functioncall:

integer retval = ultraschall.CombineBytesToInteger(integer bitoffset, integer Byte_1, optional Byte_2, ..., optional Byte_n)

Description:
Combines the Byte-values Byte_1 to Byte_n into one integer.
That means, if you give 4 values, it will return a 32bit-integer(4*8Bits).

Negative values will use the maximum possible value of that byte minus the bits.
In Byte_1, -2 will be 255-1=254, in Byte 2, -2 will be 65280-256=65024.

Use bitoffset to define, from which bit on you want to combine the values.

Returns -1 in case of an error

Returnvalues:
 integer retval the combined integer 

Parameters:
 integer bitoffset if you want to start combining the values from a certain bitoffset-onwards, set the offset here; use 0 to start with the first bit. 
 integer Byte_1 a bytevalue that you want to combine into one 
 optional integer Byte_2 a bytevalue that you want to combine into one 


^ Reaper version 5.95Lua version 5.3 SplitIntegerIntoBytes

Functioncall:

integer Byte1, integer Byte2, integer Byte3, integer Byte4 = ultraschall.SplitIntegerIntoBytes(integer integervalue)

Description:
Splits a 32-bit-integer-value into four bytes.

Returns -1 in case of an error

Returnvalues:
 integer Byte1 the first eight bits of the integer-value as a Byte 
 integer Byte2 the second eight bits of the integer-value as a Byte 
 integer Byte3 the third eight bits of the integer-value as a Byte 
 integer Byte4 the fourth eight bits of the integer-value as a Byte 

Parameters:
 integer integeroffset the integer-value that you want to split into individual bytes 


^ Reaper version 5.95Lua version 5.3 GetReaperScriptPath

Functioncall:

string reaper_script_path = ultraschall.GetReaperScriptPath()

Description:
Returns path to Reaper's script-folder

Returnvalues:
 string reaper_script_path the path of the scripts-folder of Reaper 



^ Reaper version 5.95Lua version 5.3 GetReaperColorThemesPath

Functioncall:

string reaper_colorthemes_path = ultraschall.GetReaperColorThemesPath()

Description:
Returns path to Reaper's color-theme-folder

Returnvalues:
 string reaper_colorthemes_path the path of the color-theme-folder of Reaper 



^ Reaper version 5.95Lua version 5.3 GetReaperJSFXPath

Functioncall:

string reaper_jsfx_path = ultraschall.GetReaperJSFXPath()

Description:
Returns path to Reaper's JSFX-plugin-folder

Returnvalues:
 string reaper_jsfx_path the path of the JSFX-plugin-folder of Reaper 



^ Reaper version 5.95Lua version 5.3 GetReaperWebRCPath

Functioncall:

string reaper_webrc_path, string user_webrc_path = ultraschall.GetReaperWebRCPath()

Description:
Returns path to the Web-RC-folder for Reaper as well as for the user-webrc-pages.

Returnvalues:
 string reaper_script_path the path of the JSFX-plugin-folder of Reaper 



^ Reaper version 5.95Lua version 5.3 CycleTable

Functioncall:

table new_table = ultraschall.CycleTable(table the_table, integer offset)

Description:
Cycles the entries by offset. Offset can be positive(cycle forward) or negative(cycle negative). The number also tells the function, by how many entries the table shall be cycled, with 1 for one entry, 2 for 2 entries, etc.
Entries "falling out" of one side(top or bottom) of the table will be readded on the other side.

returns nil in case of error

Returnvalues:
 table new_table the altered table 

Parameters:
 table the_table the table to cycle through 
 integer offset the offset, by which to cycle the entries through; positive, cycle entries forward; negative, cycle entries backward 


^ Reaper version 5.941Lua version 5.3 SplitStringAtNULLBytes

Functioncall:

integer count, array split_strings = ultraschall.SplitStringAtNULLBytes(string splitstring)

Description:
Splits splitstring into individual string at NULL-Bytes.

returns -1 in case of an error

Returnvalues:
 integer count the number of found strings 
 array split_strings the found strings put into an array 

Parameters:
 string splitstring the string with NULL-Bytes(\0) into it, that you want to split 


^ Reaper version 5.95Lua version 5.3 RunBackgroundHelperFeatures

Functioncall:

ultraschall.RunBackgroundHelperFeatures(boolean switch_on)

Description:
Starts background-scripts supplied with the Ultraschall-API, like:

- a script for getting the last edit-cursor-position before the current one -> GetLastCursorPosition()
- a script for getting the last playstate before the current one -> GetLastPlayState()
- a script for getting the last loopstate before the current one -> GetLastLoopState()


Parameters:
 boolean switch_on true, start the background-scripts/start unstarted background-helper-scripts; false, stop all background-helper-scripts 


^ Reaper version 5.95Lua version 5.3 Main_OnCommandByFilename

Functioncall:

boolean retval, string script_identifier = ultraschall.Main_OnCommandByFilename(string filename, string ...)

Description:
Runs a command by a filename. It internally registers the file temporarily as command, runs it and unregisters it again.
This is especially helpful, when you want to run a command for sure without possible command-id-number-problems.

It returns a unique script-identifier for this script, which can be used to communicate with this script-instance.
The started script gets its script-identifier using GetScriptIdentifier.
You can use this script-identifier e.g. as extstate.

Returns false in case of an error

Returnvalues:
 boolean retval true, if running it was successful; false, if not 
 string script_identifier a unique script-identifier, which can be used as extstate to communicate with the started scriptinstance 

Parameters:
 string filename the name and path of the scriptfile to run 
 string ... parameters that shall be passed over to the script 


^ Reaper version 5.965Julian Sader's plugin version 0.962Lua version 5.3 MIDI_OnCommandByFilename

Functioncall:

boolean retval, string script_identifier = ultraschall.MIDI_OnCommandByFilename(string filename, optional HWND Midi_EditorHWND, string ...)

Description:
Runs a command by a filename in the MIDI-editor-context. It internally registers the file temporarily as command, runs it and unregisters it again.
This is especially helpful, when you want to run a command for sure without possible command-id-number-problems.

It returns a unique script-identifier for this script, which can be used to communicate with this script-instance.
The started script gets its script-identifier using GetScriptIdentifier.
You can use this script-identifier e.g. as extstate.

Returns false in case of an error

Returnvalues:
 boolean retval true, if running it was successful; false, if not 
 string script_identifier a unique script-identifier, which can be used as extstate to communicate with the started scriptinstance 

Parameters:
 HWND Midi_EditorHWND the window-handler of the MIDI-editor, in which to run the script; nil, for the last active MIDI-editor 
 string filename the name plus path of the scriptfile to run 
 string ... parameters, that shall be passed over to the script 


^ Reaper version 5.965Lua version 5.3 GetScriptParameters

Functioncall:

integer num_params, array params, string caller_script_identifier = ultraschall.GetScriptParameters(optional string script_identifier, optional boolean remove)

Description:
Gets the parameters stored for a specific script_identifier.

Returnvalues:
 integer num_params the number of parameters available 
 array params the values of the parameters as an array 
 string caller_script_identifier the scriptidentifier of the script, that set the parameters 

Parameters:
 optional string script_identifier the script-identifier, whose parameters you want to retrieve;
use nil, to get the parameters stored for the current script 
 optional boolean remove true or nil, remove the stored parameter-extstates; false, keep them for later retrieval 


^ Reaper version 5.965Lua version 5.3 SetScriptParameters

Functioncall:

boolean retval, string script_identifier = ultraschall.SetScriptParameters(string script_identifier, string ...)

Description:
Sets the parameters stored for a specific script_identifier.

Returnvalues:
 boolean retval true, storing was successful 
 string script_identifier the script_identifier, whose parameters have been set 

Parameters:
 string script_identifier the script-identifier, whose parameters you want to retrieve;
use nil, to set the parameters stored for the current script 
 string ... the parameters you want to set; there can be more than one, but they must be strings 


^ Reaper version 5.965Lua version 5.3 GetScriptReturnvalues

Functioncall:

integer num_params, array retvals = ultraschall.GetScriptReturnvalues(sender_script_identifier, optional boolean remove)

Description:
Gets the return-values which a specific senderscriptidentifier sent to the current script.

If you have started numerous child-scripts and want to know, which child-script sent you return-values, see GetScriptReturnvalues_Sender

returns -1 in case of an error

Returnvalues:
 integer num_retvals the number of return-values available 
 array params the values of the return-values as an array 

Parameters:
 optional string sender_script_identifier the script-identifier, that sent the return-values to your script 
 optional boolean remove true or nil, remove the stored retval-extstates; false, keep them for later retrieval 


^ Reaper version 5.965Lua version 5.3 SetScriptReturnvalues

Functioncall:

boolean retval = ultraschall.SetScriptReturnvalues(string script_identifier, string ...)

Description:
Send return-values back to the script, that has a specific script_identifier.

returns false in case of an error

Returnvalues:
 boolean retval true, storing was successful; false, there was an error 

Parameters:
 string script_identifier the script-identifier of the script-instance, to where you want to send the returnvalues  
 string ... the returnvalues you want to set; there can be more than one, but they must be strings 


^ Reaper version 5.965Lua version 5.3 GetScriptReturnvalues_Sender

Functioncall:

integer count, array retval_sender = ultraschall.GetScriptReturnvalues_Sender()

Description:
Retrieves, which scripts sent returnvalues to the current script.

Returnvalues:
 integer count the number of scripts, who have left returnvalues for the current script 
 array retval_sender the ScriptIdentifier of the scripts, who returned values 



^ Reaper version 5.965Lua version 5.3 Base64_Encoder

Functioncall:

string encoded_string = ultraschall.Base64_Encoder(string source_string, optional integer base64_type, optional integer remove_newlines, optional integer remove_tabs)

Description:
Converts a string into a Base64-Encoded string.
Currently, only standard Base64-encoding is supported.

Returns nil in case of an error

Returnvalues:
 string encoded_string the encoded string 

Parameters:
 string source_string the string that you want to convert into Base64 
 optional integer base64_type the Base64-decoding-style
nil or 0, for standard default Base64-encoding 
 optional integer remove_newlines 1, removes \n-newlines(including \r-carriage return) from the string
2, replaces \n-newlines(including \r-carriage return) from the string with a single space 
 optional integer remove_tabs 1, removes \t-tabs from the string
2, replaces \t-tabs from the string with a single space 


^ Reaper version 5.965Lua version 5.3 Base64_Decoder

Functioncall:

string decoded_string = ultraschall.Base64_Decoder(string source_string, optional integer base64_type)

Description:
Converts a Base64-encoded string into a normal string.
Currently, only standard Base64-encoding is supported.

Returns nil in case of an error

Returnvalues:
 string decoded_string the decoded string 

Parameters:
 string source_string the Base64-encoded string 
 optional integer base64_type the Base64-decoding-style
nil or 0, for standard default Base64-encoding 


^ Reaper version 5.965Lua version 5.3 StateChunkLayouter

Functioncall:

string layouted_statechunk = ultraschall.StateChunkLayouter(string statechunk)

Description:
Layouts StateChunks as returned by GetTrackStateChunk or GetItemStateChunk into a format that resembles the formatting-rules of an rpp-file.
This is very helpful, when parsing such a statechunk, as you can now use the number of spaces used for intendation as help parsing.
Usually, every new element, that starts with < will be followed by none or more lines, that have two spaces added in the beginning.
Example of a MediaItemStateChunk(I use . to display the needed spaces in the beginning of each line):

<ITEM
..POSITION 6.96537864205337
..SNAPOFFS 0
..LENGTH 1745.2745
..LOOP 0
..ALLTAKES 0
..FADEIN 1 0.01 0 1 0 0
..FADEOUT 1 0.01 0 1 0 0
..MUTE 0
..SEL 1
..IGUID {020E6372-97E6-4066-9010-B044F67F2772}
..IID 1
..NAME myaudio.flac
..VOLPAN 1 0 1 -1
..SOFFS 0
..PLAYRATE 1 1 0 -1 0 0.0025
..CHANMODE 0
..GUID {79F087CE-49E8-4212-91F5-8487FBCF10B1}
..<SOURCE FLAC
....FILE "C:\Users\meo\Desktop\X_Karo_Lynn-Interview.flac"
..>
>


This function will not check, if you've passed a valid statechunk!

returns nil in case of an error

Returnvalues:
 string layouted_statechunk the statechunk, that is now layouted to the rules of rpp-projectfiles 

Parameters:
 string statechunk a statechunk, that you want to layout properly 


^ Reaper version 5.965Lua version 5.3 ReverseEndianess_Byte

Functioncall:

integer newbyte = ultraschall.ReverseEndianess_Byte(integer byte)

Description:
reverses the endianess of a byte and returns this as value.
The parameter byte must be between 0 and 255!

returns nil in case of an error

Returnvalues:
 integer newbyte the endianess-reversed byte 

Parameters:
 integer byte the integer whose endianess you want to reverse 


^ Reaper version 5.965Lua version 5.3 ConvertIntegerToBits

Functioncall:

string bitvals_csv, table bitvalues = ultraschall.ConvertIntegerToBits(integer integer)

Description:
converts an integer-value(up to 64 bits) into it's individual bits and returns it as comma-separated csv-string as well as a table with 64 entries.

returns nil in case of an error

Returnvalues:
 string bitvals_csv a comma-separated csv-string of all bitvalues, with bit 1 coming first and bit 32 coming last 
 table bitvalues a 64-entry table, where each entry contains the bit-value of integer; first entry for bit 1, 64th entry for bit 64 

Parameters:
 integer integer the integer-number to separated into it's individual bits 


^ Reaper version 5.965Lua version 5.3 ConvertBitsToInteger

Functioncall:

integer integervalue = ultraschall.ConvertBitsToInteger(table bitvalues)

Description:
converts a table with all bitvalues into it's integer-representation.
each table-entry holds either a 1 or a 0;
  with index 1 being the first (for 1),
  index 2 for the second (for 2),
  index 3 for the third (for 4),
  index 4 for the fourth(for 8), etc

returns nil in case of an error

Returnvalues:
 integer integer the integer-number converted from the integer-entries 

Parameters:
 table bitvalues a table, where each entry contains the bit-value of integer; first entry for bit 1, 64th entry for bit 64, etc 


^ Reaper version 5.965SWS version 2.9.7Lua version 5.3 GetSetIntConfigVar

Functioncall:

boolean retval, integer config_var_value = ultraschall.GetSetIntConfigVar(string varname, boolean set, optional boolean bit1, ..., optional boolean bit32)

Description:
Gets/Sets an integer-bitfield of an integer-configvariable.

Pass to it a varname, if it shall be set or gotten from and up to 32 parameters who specify, if that bit shall be set(true) or not(false) or the currently set value shall be used(nil)

See Reaper_Config_Variables.html for more details on config-variables in Reaper.

returns false in case of an error

Returnvalues:
 boolean retval true, getting/setting the config-var was successful; false, it wasn't successful 
 integer config_var_value the new/current value of the configuration-variable 

Parameters:
 string varname the name of the config-variable 
 boolean set true, set this config-var; false, don't set it 
 optional boolean bit1 true, set this bit; false, don't set this bit; nil, use the currently set value
true, set this bit; false, don't set this bit; nil, use the currently set value 
 optional boolean bit32 true, set this bit; false, don't set this bit; nil, use the currently set value 


^ Reaper version 5.965Lua version 5.3 GetScriptIdentifier

Functioncall:

string script_identifier = ultraschall.GetScriptIdentifier()

Description:
The Ultraschall-API gives any script, that uses the API, a unique identifier generated when the script is run.
This identifier can be used to communicate with this script. If you start numerous instances of a script, it will create for each instance
its own script-identifier, so you can be sure, that you communicate with the right instance.

The identifier is of the format "ScriptIdentifier:scriptfilename-{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.ext", where the {}-part is a guid and ext either .lua .py or .eel

Defer1 to Defer20 make use of this to stop a running defer-loop from the outside of a deferred-script.

Returnvalues:
 string script_identifier a unique script-identifier for this script-instance, of the format:
ScriptIdentifier: scriptfilename-guid 



^ Reaper version 5.965Lua version 5.3 ReplacePartOfString

Functioncall:

string replaced_string = ultraschall.ReplacePartOfString(string originalstring, string insertstring, integer offset, optional integer length)

Description:
replaces a part of a string with a second string

Returns nil in case of an error

Returnvalues:
 string replaced_string the altered string 

Parameters:
 string originalstring the originalstring, in which you want to insert the string 
 string insertstring the string that shall be inserted 
 integer offset the position, at which to insert the string; it is the position BEFORE the position at which to insert, so if you want to replace the 25th character, offset is 24! 
 optional integer length the length of the part of the originalstring that shall be replaced, counted from offset. 0 or nil for simple insertion. 


^ Reaper version 5.77Lua version 5.3 SearchStringInString

Functioncall:

integer count, array posarray = ultraschall.SearchStringInString(string fullstring, string searchstring)

Description:
Searches for the string searchstring in fullstring.

Keep in mind: Umlauts may produce multibyte-values. Therefore, the returned offsets might be confusing.

returns -1 in case of error, 0 if string wasn't found

Returnvalues:
 integer count the number of found occurences of searchstring in fullstring 
 array posarray an array that contains the positions, where searchstring was found within fullstring 

Parameters:
 string fullstring the string to be searched through 
 string searchstring the string to search for within fullstring 


^ Reaper version 5.965SWS version 2.9.7Lua version 5.3 print3

Functioncall:

print(parameter_1 to parameter_n)

Description:
like print, but puts the parameters into the clipboard.

Converts all parametes given into string using tostring() and puts them into the clipboard, with each parameter separated by two spaces.
Unlike print and print2, this does NOT end with a newline!


Parameters:
 parameter_1 to parameter_n the parameters, that you want to have put into the clipboard 


^ Reaper version 5.965Lua version 5.3 MKVOL2DB

Functioncall:

number db_value = ultraschall.MKVOL2DB(number mkvol_value)

Description:
Converts an MKVOL-value into a dB-value.

MKVOL-values are used by the routing-functions for HWOut/AUXSendReceive, specifically for their volume-value as these can't be converted using Reaper's own DB2SLIDER or SLIDER2DB, so this function should help you.

This function is an adapted one from the function provided in Plugins/reaper_www_root/main.js

See DB2MKVOL to convert a dB-value into it's MKVOL-representation

returns nil in case of an error

Returnvalues:
 number db_value the dB-value, converted from the MKVOL-value; minimum -144dB 

Parameters:
 number mkvol_value the mkvol_value, that you want to convert into dB 


^ Reaper version 5.965Lua version 5.3 DB2MKVOL

Functioncall:

number mkvol_value = ultraschall.DB2MKVOL(number db_value)

Description:
Converts an dB-value into a MKVOL-value.

MKVOL-values are used by the routing-functions for HWOut/AUXSendReceive, specifically for their volume-value as these can't be converted using Reaper's own DB2SLIDER or SLIDER2DB, so this function should help you.

See MKVOL2DB to convert a MKVOL-value into it's dB-representation

returns nil in case of an error

Returnvalues:
 number mkvol_value the mkvol-value, converted from the dB-value 

Parameters:
 number db_value the dB-value, that you want to convert into the MKVOL-value; minimum is -144dB 


^ Reaper version 5.965Lua version 5.3 ConvertIntegerIntoString2

Functioncall:

string converted_value = ultraschall.ConvertIntegerIntoString2(integer Size, integer integervalue_1, ..., integer integervalue_n)

Description:
Splits numerous integers into its individual bytes and converts them into a string-representation.
Maximum 32bit-integers are supported.

Returns nil in case of an error.

Returnvalues:
 string converted_value the string-representation of the integer 

Parameters:
 integer Size the maximum size of the integer to convert, 1(8 bit) to 4(32 bit) 
 integer integervalue_1 the first integer value to convert from
 
 integer integervalue_n the last integer value to convert from 


^ Reaper version 5.965Lua version 5.3 ConvertStringToIntegers

Functioncall:

integer num_integers, array individual_integers = ultraschall.ConvertStringToIntegers(string String, integer Size)

Description:
Converts a string into its integer-representation. Allows you to set the size of the integers between 1 Byte and 8 Bytes(64 bits).

Returns -1 in case of an error.

Returnvalues:
 integer num_integers the number of integers converted from this string 
 array individual_integers the individual integers, as converted from the original string 

Parameters:
 string String the string to convert into its integer representation 
 integer Size the size of the integers. 1 for 8 bits, 2 for 16 bits, ..., 8 for 64 bits 


^ Reaper version 5.965Lua version 5.3 print_update

Functioncall:

print_update(parameter_1 to parameter_n)

Description:
replaces Lua's own print-function, that is quite useless in Reaper.

Converts all parametes given into string using tostring() and displays them in the ReaScript-console, separated by two spaces, ending with a newline.

This is like print, but clears console everytime before displaying the values. Good for status-display, that shall not scroll.


Parameters:
 parameter_1 to parameter_n the parameters, that you want to have printed out 


^ Reaper version 5.965Lua version 5.3 SetScriptIdentifier_Description

Functioncall:

integer retval = ultraschall.SetScriptIdentifier_Description(string description)

Description:
The Ultraschall-API gives any script, that uses the API, a unique identifier generated when the script is run.
This identifier can be used to communicate with this script. If you start numerous instances of a script, it will create for each instance
its own script-identifier, so you can be sure, that you communicate with the right instance.

With this function, you can set its description, that is less cryptic than the ScriptIdentifier itself.

You can get it using GetScriptIdentifier_Description.

returns -1 in case of an error

Returnvalues:
 integer retval -1 in case of an error 

Parameters:
 string description the new description of your script 


^ Reaper version 5.965Lua version 5.3 GetScriptIdentifier_Description

Functioncall:

string script_identifier_description = ultraschall.GetScriptIdentifier_Description()

Description:
The Ultraschall-API gives any script, that uses the API, a unique identifier generated when the script is run.
This identifier can be used to communicate with this script. If you start numerous instances of a script, it will create for each instance
its own script-identifier, so you can be sure, that you communicate with the right instance.

With this function, you can get its description, that is less cryptic than the ScriptIdentifier itself.

You can set it using SetScriptIdentifier_Description.

Returnvalues:
 string script_identifier_description the description of your script 



^ Reaper version 5.965Lua version 5.3 SetScriptIdentifier_Title

Functioncall:

integer retval = ultraschall.SetScriptIdentifier_Title(string title)

Description:
The Ultraschall-API gives any script, that uses the API, a unique identifier generated when the script is run.
This identifier can be used to communicate with this script. If you start numerous instances of a script, it will create for each instance
its own script-identifier, so you can be sure, that you communicate with the right instance.

With this function, you can set its title, that is less cryptic than the ScriptIdentifier itself.
No \n-newlines, \r-carriag returns or \0-nullbytes are allowed and will be removed

You can get it using GetScriptIdentifier_Title.

returns -1 in case of an error

Returnvalues:
 integer retval -1 in case of an error 

Parameters:
 string title the new title of your script 


^ Reaper version 5.965Lua version 5.3 GetScriptIdentifier_Title

Functioncall:

string script_identifier_title = ultraschall.GetScriptIdentifier_Title()

Description:
The Ultraschall-API gives any script, that uses the API, a unique identifier generated when the script is run.
This identifier can be used to communicate with this script. If you start numerous instances of a script, it will create for each instance
its own script-identifier, so you can be sure, that you communicate with the right instance.

With this function, you can get its description, that is less cryptic than the ScriptIdentifier itself.

Default is the script's filename.

You can set it using SetScriptIdentifier_Title.

Returnvalues:
 string script_identifier_title the title of your script; default is the filename of the script 



^ Reaper version 5.965Lua version 5.3 ResetProgressBar

Functioncall:

ultraschall.ResetProgressBar()

Description:
Resets the initial-values of the progressbar. Should be called, if you want to start a new progressbar after you filled up the former one, or you may have update-issues.




^ Reaper version 5.965Lua version 5.3 PrintProgressBar

Functioncall:

boolean retval = ultraschall.PrintProgressBar(boolean show, integer length, integer maximumvalue, integer currentvalue, boolean percentage, integer offset, optional string toptext, optional string bottomtext)

Description:
Calculate a simple progressbar, which can be optionally displayed in the ReaScript console; Will clear the console before displaying the next updated progressbar.

Will update it only, if the current-value of last time this function got called is different from the current one or toptext or bottomtext changed.

You can also use the returnvalues to draw your own progressbar, e.g. in a gfx.init-window

If you need to calculate a new progressbar, after the former got to 100%, it is wise to call ResetProgressBar, or it might not update the first time you call this function.

Returns false in case of an error

Returnvalues:
 boolean retval true, displaying was successful; false, displaying wasn't successful 
 string ProgressString the progressbar including its full statuses and layout 
 integer percentage the progression of the progressbar in percent 
 integer progress_position the current progress-position, relative to length and maximumvalue 

Parameters:
 boolean show true, show progressbar in the ReaScript-console; false, don't show it there 
 integer length the length of the progressbar in characters. Minimum is 10. 
 integer maximumvalue the maximum integer-value, to which to count; minimum 1 
 integer currentvalue the current integer-value, at which we are with counting, minimum 0 
 boolean percentage true, show percentage in progressbar; false, show only progressbar 
 integer offset an offset to be added before the progressbar, so you can indent it 
 optional string toptext an optional string, that shall be displayed above the progressbar 
 optional string bottomtext an optional string, that shall be displayed below the progressbar 


^ Reaper version 5.975Lua version 5.3 StoreFunctionInExtState

Functioncall:

boolean retval = ultraschall.StoreFunctionInExtState(string section, string key, function func, boolean debug)

Description:
Stores a function into an extstate. You can store it's debug-information as well.

To load the function again, use LoadFunctionFromExtState

Returns false in case of an error

Returnvalues:
 boolean retval true, setting was successful; false, it was unsuccessful 

Parameters:
 string section the sectionname of the extstate 
 string key the keyname of the extstate 
 function func the function, that you want to store 
 boolean debug true, store debug-values as well; false, don't store the debug-values as well 


^ Reaper version 5.975Lua version 5.3 LoadFunctionFromExtState

Functioncall:

function function = ultraschall.LoadFunctionFromExtState(string section, string key)

Description:
Loads a function from an extstate, if it has been stored in there before.
The extstate must contain a valid function. If something else is stored, the loaded "function" might crash Lua!

To store the function, use StoreFunctionInExtState

Returns false in case of an error

Returnvalues:
 function func the stored function, that you want to (re-)load 

Parameters:
 string section the sectionname of the extstate 
 string key the keyname of the extstate 


^ Reaper version 5.977Lua version 5.3 ConvertHex2Ascii

Functioncall:

string ascii_string = ultraschall.ConvertHex2Ascii(string hexstring)

Description:
converts a hexstring into an ascii-string.

Will convert 2 hexvalues into one byte.

Returns nil in case of an error

Returnvalues:
 string ascii_string the converted string 

Parameters:
 string hexstring the original string with only hexadecimal numbers  


^ Reaper version 5.977Lua version 5.3 ConvertAscii2Hex

Functioncall:

string hexstring = ultraschall.ConvertAscii2Hex(string ascii_string)

Description:
converts an ascii-string into a hexstring.

Returns nil in case of an error

Returnvalues:
 string hexstring the original string with only hexadecimal numbers  

Parameters:
 string ascii_string the converted string 


^ Reaper version 5.975Lua version 5.3 get_action_context_MediaItemDiff

Functioncall:

MediaItem MediaItem, MediaItem_Take MediaItem_Take, MediaItem MediaItem_unlocked, boolean Item_moved, number StartDiffTime, number EndDiffTime, number LengthDiffTime, number OffsetDiffTime = ultraschall.get_action_context_MediaItemDiff(optional boolean exlude_mousecursorsize, optional integer x, optional integer y)

Description:
Returns the currently clicked MediaItem, Take as well as the difference of position, end, length and startoffset since last time calling this function.
Good for implementing ripple-drag/editing-functions, whose position depends on changes in the currently clicked MediaItem.
Repeatedly call this (e.g. in a defer-cycle) to get all changes made, during dragging position, length or offset of the MediaItem underneath mousecursor.

This function takes into account the size of the start/end-drag-mousecursor, that means: if mouse-position is within 3 pixels before start/after end of the item, it will get the correct MediaItem.
This is a workaround, as the mouse-cursor changes to dragging and can still affect the MediaItem, even though the mouse at this position isn't above a MediaItem anymore.
To be more strict, set exlude_mousecursorsize to true. That means, it will only detect MediaItems directly beneath the mousecursor. If the mouse isn't above a MediaItem, this function will ignore it, even if the mouse could still affect the MediaItem.
If you don't understand, what that means: simply omit exlude_mousecursorsize, which should work in almost all use-cases. If it doesn't work as you want, try setting it to true and see, whether it works now.    

Returnvalues:
 MediaItem MediaItem the MediaItem at the current mouse-position; nil if not found 
 MediaItem_Take MediaItem_Take the MediaItem_Take underneath the mouse-cursor 
 MediaItem MediaItem_unlocked if the MediaItem isn't locked, you'll get a MediaItem here. If it is locked, this retval is nil 
 boolean Item_moved true, the item was moved; false, only a part(either start or end or offset) of the item was moved 
 number StartDiffTime if the start of the item changed, this is the difference;
   positive, the start of the item has been changed towards the end of the project
   negative, the start of the item has been changed towards the start of the project
   0, no changes to the itemstart-position at all 
 number EndDiffTime if the end of the item changed, this is the difference;
   positive, the end of the item has been changed towards the end of the project
   negative, the end of the item has been changed towards the start of the project
   0, no changes to the itemend-position at all 
 number LengthDiffTime if the length of the item changed, this is the difference;
   positive, the length is longer
   negative, the length is shorter
   0, no changes to the length of the item 
 number OffsetDiffTime if the offset of the item-take has changed, this is the difference;
   positive, the offset has been changed towards the start of the project
   negative, the offset has been changed towards the end of the project
   0, no changes to the offset of the item-take
Note: this is the offset of the take underneath the mousecursor, which might not be the same size, as the MediaItem itself!
So changes to the offset maybe changes within the MediaItem or the start of the MediaItem!
This could be important, if you want to affect other items with rippling. 

Parameters:
 optional boolean exlude_mousecursorsize false or nil, get the item underneath, when it can be affected by the mouse-cursor(dragging etc): when in doubt, use this
true, get the item underneath the mousecursor only, when mouse is strictly above the item,
       which means: this ignores the item when mouse is not above it, even if the mouse could affect the item 
 optional integer x nil, use the current x-mouseposition; otherwise the x-position in pixels 
 optional integer y nil, use the current y-mouseposition; otherwise the y-position in pixels 


^ Reaper version 5.977SWS version 2.10.0.1Lua version 5.3 GetAllActions

Functioncall:

integer number_of_actions, table actiontable = ultraschall.GetAllActions(integer section)

Description:
Returns all actions and accompanying attributes from a specific section as a handy table

The table is of the following format:

actiontable[index]["commandid"] - the command-id-number of the action
actiontable[index]["actioncommandid"] - the action-command-id-string of the action, if it's a named command(usually scripts or extensions), otherwise empty string
actiontable[index]["name"] - the name of command
actiontable[index]["scriptfilename"] - the filename+path of a command, that is a ReaScript, otherwise empty string
actiontable[index]["termination"] - the termination-state of the action
-1 - not available
4 - Dialogwindow appears(Terminate, New Instance, Abort), if another instance of a given script is started, that's already running
260 - always Terminate All(!) Instances, if you try to run another instance of a script, that's already running. When no instance is running, it simply starts the script.
516 - always start a New Instance of the script, that's already running
actiontable[index]["consolidate"] - the consolidate-state of custom actions; 1 consolidate undo points, 2 show in Actions-Menu, 3 consolidate undo points AND show in Actions Menu; -1, if not available
actiontable[index]["actiontype"] - the type of the action; "native action", "extension action", "custom action", "script"

returns -1 in case of an error.

Returnvalues:
 integer number_of_actions the number of actions found; -1 in case of an error 
 table actiontable a table, which holds all attributes of an action(see description for more details) 

Parameters:
 integer sections the section, whose actions you want to retrieve
0, Main=0
1, invisible actions(shown but not runnable actions)
100, Main (alt recording)
32060, MIDI Editor=32060
32061, MIDI Event List Editor
32062, MIDI Inline Editor
32063, Media Explorer=32063 


^ Reaper version 5.965Lua version 5.3 IsWithinTimeRange

Functioncall:

boolean retval = ultraschall.IsWithinTimeRange(number time, number start, number stop)

Description:
returns if time is between(including) start and stop.

returns false in case of an error

Returnvalues:
 boolean retval true, time is between start and stop; false, it isn't 

Parameters:
 number time the time in seconds, to check for 
 number start the starttime in seconds, within to check for 
 number stop the endtime in seconds, within to check for 


^ Reaper version 5.965Julian Sader's plugin version 0.963Lua version 5.3 MediaExplorer_OnCommand

Functioncall:

boolean retval = ultraschall.MediaExplorer_OnCommand(integer actioncommandid)

Description:
runs a Media Explorer-associated action.
Note: Can only run Reaper's native actions currently(all actions having a number as actioncommandid), not scripts!

returns false if Media Explorer is closed

Returnvalues:
 boolean retval true, could update run the action in the Media Explorer; false, couldn't run it 



^ Reaper version 5.965Julian Sader's plugin version 0.963Lua version 5.3 UpdateMediaExplorer

Functioncall:

boolean retval = ultraschall.UpdateMediaExplorer()

Description:
updates the listview of the Media Explorer.

returns false if Media Explorer is closed

Returnvalues:
 boolean retval true, could update the listview of the Media Explorer; false, couldn't update the listview 



^ Reaper version 5.975Lua version 5.3 FindPatternsInString

Functioncall:

integer count_found_items, array found_items = ultraschall.FindPatternsInString(string SourceString, string pattern, boolean sort_after_finding)

Description:
Finds all occurrences of matching-patterns in a string. You can sort them optionally.

returns -1 in case of an error

Returnvalues:
 integer count_found_items the number of found items in the string; -1, in case of an error 
 array found_items all occurrences found in the string as an array 

Parameters:
 string SourceString the source-string to search for all occurences 
 string pattern the matching-pattern, with which to search for in the string 
 boolean sort_after_finding true, sorts the entries; false, doesn't sort the entries 


^ Reaper version 5.965Lua version 5.3 RunLuaSourceCode

Functioncall:

boolean retval = ultraschall.RunLuaSourceCode(string code)

Description:
runs the Lua-code stored in the parameter code

Does not check for validity and syntaxerrors in the code!

You can also add new callable functions that way. Just put function-declarations in the parameter code.

For instance from the following code:

code=function main()
reaper.MB("I'm only run, when my parent function main is called", "", 0)
end

reaper.MB("I'm run immediately", "", 0)"

when called by

ultraschall.RunLuaSourceCode(code)

only the line reaper.MB("I'm run immediately", "", 0) will be run immediately.
If you want to run the function main as well, you need to explicitly call it with main()

returns false in case of an error; nil, in case of an syntax/lua-error in the code itself

Returnvalues:
 boolean retval true, code was run successfully; false, code wasn't successfully; nil, code had an error in it, probably syntax error 

Parameters:
 string code the code, that you want to execute; you can also add new functions that way 


^ Reaper version 5.95Lua version 5.3 Main_OnCommand_LuaCode

Functioncall:

boolean retval, string script_identifier = ultraschall.Main_OnCommand_LuaCode(string Code, string ...)

Description:
Runs LuaCode as new temporary script-instance. It internally registers the code as a file temporarily as command, runs it and unregisters it again.
This is especially helpful, when you want to run a command for sure without possible command-id-number-problems.

It returns a unique script-identifier for this script, which can be used to communicate with this script-instance.
The started script gets its script-identifier using GetScriptIdentifier.
You can use this script-identifier e.g. as extstate.

Returns false in case of an error

Returnvalues:
 boolean retval true, if running it was successful; false, if not 
 string script_identifier a unique script-identifier, which can be used as extstate to communicate with the started code 

Parameters:
 string Code the Lua-code, which shall be run; will not be checked vor validity! 
 string ... parameters that shall be passed over to the script 


^ Reaper version 5.982Lua version 5.3 ReplacePatternInString

Functioncall:

string altered_string, boolean replaced = ultraschall.ReplacePatternInString(string OriginalString, string pattern, string replacestring, integer index)

Description:
Replaces the index'th occurrence of pattern in OriginalString with replacepattern.

Unlike string.gsub, this replaces only the selected pattern!

returns nil, false in case of an error

Returnvalues:
 string altered_string the altered string, where the n'th occurence of the pattern has been replaced 
 boolean replaced true, there has been a replacement; false, no replacement has happened 

Parameters:
 string OriginalString the string, from which you want to replace a specific occurence of a matching pattern 
 string pattern the pattern to look for 
 string replacestring the string, which shall replace the found pattern 
 integer index the number of found occurence of the pattern in the string, which shall be replaced 


^ Reaper version 5.975Lua version 5.3 ConvertFunction_ToBase64String

Functioncall:

string BASE64_functionstring = ultraschall.ConvertFunction_ToBase64String(function to_convert_function, boolean debug)

Description:
Converts a function into a BASE64-string.

To load a function from a BASE64-string, use ConvertFunction_FromBase64String

Returns nil in case of an error

Returnvalues:
 string BASE64_functionstring the function, stored as BASE64-string 

Parameters:
 function to_convert_function the function, that you want to convert 
 boolean debug true, store debug-information as well; false, only store function 


^ Reaper version 5.975Lua version 5.3 ConvertFunction_FromBase64String

Functioncall:

function function = ultraschall.ConvertFunction_FromBase64String(string BASE64_functionstring)

Description:
Loads a function from a BASE64-string.

To convert a function into a BASE64-string, use ConvertFunction_ToBase64String

Returns nil in case of an error

Returnvalues:
 function func the loaded function 

Parameters:
 string BASE64_functionstring the function, stored as BASE64-string 


^ Reaper version 5.975Lua version 5.3 Localize_UseFile

Functioncall:

boolean retval = ultraschall.Localize_UseFile(string filename, string section, string language)

Description:
Sets the localize-file and the section to use in the localize-file.
If file cannot be found, the function will also look into resource-path/LangPack/ as well to find it.

The file is of the format:
;comment
;another comment
[section]
original text=translated text
More Text with\nNewlines and %s - substitution=Translated Text with\nNewlines and %s - substitution
A third\=example with escaped equal\=in it = translated text with escaped\=equaltext

see specs for more information.

returns false in case of an error

Returnvalues:
 boolean retval true, translation-file has been found and set successfully; false, translation-file hasn't been found 

Parameters:
 string filename the filename with path to the translationfile; if no path is given, it will look in resource-folder/LangPack for the translation-file 
 string section the section of the translation-file, from which to read the translated strings 
 string language the language, which will be put after filename and before extension, like mylangpack_de.USLangPack;
us, usenglish
es, spanish
fr, french
de, german
jp, japanese
etc 


^ Reaper version 5.975Lua version 5.3 Localize

Functioncall:

string translated_string, boolean retval = ultraschall.Localize(string original_string, ...)

Description:
Translates the string original_string into its translated version, as stored in a translation-file.

To set a translationfile, see Localize_UseFile.

If the string contains %s, the optional parameters "..." will replace them. The order of the parameters is the order of the replacement of the %s in the string.

If no translation is available, it returns the original string. In that case, %s in the string could be replaced by optional parameters ...

This function can be used with or without ultraschall. at the beginning, for your convenience.

see specs for more information.

returns nil in case of an error

Returnvalues:
 string translated_string the translated string; will be the original_string(with optional substitution), if translation is not possible 
 boolean retval true, translation-was successful; false, translation wasn't successful 

Parameters:
 string original_string the original string, that you want to translate
optional parameters, who will be used to substitute %s in the returned string; order of the optional parameters reflects order of %s in the string 


^ Reaper version 5.975Lua version 5.3 Localize_RefreshFile

Functioncall:

boolean retval = ultraschall.Localize_RefreshFile()

Description:
Reloads the translation-file, that has been set using Localize_UseFile.

see specs for more information.


Returnvalues:
 boolean retval true, translation-file has been found and set successfully; false, translation-file hasn't been found 



^ Reaper version 5.40Lua version 5.3 AddNormalMarker

Functioncall:

integer marker_number = ultraschall.AddNormalMarker(number position, integer shown_number, string markertitle)

Description:
Adds a normal marker. Returns the index of the marker as marker_number.

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

returns -1 in case of an error

Returnvalues:
 integer marker_number the overall-marker-index, can be used for reaper's own marker-management functions 

Parameters:
 number position position in seconds. 
 integer shown_number the number, that will be shown within Reaper. Can be multiple times. Use -1 to let Reaper decide the number. 
 string markertitle the title of the marker. 


^ Reaper version 5.40Lua version 5.3 AddPodRangeRegion

Functioncall:

integer marker_number = ultraschall.AddPodRangeRegion(number startposition, number endposition)

Description:
Adds a region, which shows the time-range from the beginning to the end of the podcast.

returns -1 in case of an error

Returnvalues:
 integer marker_number the overall-marker-index, can be used for reaper's own marker-management functions 

Parameters:
 number startposition begin of the podcast in seconds 
 number endposition end of the podcast in seconds 


^ Reaper version 5.77Lua version 5.3 GetMarkerByName

Functioncall:

integer count_markers, array foundmarkers = ultraschall.GetMarkerByName(string searchname, boolean searchisrgn)

Description:
Get all markers/regions that have a certain name. This function is not case-sensitive.

returns -1 in case of an error

Returnvalues:
 integer count_markers the number of found markers/regions 
 array foundmarkers an array with all marker/region-numbers of the found markers; counts only regions or markers(depending on parameter searchisrgn) 

Parameters:
 string searchname the name to look for; must be exact; not case-sensitive 
 boolean searchisrgn true, search only within regions; false, search only within markers 


^ Reaper version 5.77Lua version 5.3 GetMarkerByName_Pattern

Functioncall:

integer count_markers, array foundmarkers = ultraschall.GetMarkerByName_Pattern(string searchname, boolean searchisrgn)

Description:
Get all markers/regions that have a certain character-sequence in their name. This function is not case-sensitive.

returns -1 in case of an error

Returnvalues:
 integer count_markers the number of found markers/regions 
 array foundmarkers an array with all marker/region-numbers of the found markers; counts only regions or markers(depending on parameter searchisrgn) 

Parameters:
 string searchname the name to look for; a character-sequence that shall be part of the name; not case-sensitive 
 boolean searchisrgn true, search only within regions; false, search only within markers 


^ Reaper version 5.77Lua version 5.3 GetMarkerAndRegionsByIndex

Functioncall:

string name, integer shown_number, integer color, number pos, optional number rgnend = ultraschall.GetMarkerAndRegionsByIndex(integer idx, boolean searchisrgn)

Description:
Returns the values of a certain marker/region. The numbering of idx is either only for the markers or for regions, depending on what you set with parameter searchisrgn.

returns nil in case of an error

Returnvalues:
 string name the name of the marker/region 
 integer markrgnindexnumber the shown number of the marker/region 
 integer color the color-value of the marker/region 
 number pos the position of the marker/region 
 optional number rgnend the end of the region 

Parameters:
 integer idx the number of the requested marker/region; counts only within either markers or regions, depending on what you've set searchisrgn to 
 boolean searchisrgn true, search only within regions; false, search only within markers 


^ Reaper version 5.77Lua version 5.3 SetMarkerByIndex

Functioncall:

boolean retval = ultraschall.SetMarkerByIndex(integer idx, boolean searchisrgn, integer shown_number, number position, position rgnend, string name, integer color, integer flags)

Description:
Sets the values of a certain marker/region. The numbering of idx is either only for the markers or for regions, depending on what you set with parameter searchisrgn.

returns false in case of an error

Returnvalues:
 boolean retval true, setting the marker/region was successful; false, setting of the marker/region was unsuccessful. 

Parameters:
 integer idx the number of the requested marker/region; counts only within either markers or regions, depending on what you've set searchisrgn to 
 boolean searchisrgn true, search only within regions; false, search only within markers 
 integer shown_number the shown-number of the region/marker; no duplicate numbers for regions allowed; nil to keep previous shown_number 
 number position the position of the marker/region in seconds; nil to keep previous position 
 position rgnend the end of the region in seconds; nil to keep previous region-end 
 string name the name of the marker/region; nil to keep the previous name 
 integer color color should be 0 to not change, or ColorToNative(r,g,b)|0x1000000; nil to keep the previous color 
 integer flags flags&1 to clear name; 0, keep it; nil to use the previous setting 


^ Reaper version 5.40Lua version 5.3 AddEditMarker

Functioncall:

integer marker_number = ultraschall.AddEditMarker(number position, integer shown_number, string edittitle)

Description:
Adds an Edit marker. Returns the index of the marker as marker_number.

returns -1 in case of an error

Returnvalues:
 integer marker_number the overall-marker-index, can be used for reaper's own marker-management functions 

Parameters:
 number position position in seconds. 
 integer shown_number the number, that will be shown within Reaper. Can be multiple times. Use -1 to let Reaper decide the number. 
 string edittitle the title of the edit-marker; will be shown as _Edit:edittitle 


^ Reaper version 5.40Lua version 5.3 CountNormalMarkers

Functioncall:

integer number_of_markers = ultraschall.CountNormalMarkers()

Description:
Counts all normal markers.
Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

Returnvalues:
 integer number_of_markers number of normal markers 



^ Reaper version 5.40Lua version 5.3 CountEditMarkers

Functioncall:

integer number_of_edit_markers = ultraschall.CountEditMarkers()

Description:
Counts all edit-markers.

Returnvalues:
 integer number_of_edit_markers number of edit markers 



^ Reaper version 5.40Lua version 5.3 GetPodRangeRegion

Functioncall:

number start_position, number end_position = ultraschall.GetPodRangeRegion()

Description:
Gets the start_position and the end_position of the PodRangeRegion.

returns -1 if no PodRangeRegion exists

Returnvalues:
 number start_position beginning of the podrangeregion, that marks the beginning of the podcast 
 number end_position end of the podrangeregion, that marks the end of the podcast 



^ Reaper version 5.40Lua version 5.3 EnumerateNormalMarkers

Functioncall:

integer retnumber, integer retidxnum, number position, string markertitle = ultraschall.EnumerateNormalMarkers(integer number)

Description:
Get the data of a normal marker.
Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

Returns -1 in case of error

Returnvalues:
 integer retnumber overallmarker/regionnumber of marker beginning with 1 for the first marker; ignore the order of first,second,etc creation of
markers but counts from position 00:00:00 to end of project. So if you created a marker at position 00:00:00 and move the first created marker to
the end of the timeline, it will be the last one, NOT the first one in the retval! For use with reaper's own marker-functions. 
 integer retidxnum indexnumber of the marker 
 number position the position of the marker 
 string markertitle the name of the marker 

Parameters:
 integer number number of the marker(normal markers only). Refer ultraschall.CountNormalMarkers for getting the number of normal markers. 


^ Reaper version 5.40Lua version 5.3 EnumerateEditMarkers

Functioncall:

integer retnumber, integer shown_number, number position, string edittitle = ultraschall.EnumerateEditMarkers(integer edit_index)

Description:
Gets the data of an edit marker.

returns -1 in case of an error

Returnvalues:
 integer retnumber overallmarker/regionnumber of marker beginning with 1 for the first marker; ignore the order of first,second,etc creation of
markers but counts from position 00:00:00 to end of project. So if you created a marker at position 00:00:00 and move the first created marker to
the end of the timeline, it will be the last one, NOT the first one in the retval! For use with reaper's own marker-functions. 
 integer shown_number indexnumber of the marker 
 number position the position of the marker 
 string dummyname the name of the marker 

Parameters:
 integer edit_index number of the edit-marker. Refer ultraschall.CountEditMarkers for getting the number of edit-markers. 


^ Reaper version 5.40Lua version 5.3 GetAllEditMarkers

Functioncall:

integer number_of_editmarkers, array editmarkersarray = ultraschall.GetAllEditMarkers()

Description:
returns the number of editmarkers and an array with each editmarker in the format:

    editmarkersarray[index][0] - position
    editmarkersarray[index][1] - name
    editmarkersarray[index][2] - idx
    

Returnvalues:
 integer number_of_editmarkers the number of editmarkers returned 
 array editmarkersarray an array with all the edit-markers of the project 



^ Reaper version 5.40Lua version 5.3 GetAllNormalMarkers

Functioncall:

index number_of_normalmarkers, array normalmarkersarray = ultraschall.GetAllNormalMarkers()

Description:
returns the number of normalmarkers and an array with each normalmarker in the format:

normalmarkersarray[index][0] - position
normalmarkersarray[index][1] - name
normalmarkersarray[index][2] - idx of the marker within all markers in project
normalmarkersarray[index][3] - the shown index number of the marker

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

Returnvalues:
 integer number_of_normalmarkers the number of normalmarkers returned 
 array normalmarkersarray an array, that holds all normal markers of the project 



^ Reaper version 5.40Lua version 5.3 GetAllMarkers

Functioncall:

integer number_of_all_markers, array allmarkersarray = ultraschall.GetAllMarkers()

Description:
To get all Markers in the project(normal, edit, chapter), regardless of their category.
Doesn't return regions!

returns the number of markers and an array with each marker in the format:

    markersarray[index][0] - position
    markersarray[index][1] - name
    markersarray[index][2] - indexnumber of the marker within all markers in the project
    markersarray[index][3] - the shown index-number
    markersarray[index][4] - the color of the marker
    

Returnvalues:
 integer number_of_allmarkers the number of markers returned 
 array allmarkersarray an array, that holds all markers(not regions!) of the project 



^ Reaper version 5.40Lua version 5.3 SetNormalMarker

Functioncall:

boolean retval = ultraschall.SetNormalMarker(integer number, number position, integer shown_number, string markertitle)

Description:
Sets values of a normal Marker(no _Chapter:, _Shownote:, etc). Returns true if successful and false if not(i.e. marker doesn't exist)

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

returns false in case of an error

Returnvalues:
 boolean retval true if successful and false if not(i.e. marker doesn't exist) 

Parameters:
 integer number the number of the normal marker 
 number position position of the marker in seconds 
 integer shown_number the number of the marker 
 string markertitle title of the marker 


^ Reaper version 5.40Lua version 5.3 SetEditMarker

Functioncall:

boolean retval = ultraschall.SetEditMarker(integer edit_index, number position, integer shown_number, string edittitle)

Description:
Sets values of an Edit Marker. Returns true if successful and false if not(i.e. marker doesn't exist)

returns false in case of an error

Returnvalues:
 boolean retval true if successful and false if not(i.e. marker doesn't exist) 

Parameters:
 integer edit_index the number of the edit marker 
 number position position of the marker in seconds 
 integer shown_number the number of the marker 
 string markertitle title of the marker 


^ Reaper version 5.40Lua version 5.3 SetPodRangeRegion

Functioncall:

integer retval = ultraschall.SetPodRangeRegion(number startposition, number endposition)

Description:
Sets "_PodRange:"-Region

returns -1 if it fails.

Returnvalues:
 integer retval number of the region, -1 if it fails 

Parameters:
 number startposition begin of the podcast in seconds 
 number endposition end of the podcast in seconds 


^ Reaper version 5.40Lua version 5.3 DeletePodRangeRegion

Functioncall:

integer retval = ultraschall.DeletePodRangeRegion()

Description:
deletes the PodRange-Region.

Returns false if unsuccessful

Returnvalues:
 boolean retval true, if deleting was successful; false, if not 



^ Reaper version 5.40Lua version 5.3 DeleteNormalMarker

Functioncall:

boolean retval = ultraschall.DeleteNormalMarker(integer number)

Description:
Deletes a Normal-Marker. Returns true if successful and false if not(i.e. marker doesn't exist) Use ultraschall.EnumerateNormalMarkers to get the correct number.

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

returns -1 in case of an error

Returnvalues:
 boolean retval true, if successful, false if not 

Parameters:
 integer number number of a normal marker 


^ Reaper version 5.40Lua version 5.3 DeleteEditMarker

Functioncall:

boolean retval = ultraschall.DeleteEditMarker(integer edit_index)

Description:
Deletes an _Edit:-Marker. Returns true if successful and false if not(i.e. marker doesn't exist) Use ultraschall.EnumerateEditMarkers to get the correct number.

Returnvalues:
 boolean retval true, if successful, false if not 

Parameters:
 integer edit_index number of an edit marker 


^ Reaper version 5.40Lua version 5.3 ExportEditMarkersToFile

Functioncall:

integer retval = ultraschall.ExportEditMarkersToFile(string filename_with_path, number PodRangeStart, number PodRangeEnd)

Description:
Export Edit-Markers (not regions!) to filename_with_path.

Each line in the exportfile contains an entry for such an edit-marker in the format:

hh:mm:ss.mss Title

Returns -1 in case of error.

Returnvalues:
 integer retval 1 in case of success, -1 if it failed 

Parameters:
 string filename_with_path the name of the export-file 
 number PodRangeStart beginning of the podcast in seconds 
 number PodRangeEnd end of the podcast in seconds 


^ Reaper version 5.40Lua version 5.3 ExportNormalMarkersToFile

Functioncall:

integer retval = ultraschall.ExportNormalMarkersToFile(string filename_with_path, number PodRangeStart, number PodRangeEnd)

Description:
Export Normal-Markers to filename_with_path. Returns -1 in case of error.

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

returns -1 in case of an error

Returnvalues:
 integer retval 1 in case of success, -1 if it failed 

Parameters:
 string filename_with_path the name of the export-file 
 number PodRangeStart beginning of the podcast in seconds 
 number PodRangeEnd end of the podcast in seconds 


^ Reaper version 5.40Lua version 5.3 ImportEditFromFile

Functioncall:

array editmarkers = ultraschall.ImportEditFromFile(string filename_with_path, PodRangestart)

Description:
Imports editentries from a file and returns an array of the imported values.

returns -1 in case of error

Returnvalues:
 array chapters array[0] is position of marker+PodRangeStart, array[1] is name of the marker 

Parameters:
 string filename_with_path markerfile to be imported 
 number PodRangeStart podcast-start-offset 


^ Reaper version 5.40Lua version 5.3 ImportMarkersFromFile

Functioncall:

array markers = ultraschall.ImportMarkersFromFile(string filename_with_path, PodrangeStart)

Description:
Imports markerentries from a file and returns an array of the imported values.

returns -1 in case of error

Returnvalues:
 array chapters array[0] is position of marker+PodRangeStart, array[1] is name of the marker 

Parameters:
 string filename_with_path markerfile to be imported 
 number PodRangeStart podcast-start-offset 


^ Reaper version 5.40Lua version 5.3 MarkerToEditMarker

Functioncall:

integer idx, integer shown_number, number position, string markertitle = ultraschall.MarkerToEditMarker(integer markerindex)

Description:
Converts a normal-marker to an edit-marker.

Normal markers are all markers, that don't include "_Shownote:" or "_Edit" in the beginning of their name, as well as markers with the color 100,255,0(planned chapter).

returns -1 in case of an error

Returnvalues:
 integer idx overallmarker/regionnumber of marker beginning with 1 for the first marker; ignore the order of first,second,etc creation of
markers but counts from position 00:00:00 to end of project. So if you created a marker at position 00:00:00 and move the first created marker to
the end of the timeline, it will be the last one, NOT the first one in the retval! For use with reaper's own marker-functions. 
 integer shown_number the shown number of the marker 
 number position the position of the marker in seconds 
 string markertitle the markertitle 

Parameters:
 integer markerindex number of the normal-marker. Refer ultraschall.CountNormalMarkers for getting the number of normal-markers. 


^ Reaper version 5.40Lua version 5.3 EditToMarker

Functioncall:

integer idx, integer shown_number, number position, string markertitle = ultraschall.EditToMarker(integer edit_index)

Description:
Converts an edit-marker to a normal marker.

returns -1 in case of an error

Returnvalues:
 integer idx overallmarker/regionnumber of marker beginning with 1 for the first marker; ignore the order of first,second,etc creation of
markers but counts from position 00:00:00 to end of project. So if you created a marker at position 00:00:00 and move the first created marker to
the end of the timeline, it will be the last one, NOT the first one in the retval! For use with reaper's own marker-functions. 
 integer shown_number the shown number of the marker 
 number position the position of the marker in seconds 
 string markertitle the markertitle 

Parameters:
 integer edit_index number of the edit-marker. Refer ultraschall.CountEditMarkers for getting the number of edit-markers. 


^ Reaper version 5.40Lua version 5.3 GetMarkerByScreenCoordinates

Functioncall:

string marker = ultraschall.GetMarkerByScreenCoordinates(integer xmouseposition, boolean retina)

Description:
returns the markers at a given absolute-x-pixel-position. It sees markers according their graphical representation in the arrange-view, not just their position! Returned string will be "Markeridx\npos\nName\nMarkeridx2\npos2\nName2\n...".
Returns only markers, no time markers or regions!

returns nil in case of an error

Returnvalues:
 string marker a string with all markernumbers, markerpositions and markertitles, separated by a newline.
Can contain numerous markers, if there are more markers in one position. 

Parameters:
 integer xmouseposition the absolute x-screen-position, like current mouse-position 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 GetMarkerByTime

Functioncall:

string markers = ultraschall.GetMarkerByTime(number position, boolean retina)

Description:
returns the markers at a given project-position in seconds.
It sees markers according their actual graphical representation in the arrange-view, not just their position.
If, for example, you pass to it the current playposition, the function will return the marker as long as the playcursor is behind the marker-graphics.

Returned string will be "Markeridx\npos\nName\nMarkeridx2\npos2\nName2\n...".
Returns only markers, no time markers or regions!

returns nil in case of an error

Returnvalues:
 string marker a string with all markernumbers, markerpositions and markertitles, separated by a newline.
Can contain numerous markers, if there are more markers in one position. 

Parameters:
 number position the time-position in seconds 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 GetRegionByScreenCoordinates

Functioncall:

string markers = ultraschall.GetRegionByScreenCoordinates(integer xmouseposition, boolean retina)

Description:
returns the regions at a given absolute-x-pixel-position. It sees regions according their graphical representation in the arrange-view, not just their position! Returned string will be "Regionidx\npos\nName\nRegionidx2\npos2\nName2\n...".
Returns only regions, no time markers or other markers!

returns nil in case of an error

Returnvalues:
 string marker a string with all regionnumbers, regionpositions and regionnames, separated by a newline.
Can contain numerous regions, if there are more regions in one position. 

Parameters:
 integer xmouseposition the absolute x-screen-position, like current mouse-position 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 GetRegionByTime

Functioncall:

string markers = ultraschall.GetRegionByTime(number position, boolean retina)

Description:
returns the regions at a given absolute-x-pixel-position. It sees regions according their graphical representation in the arrange-view, not just their position! Returned string will be "Regionidx\npos\nName\nRegionidx2\npos2\nName2\n...".
Returns only regions, no timesignature-markers or other markers!

returns nil in case of an error

Returnvalues:
 string marker a string with all regionnumbers, regionpositions and regionnames, separated by a newline.
Can contain numerous regions, if there are more regions in one position. 

Parameters:
 number position position in seconds 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 GetTimesignaturesByScreenCoordinates

Functioncall:

string markers = ultraschall.GetTimesignaturesByScreenCoordinates(integer xmouseposition, boolean retina)

Description:
returns the time-signature/tempo-marker at a given absolute-x-pixel-position. It sees time-signature/tempo-markers according their graphical representation in the arrange-view, not just their position! Returned string will be "tempomarkeridx\npos\ntempomarkeridx2\npos2\n...".
Returns only time-signature-markers, no regions or other markers!

returns nil in case of an error

Returnvalues:
 string marker a string with all markernumbers and markerpositions, separated by a newline.
Can contain numerous markers, if there are more markers in one position. 

Parameters:
 integer xmouseposition the absolute x-screen-position, like current mouse-position 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 GetTimeSignaturesByTime

Functioncall:

string markers = ultraschall.GetTimeSignaturesByTime(number position, boolean retina)

Description:
returns the time-signature/tempo-marker at a given absolute-x-pixel-position. It sees time-signature/tempo-markers according their graphical representation in the arrange-view, not just their position! Returned string will be "tempomarkeridx\npos\ntempomarkeridx2\npos2\n...".
Returns only time-signature-markers, no other markers or regions!

returns nil in case of an error

Returnvalues:
 string marker a string with all markernumbers and markerpositions, separated by a newline.
Can contain numerous markers, if there are more markers in one position. 

Parameters:
 number position position in seconds 
 boolean retina if the screen-resolution is retina or hidpi, turn this true, else false 


^ Reaper version 5.40Lua version 5.3 IsMarkerEdit

Functioncall:

boolean retval = ultraschall.IsMarkerEdit(integer markerid)

Description:
returns true, if the marker is an edit-marker, false if not. Returns nil, if markerid is invalid.
Markerid is the marker-number for all markers, as used by marker-functions from Reaper.

returns nil in case of an error

Returnvalues:
 boolean retval true, if it's an edit-marker, false if not 

Parameters:
 integer markerid the markerid of all markers in the project, beginning with 0 for the first marker 


^ Reaper version 5.40Lua version 5.3 IsMarkerNormal

Functioncall:

boolean retval = ultraschall.IsMarkerNormal(integer markerid)

Description:
returns true, if the marker is a normal-marker, false if not. Returns nil, if markerid is invalid.
Markerid is the marker-number for all markers, as used by marker-functions from Reaper.

returns nil in case of an error

Returnvalues:
 boolean retval true, if it's an normal-marker, false if not 

Parameters:
 integer markerid the markerid of all markers in the project, beginning with 0 for the first marker 


^ Reaper version 5.40Lua version 5.3 IsRegionPodrange

Functioncall:

boolean retval = ultraschall.IsRegionPodrange(integer markerid)

Description:
returns true, if the marker is a Podrange-region, false if not. Returns nil, if markerid is invalid.
Markerid is the marker-number for all markers, as used by marker-functions from Reaper.

returns nil in case of an error

Returnvalues:
 boolean retval true, if it's a PodRange-Region, false if not 

Parameters:
 integer markerid the markerid of all markers in the project, beginning with 0 for the first marker 


^ Reaper version 5.40Lua version 5.3 IsRegionEditRegion

Functioncall:</