Latest GP Script documentation

Thanks to @simon, we now have a much improved manual for people interested in using GP Script.

The documentation can be found here

8 Likes

Wow, this is amazing! Good work team!

It looks good and is well-organized. Thanks for the effort in collating all the info.
Definitely need to put a lot more real-world usage examples in there, though. Terms and descriptions only go so far…

What kinds of things are you looking for? This manual is intended to be a reference document to the language and its system library. It’s not trying to be a cookbook though clearly such a thing would be very nice to have.

How about a section featuring examples that users have previously submitted on the forum?

That’s actually already in the works :wink:

2 Likes

I have a big collection, from the forum :wink:

1 Like

A minor documentation note -

On this page: File extensions used in Gig Performer

gpscript does not appear

I am A novice keyboard player. But I’ve been programming since 1975 - Fortran, C, C++, Basic, C# and others. I found this document to be very informative on syntax.

However, I didn’t really find anything helpful for getting started. In fact, I found the community mostly discouraging in that it includes many remarks to those also trying to get started that “some programming experience is required”.

I think I significantly exceed that requirement. I just needed a simple scriptlet, not a full script. The code in this document’s introduction appeared to be a good starting template. It was very discouraging to get the message that a variable type was not supported in this context with no guidance for a solution. A new scriptlet user needs to understand that, because the scriptlet is embedded in in a position where MIDI devices can be directly wired to the scriptlet, there is no need to declare a midi in block.

The next thing a new user probably need to understand is that any expectations that gpScript is object oriented should be put out of mind. You do not get the volume of a note by adding .volume to the end of the variable name. You must find a function that returns volume and requires a parameter that you can provide, such as a note object.

Obviously, this is not really a reflection on the syntax documentation. It is more a reflection on the availability of documentation that provides an understanding of the differences between scripts and scriptlets and what is required to gain a knowledge of the specific requirements of this language that might be different from what programmers in other environments might expect. Possibly some if this type information should be included in the introduction.

I hope this helps others get started. I think someone with modest programming experience can handle this language if the learning curve to get started wasn’t so fraught with roadblocks. I am sure that, now that I have gotten past the start up curve, I will find this document very useful.

Thanks for the feedback. We appreciate your taking the time to write this.

I agree that we should be clearer about the SendNow as used by scripts vs. by scriptlets and it’s worth updating the language manual on this topic for a future release.

Well, we explain what it is, not what it isn’t. For example, we note quite early that the GP Script language paradigm is “event driven”. I’m not quite sure why we are obliged to explicitly point out that GPScript is not OO since we never claim that it is. Should we also be obliged to point out that the GPScript language is not functional, declarative, data flow, constraint-based, nor any of the other possible language paradigms out there?

The basic language manual has a whole section defining the basic concepts (see image) and nowhere does it refer to objects.
screenshot_8473

You can’t do that in C++ either, for example. Indeed important OO languages such as Smalltalk or Objective-C, for example) only let you do this by using messages

"Smalltalk: Return the volume attribute of an object"
SomeObject volume

// Objective C: Return the volume attribute of an object
volume = [SomeObject getVolume] 

I think perhaps the point missed here is that “experience with programming” doesn’t just mean knowing the keywords of a language and/or what is a variable, etc. It also means that the programmer knows how to read “between the lines”, knows how to search for information that is not explicitly documented. Clearly you were able to do this yourself since you figured out that SendNow (for example) has slightly different parameters depending on whether it’s used in a script or a scriptlet.

I don’t think there exists perfect documentation for any programming language out there. If there did, there would be absolutely no need for forums, books and other guides to help users with programming. That said, documenting experiences in this community, as you did, absolutely benefits others and so it’s terrific that you mentioned these difficulties.

I hope my comments were not taken as implying that your document should solve all of the world’s problems. It’s a great document. I was just relaying my experience which is likely shadowed by the fact that I have been working exclusively in .NET for the last decade. Maybe what I needed was a quick start type guide that provided a “hello world” type example specifically targeting scriptlets.

1 Like

Not at all - I seriously appreciated what you had to say and in fact have already updated the documentation to explain that difference between SendNow for scripts vs. for Scriptlets. It was a good point.

1 Like

I’m not saying you’ve an obligation to do or do not something and indeed the documentation nowhere makes an explicit statement gpscript being oo, but there are some constructs that might be mistaken/interpreted as object oriented: <widget>.GetWidgetValue() for example. I personally interpret this just as syntactic sugar, but I can see why someone would think that maybe gpscript is object oriented. I think in the end assumptions are rather dependent on the context someone is in: if you’re doing oo programming all day, you might be tempted to expect another language is also oo.

“To someone with only a hammer, everything looks like a nail” :slightly_smiling_face:

Just my 2 cents.

Right-click on a script window — lots of template examples there already

1 Like

I’m not seeing “Examples” in my menu. But there are scriplets that can be inserted. Those should be helpful. thanks.

Are you using the correct menu, I can see it.

1 Like

The ‘Examples’ don’t exist in the Scriptlet script editor. I’m assuming that is what @_wo1f is refrerring to.

Example 50 (01)