%YAML 1.2 --- # See http://www.sublimetext.com/docs/3/syntax.html name: GP Script file_extensions: - gpscript scope: source.example-gpscript contexts: # The prototype context is prepended to all contexts but those setting # meta_include_prototype: false. prototype: - include: comments main: # The main context is the initial starting point of our syntax. # Include other contexts from here (or specify them directly). - include: callbacks - include: types - include: functions - include: keywords - include: numbers - include: strings - include: booleans callbacks: - match: (?i:\b(Function|Initialization|Var|On|End|Activate|Deactivate|Variation|NoteOnEvent|NoteOffEvent|NoteEvent|ControlChangeEvent|PitchBendEvent|AftertouchEvent|PolytouchEvent|ProgramChangeEvent|MidiEvent|SysexEvent|WidgetValueChanged|ParameterValueChanged|TimePassing|OSCMessageReceived|BeatChanged|SystemEvent|Matching|PlayheadStateChanged|GlobalTransposeChanged|GigLoaded|Rackspace|Song|Songpart|Keystroke|KeystrokePattern|From)\b) scope: punctuation.definition.annotation types: - match: (?i:\b(boolean|double|integer|int|adsr|AfterTouchMessage|AutoSustainer|Block|ChordRecognizer|Continuous|ControlChangeMessage|CurveComponent|Discrete|ExternalApplication|ExternalWidget|Generator|MidiInBlock|MidiInDeviceAlias|MidiMessage|MidiOutBlock|MidiSequence|MultiChannelNoteTracker|NoteMapper|NoteMessage|NoteTracker|OSCMessage|Parameter|PitchBendMessage|PolyTouchMessage|ProgramChangeMessage|String|Subrange|SysexManager|SysexMessage|ThresholdDetector|Widget|PluginBlock|Array|Ramp)\b) scope: storage.type functions: - match: (?i:\b(Returns|AbletonLink_Enable|AbletonLink_Enabled|CloseAllPluginWindows|DuplicatePluginUnderMouse|InPanelView|InSetlistView|InTunerView|InWiringView|Next|Previous|QuickReplacePluginUnderMouse|RemovePluginUnderMouse|SwitchToPanelView|SwitchToSetlistView|SwitchToWiringView|ToggleTunerVisible|AppendBoolean|AppendDouble|AppendInteger|AppendString|ClearArray|IndexOf|LargestDouble|LargestInt|RemoveLast|Reverse|Size|SmallestDouble|SmallestInt|Sort|iMax|iMin|EA_AddArgument|EA_ClearAllArgs|EA_SetProgramName|EA_Start|EA_Stop|EnableGenerator|GetADSRAttackLevel|GetADSRAttackTime|GetADSRDecayTime|GetADSRReleaseTime|GetADSRSustainLevel|GetGeneraterAmplitude|GetGeneratorAmplitude|GetTimersRunning|InitADSR|IsGeneratorEnabled|SetADSRAttackLevel|SetADSRAttackTime|SetADSRDecayTime|SetADSRReleaseTime|SetADSRSustainLevel|SetGeneratorCoarseness|SetGeneratorFrequency|SetGeneratorLength|SetGeneratorOneShot|SetTimersRunning|StartAttackPhase|StartReleasePhase|AllNotesOff|AllNotesOff|BetweenNotes|GetAfterTouchValue|GetByte|GetCCNumber|GetCCValue|GetChannel|GetMidiInDeviceCount|GetMidiInDeviceFromRigManager|GetMidiInDeviceName|GetMidiMessageSize|GetMidiOutDeviceCount|GetMidiOutDeviceName|GetNoteNumber|GetPitchBendValue|GetPolyTouchNoteNumber|GetProgramChangeNumber|GetReleaseVelocity|GetVelocity|InjectMidiEvent|InjectMidiEventViaRigManager|IsAfterTouch|IsController|IsNote|IsNoteOff|IsNoteOn|IsPitchBend|IsPolyTouch|IsProgramChange|MakeAfterTouchMessage|MakeAfterTouchMessageEx|MakeControlChangeMessage|MakeControlChangeMessageEx|MakeMidiMessage|MakeMidiMessage1|MakeMidiMessage2|MakeMidiMessage3|MakeNoteMessage|MakeNoteMessageEx|MakePitchBendMessage|MakePitchBendMessageEx|MakePolyTouchMessage|MakePolyTouchMessageEx|MakeProgramChangeMessage|MakeProgramChangeMessageEx|MidiInDeviceExists|MidiOutDeviceExists|ReinterpretAsAfterTouch|ReinterpretAsControllerMessage|ReinterpretAsNoteOffMessage|ReinterpretAsNoteOnMessage|ReinterpretAsPitchBend|ReinterpretAsPolyTouchMessage|ReinterpretAsProgramChange|SendNow|SendNowToMidiOutDevice|Transpose|WithCCNumber|WithCCValue|WithChannel|WithNoteNumber|WithNoteNumberAndVelocity|WithTranspose|WithVelocity|ACos|ASin|ATan|Abs|CC_LoadFromFile|CC_SaveToFile|CC_Scale|Ceiling|Cos|Exp|Floor|IntToFloat|Ln|Log|MidiToParam|MidiToParamEx|ParamToMidi|ParamToMidiEx|Power|Random|RandomRange|Round|Scale|ScaleInt|ScaleRange|ScaleRangeEx|Sign|Sin|Sqrt|Tan|ThresholdDetector_Detect|ThresholdDetector_Setup|MultiChannelNoteTracker_Clear|MultiChannelNoteTracker_GetHeldNotes|MultiChannelNoteTracker_GetSpecificNoteOnCount|MultiChannelNoteTracker_GotNote|MultiChannelNoteTracker_GotNoteOff|MultiChannelNoteTracker_GotNoteOn|MultiChannelNoteTracker_IsNoteOffPending|MultiChannelNoteTracker_NoteOnCount|MultiChannelNoteTracker_StopAllPendingNotes|MultiChannelNoteTracker_StopAllPendingNotes|AddChordInterval|AutoSustainer_GetHeldNotes|AutoSustainer_Play|AutoSustainer_RespectParameters|AutoSustainer_SetTarget|AutoSustainer_Stop|FindChordName|NoteMapper_CreateScale|NoteMapper_GetMappedNotes|NoteMapper_MapNote|NoteMapper_MapNoteToChord|NoteMapper_MapNotes|NoteMapper_Reset|RemoveChordInterval|ClearNoteTracker|GotNote|GotNoteOff|GotNoteOn|NoteOnCount|NoteTracker_Clear|NoteTracker_GetHeldNotes|NoteTracker_GetSpecificNoteOnCount|NoteTracker_GotNote|NoteTracker_GotNoteOff|NoteTracker_GotNoteOn|NoteTracker_IsNoteOffPending|NoteTracker_NoteOnCount|NoteTracker_StopAllPendingNotes|NoteTracker_StopAllPendingNotes|StopAllPendingNotes|StopAllPendingNotes|OSC_AppendDoubleArg|OSC_AppendIntArg|OSC_AppendStringArg|OSC_ArgCount|OSC_ClearArgs|OSC_Enabled|OSC_GetArgAsDouble|OSC_GetArgAsInteger|OSC_GetArgAsString|OSC_GetGPListeningPort|OSC_Send|OSC_SendDouble|OSC_SendDoubleSpecific|OSC_SendInteger|OSC_SendIntegerSpecific|OSC_SendSpecific|OSC_SendString|OSC_SendStringSpecific|OSC_SetAddress|ClosePlugin|GUI_CreateNewWidget|GetActivePreset|GetGPPresetList|GetGPPresetListCount|GetMaxNoteFromMidiInBlock|GetMinNoteFromMidiInBlock|GetParameter|GetParameterCount|GetParameterName|GetParameterText|GetPluginCaption|GetPluginInfo|GetPresetCount|GetPresetName|GetTransposeFromMidiInBlock|GetVelocityCurveValue|IsPluginBypassed|LoadGPPreset|OpenPlugin|ReplacePlugin|SelectPreset|SetParameter|SetPluginBypassed|SetPluginCaption|SetPluginEditorXYPosition|GetCurrentRackspaceIndex|GetCurrentVariation|GetRackspaceBPM|GetRackspaceCount|GetRackspaceIndex|GetRackspaceName|GetRackspaceNameAtIndex|GetVariationCount|GetVariationCountForRackspaceAtIndex|GetVariationName|GetVariationNameForRackspaceAtIndex|NextRackspace|NextVariation|PreviousRackspace|PreviousVariation|SetVariation|SwitchToNextRack|SwitchToNextVariation|SwitchToPreset|SwitchToPrevRack|SwitchToPrevVariation|SwitchToRack|SwitchToRackspace|SwitchToRackspaceByName|UpdateRackspaceBPM|GetContinuousPreviousValue|GetDiscreteParameterItem|GetDiscreteParameterItemCount|GetDiscretePreviousValue|GetIndexOfDiscreteParameterItem|GetIndexOfSubrangeParameterItem|GetParameterCount|GetParameterName|GetSubrangeParameterItem|GetSubrangeParameterItemCount|GetSubrangePreviousValue|PlayNote|PlayNotes|SendLater|SendNotesNow|SendNow|SendSysexNow|SetDisplayMessage|SetInfoMessage|MidiSequence_CollectEventsNow|MidiSequence_EndOfSong|MidiSequence_FollowGlobalTranspose|MidiSequence_GetCurrentBar|MidiSequence_GetCurrentBeat|MidiSequence_GetCurrentEvents|MidiSequence_GetCurrentTick|MidiSequence_GetResolution|MidiSequence_GetTrackCount|MidiSequence_LoadMidiFile|MidiSequence_MapOutputChannel|MidiSequence_Quantize|MidiSequence_ResetToStart|GetCurrentSetlistName|GetCurrentSongIndex|GetCurrentSongName|GetCurrentSongPart|GetCurrentSongPartName|GetSongArtistName|GetSongBPM|GetSongCount|GetSongIndex|GetSongKeySignature|GetSongName|GetSongPartCount|GetSongPartName|GetSongTimeSigDenominator|GetSongTimeSigNumerator|GetSongTranspose|InSetlistMode|NextSong|PrevSong|SetSongPart|SongMoveDown|SongMoveUp|SongNextPart|SongPrevPart|SwitchToSongByIndex|BoolToString|CopySubstring|DoubleToString|FileExists|GigPerformerDocumentsFolder|IndexOfSubstring|IntTo7BitHexString|IntToHex|IntToHexString|IntToString|Length|LoadStringFromTextFile|MapValueToDiscreteString|NoteNameToNoteNumber|NoteNumberToNoteName|ParseCSVString|ReplaceString|ReplaceStringSection|SaveStringToTextFile|StringAfterFirstOccurence|StringAfterFirstOccurrence|StringAfterLastOccurence|StringAfterLastOccurrence|StringToBool|StringToDouble|StringToHex|StringToHexString|StringToInt|StringUpToFirstOccurence|StringUpToFirstOccurrence|StringUpToLastOccurence|StringUpToLastOccurrence|ToLowercase|ToUppercase|TrimString|SM_ChangeValue|SM_CreateSysex|SM_CreateSysexFromString|SM_GetByte|SM_GetValue|SM_GetValues|SM_Length|SM_Pretty|SM_SendMidiIn|SM_SendMidiOut|SM_SendMidiOutNow|SendSysexExternal|SendSysexInternal|SendSysexInternalLater|SendSysexInternalNow|SendSysexNowToMidiOutDevice|AltKeyDown|ClearLogWindow|ClockTime|CloseLogWindow|CloseScriptWindow|EnableMetronome|EnablePlayhead|FormatTime|GetBPM|GetGlobalTranspose|GetMetronomeVolume|GetTimeSigDenominator|GetTimeSigNumerator|IsMetronomeEnabled|IsPlayheadEnabled|ModifierKeys|Notify|OpenLogWindow|OpenScriptWindow|Panic|PlayNote|PlayNotes|Print|RecordInputs|ScheduleMidiEvent|SendLater|SendNoteMessageWithTranspositionsLater|SendNoteMessageWithTranspositionsNow|SendNoteMessagesLater|SendNoteMessagesNow|SendNowExternal|SendNowRespectingParameters|SetBPM|SetGlobalTranspose|SetMetronomeVolume|SetTimeSignatureDenominator|SetTimeSignatureNumerator|SetWindowTitle|Shell|ShellEx|ShiftKeyDown|ShowChordProWindow|SwitchToProgramNumber|Tap|TimeNow|TimeSinceStartup|BindExternalWidget|BindWidget|GetExternalWidgetValue|GetWidgetBounds|GetWidgetCurveValue|GetWidgetLabel|GetWidgetPreviousValue|GetWidgetResetValue|GetWidgetScriptName|GetWidgetValue|RedrawWidgetCurve|ResetWidgetValue|ResyncWidget|SetExternalWidgetValue|SetExternalWidgetValueEx|SetWidgetBounds|SetWidgetCurveValue|SetWidgetLabel|SetWidgetResetValue|SetWidgetValue|SetWidgetValueEx|GPWindowToBack|GPWindowToFront|GPWindowVisible|GetGPWindowKioskMode|GetGPWindowState|GetGPWindowVisible|MinimizeOrRestoreGPWindow|SetGPWindowFullScreen|SetGPWindowKioskMode|SetGPWindowState)\b) scope: variable.function keywords: # Keywords are if, else for and while. # Note that blackslashes don't need to be escaped within single quoted # strings in YAML. When using single quoted strings, only single quotes # need to be escaped: this is done by using two single quotes next to each # other. - match: (?i:\b(if|else|elsif|for|do|while|then|or|and)\b) scope: punctuation.definition.annotation numbers: - match: '\b(-)?[0-9.]+\b' scope: constant.numeric.example-c strings: # Strings begin and end with quotes, and use backslashes as an escape # character. - match: '"' scope: punctuation.definition.string.begin.example-c push: inside_string inside_string: - meta_include_prototype: false - meta_scope: string.quoted.double.example-c - match: '\.' scope: constant.character.escape.example-c - match: '"' scope: punctuation.definition.string.end.example-c pop: true booleans: - match: (true|false) scope: variable.parameter comments: # Comments begin with a '//' and finish at the end of the line. - match: '//' # scope: punctuation.definition.comment.example-c scope: comment push: # This is an anonymous context push for brevity. # - meta_scope: comment.line.double-slash.example-c - meta_scope: comment - match: $\n? pop: true - match: '/\*' scope: comment push: - meta_scope: comment - match: '\*/' scope: comment pop: true - match: ^\s*(\*)(?!/) captures: 1: comment