Learning to use multiple instances (in my case to use separate instance as an audio player) and watched the video linked in my general questions thread. I’m running to an issue where I need to recreate the script Thaddaus used in the video (44:47 mark or so) but am encountering syntax errors (taking me back to 1982 and my Pascal class with that one). I attempted to just match all his port numbers and used the same OSC Target List info: GP Bass, 9000’s ports, etc. But I keep getting unrecognized/unexpected character errors and that might be due to my inability to read the screen shot I have created from the video correctly. For example, at the resolution in the video both ( and [ look indistinguishable. Does someone have the exact text of the script so I could cut/paste it?
I’m sure once I become more comfortable with GP and OSC script, the answers may become clear; but for now, I need help.
Here you go. The “uncovered songs” gig doesn’t have wiring to audio player yet, I am just trying to get the switching of songs to work first. So it’s a bit barren and that is intended at this moment.
“test instance” is the master, Songs is just the alternate instance I want to run audio files on.
As far as OSC Options: I have master instance set with Remote Client Port at 9000, Listening port at 9001. OSC enabled and Direct Addressable engaged. On the song gig I have remote at 9001 and listening. Same with osc enable and direct address. I did create a Target list on main gig with GP Bass with 127.0.0.1 as address, and 9000 as port. I did this just so the script Thaddaus referenced would “theoretically” work without modification.
I’ll attempt to cut/paste the script coding I used and the error I receive on compile.
On Song (old:integer, new:integer)
CurrentSong = GetCurrentSongName ()
OSC_SetAddress(MOSC,/GigPerformer/SwitchToSong)
OSC_ClearArgs(MOSC)
OSC_AppendStringArg(MOSC, CurrentSong)
OSC_SendSpecific(MOSC, OSC_GetIPAddressFromTargetName(“GP Bass”)
OSC_GetPortNumberFromTargetName(“GP Bass”))
End
The error is:
Gig (GigScript) - - Syntax Error in “Main”: Line 6, Col 4: Unexpected or unrecognized token: ‘OSC_SetAddress’
Mismatched input ‘OSC_SetAddress’ expecting End
Not going to try and fix everything but this line should probably be
OSC_SetAddress(OSC, "/GigPerformer/SwitchToSong")
I don’t know why you have MOSC instead of OSC, given that you declared the object with the name OSC — and the other argument needs double-quotes around it
Yeah, I think I removed the quotes in an effort to fix the compile error. Here is the screenprint from the youtube video that I was using to attempt to replicate what he was doing:
I have basically zero experience with osc, so my hope was to find the script written that I could just cut/paste. But what this screen shows seems to not want to compile.
Well now I’m confused as I just pasted what edm11 offered above and since David seemed to question the use of MOSC earlier, I thought maybe it was extraneous. I’ll fix that when I get back from tonight’s gig. Thanks everyone for the help. Not trying to be a dim bulb, but I’m swimming in new waters here. Give me a month and I MIGHT have a clue.
Sigh — I questioned the use of MOSC earlier because in your earlier post you declared that variable as just OSC
In your more recent example, you have the variable declared as MOSC which is why I made that comment.
I would encourage you to take a look at the language documentation and build some simple script programs to become familiar with how this language works. For example, you cannot refer to a variable that you have not previously declared.
I’m sorry this is a sigh worthy post on my part. I have attempted to read the GP scripting documentation but I have to admit, given my complete lack of background, it’s all greek to me. Please understand how I got here: I asked in the general forum how I could solve an audio file player issue and someone said to try a different instance. Then I asked how to make those changes to songs across those instances and was given a link to a video and told “it’ll show you in there”. That video referenced a “simple” script but there was no copy of said script available, just a fuzzy screenshot. So I attempted to recreate the script from said screenshot. When I got errors, and after about half an hour of trying to decipher my errors, I came here. On this very thread, I have had several comments to fix it by changing MOSC to OSC and vice versa. After reading list of functions I am more confused then ever. I cannot even find mention of MOSC in the documentation at all. I have no idea how that differs from OSC. Again, I was attempting to recreate this script from a screenshot off of a youtube video.
It might just be a situation where if one doesn’t have some background in computer programming, GP scripting/OSC Scripting may just not be in the cards for the average user. I guess I was just hopeful there might be one written already for this.
Is it possible for one you veterans to maybe just identify where my script differs from the one that was working on the youtube video? It must be obvious to those of you that know what you are doing. I’m just lost and trying to find my way to playing tracks along with songs where I switch rackspaces mid-song.
var CurrentSong : String
MOSC : OSCMessage
// Called when you switch to another song
On Song(oldSongIndex : integer, newSongIndex : integer)
CurrentSong = GetCurrentSongName()
OSC_SetAddress(MOSC, "/GigPerformer/SwitchToSong")
OSC_ClearArgs(MOSC)
OSC_AppendStringArg(MOSC, CurrentSong)
OSC_SendSpecific(MOSC, OSC_GetIPAddressFromTargetName("GP Bass"),
OSC_GetPortNumberFromTargetName("GP Bass"))
End
Yes, that is my goal. 2 instances with exactly the same songlists and just have changes to the master reflect on the slave (is that the term here?) The script I posted seemed to work in the video for Thaddaus. I think it was obviously complicated by his use of Target lists and maybe it would be simpler to eliminate those? I am flexible and will work it any way you suggest.