< Back to IRCAM Forum

Multiple event labels

The section Event Label in http://antescofo-doc.ircam.fr/UserGuide/events states that there can be several labels but it seems that this is not exactly so as Antescofo tolerates multiple labels but honours only the first one, at least when given in the way illustrated by this example:

NOTE C4 1 "cue X" "m 999"

The label “m 999” is ignored. Is the syntax in this example wrong?

Max/Pd wise what you are saying is correct! The example is wrong. @giavitto?

Hello Kyle.

You can have several labels for a musical event and they appear when you print the score (printfwd message). The idea was to use additional labels as a kind of comment or free annotation.

When you say that Antescofo honours only the first one, what kind of operation do you have in mind? Do you want to be able to startfrom or jumpto such label? In the current versions, only the first label is a valid target for a transport function. We can change that if it is useful.

Thank you, JLG, for the clarification. My idea was to use additional labels to send information about the current measure and additional cues to the patch so it can be displayed for the performer. It would be convenient to use labels for information like that – because cues (i.e. rehearsal marks), the most important use for event labels, are in the same category of information. But print messages or a dedicated receiver in the patcher may as well be used for something like that. It would be helpful, of course, to indicate in the documentation that only the first event label is regarded as event cue and will be sent as score label to the Max patcher.

I suggest to use a dedicated receiver because I don’t any natural way to send several labels in the outlet (we can output one sequence of labels or several times one label). And then you have to dispatch the outputted value. It is simpler to approach the problem using dedicated messages.

If you don’t want to “pollute” the score, you can group these annotations in a dictionary and use a whenever at the beginning of the score:

// Prelude 

 $Annotations := MAP {
     "cue X" -> ["m 999"],
     Event2 -> [Start2],
  }

whenever ($LAST_EVENT_LABEL)
{
       if ($Annotations.is_defined($LAST_EVENT_LABEL))
       { print "==> " ($Annotations($LAST_EVENT_LABEL)) }
}
  
// Score 

NOTE C4 1 "cue X" "m 999"w
   ; ...


NOTE C2 1 Event2 Start2
  ; ...

You replace the body of the if in the whenever by the handling of the annotation you get by querying the $Annotations dictionary.
This approach has the advantage to leave the score simple and to group the annotation in one place.

For the documentation: you are right and we will complete it.

This is a very good idea that I will adopt. Thank you very much, JLG.

Those “label” are actually legacy and date back to when we were triggering actions using Max/Pd Queue Lists (when we didn’t have a real language! much like the current scofo object in Pd by Miller Puckette). Now you know where our name comes from! :wink:

We left it there because they appeared to be useful to, for example, distinguish parts by observing their string value (think: measure numbers, or wanting to jump to a specific section etc).

I wouldn’t use them for triggering! Use the powerful Antescofo language for that (I’m not bragging here… it’s all @giavitto there). :slight_smile:

@arshiacont: Yes, Antescofo is a powerful language and I love it. I didn’t intend to use event labels for triggering time-critical actions, just to send some information giving the performer some feedback about the current position which is semantically richer than technical start cues (which are nevertheless useful as rehearsal marks).

Another idea I’m dreaming of: Send page turn commands to a PDF viewer displaying the performer’s score, and eventually even position commands for a cursor.

You can actually do both ideas today using the language! :slight_smile:

For rich messages to your musician, just send a message and show it however (and wherever) you want.

For Page Turning, some PDF readers get UDP/OSC messages. There’s an OSC server embedded in Antescofo that you can actually use to route to another received (outside Max). That’s how AscoGraph used to work in older days. We actually did the PDF Page Turning once in a concert long ago. :slight_smile:

Good luck.

As an alternative solution, you can use AppleScript and a PDF reader that accept ActionScript command. This is the case for Skim. The commands accepted by Skim are described here: https://sourceforge.net/p/skim-app/wiki/AppleScript/.

Create a script using “Script Editor.app” with the following lines and save it in your ‘Downloads’ directory under the name ‘gotoskim.scpt’ :

on run argv
	set pageNum to (item 1 of argv) as integer
	tell application "Skim"
		set view settings of document 1 to {display mode:single page}
		tell document 1 to go to page pageNum
	end tell
end run

Then if you have an Antescofo score as below:

$scorefile := "/Users/USER/Downloads/score.pdf"
$script := "/Users/USER/Downloads/gotoskim.scpt"
  
_ := @system("open -a skim " + $scorefile)

  
NOTE C4 5
  _ := @system("osascript " + $script + " " + 10)

NOTE C2 5
  _ := @system("osascript " + $script + " " + 20)

NOTE D4 5
  _ := @system("osascript " + $script + " " + 30)
  print end

assuming that you replace USER by your actual user name in the score, then the execution will open the ‘score.pdf’ file and changes the page in the Skim viewer as the events occur.

The function @system() executes a shell command:

  • The first one before the first musical event launch skim (and assume that the Skim.app is installed on your computer).

  • The following commands launches the Apple Script that interacts with Skim to change the current page. The page to set is specified by the number in the @system() argument.The expression simply built the string to pass to the function @system (the + operators concatenates strings and convert its subsequent arguments into string if needed).

For additional commands , take a look at the Skim wiki.

Obviously, this is done on the same machine, but it is possible to launch remotely an Apple Script. There is an example here but it exceeds by far my knowledge of AppleScript and Remote Desktop.

Thank you both, @arshiacont and @giavitto, for the pointers and the code snippets regarding PDF viewers and page turning messages! What I forgot to mention is that I’m looking for a PDF viewer on a tablet system – a laptop is somewhat clumsy on a music stand – but so far didn’t find one which supports OSC or raw UDP. And automation on Apple’s iPad is only rudimentary. So maybe I should focus on how to make a laptop screen comfortably and safely visible for a musician.