< Back to IRCAM Forum

Interfacing with NA Pro

Hello and merry Christmas,

I’m trying to make antescofo~ work with NoteAbility Pro.
It seems the default port has changed to 6789 so I’ve created a Max message with ‘ascograph 127.0.0.1 3002 5678’ and feed it as input to antescofo~.
Now it sends the OSC messages to the correct port (I used Wireshark).

In NoteAbility Pro, in Network, I have port 3002 enabled, UDP (udpsend) selected and OSC (typed) selected.
In Antescofo editor (in Tools->Score Following) I have tried “Raw Data” and “All Events Info”. In the Extract From area, “All staves” is ticked.
I tried several combinations of the above but nothing seems to work.

I found these old instructions but I think they’re outdated (I tried): http://cric.music.mcgill.ca/node/160

In the recent Antescofo Language Reference Document provided with the 0.52 release, the NoteAbility Pro section hasn’t been written yet.

Help?

This article, in response to @gorlist, describes how Antescofo can dynamically communicate with any third-party software (NAPro, SuperCollider, CSound, etc.) given that the host application accepts OpenSoundControl messages.

Pending Problem for NAPro: NoteAbilityPro’s Network Panel (v2.509) does not seem to accept OSC for Incoming Data (only TCP and UDP are allowed)? @kahamel ?

Solution:

We removed the NoteAbility help patcher since it was dependent on a third-party (outdated) object. Now is the time to resolve this elegently:

In the 0.5+ versions of Antescofo, OSC messages can be embedded inside Antescofo scores. This is a much safer way of sending OSC messages to any third-party software (such as NoteAbility Pro, SuperCollider, CSound, etc.). This is also how Antescofo communicates internally with AscoGraph. You can read about this on the Antescofo Reference Guide, Section 6.4 / Page 34.

It simply comes down to adding the following code to the beginning of your score, which simply imitates the old NoteAbilityPro help patch:

oscsend NAPro “localhost” :3002 “syncf”
$index:=0
whenever ( $RT_TEMPO )
{
$index := $index + 1
NAPro $index $RT_TEMPO $BEAT_POS
}

What does this do? It first create an OSC send port on ‘localhost’, port 3002 called ‘NAPro’ with the prefix “syncf” (these are usually fixed by the third-party software, NAPro network panel in this case). Then, whenever the tempo changes (on each new event), it sends the noted (internal) variables to “NAPro”. To know more about Variables, refer to the Antescofo Reference Guide, Section 5.2 / Page 25.

Arshia, thanks for your reply.

What about NAPro’s side? What needs to be done (which combinations of options/checkboxes) in order to make it communicate with Antescofo?

If I understood correctly, NAPro is broken at the moment and it can’t communicate with Antescofo. We would have to wait for the developer to fix it. Is that correct?

I added the snippet at the very beginning of the score and it didn’t work. I also tried putting it under BPM (also didn’t work). What am I doing wrong?

I can receive messages sent to port 6789 though (this is done by default). Those have a ‘#bundle’ prefix. I get rnow, tempo, pitch, event_beatpos.

Gorlist… My previous posts gave a score prefix that makes it work on the Antescofo side. However, after some tests I suspect that there’s something missing on the NAPro side! I asked @kahamel (NAPro developper) to have a look at this.

It’s strange that the 6789 port works in NAPro!!! That’s what’s used for communication with AscoGraph (double-click on object and see for yourself). But the messaging system is different. So maybe another source of problem is how the message is constructed to be received by NAPro. If this is the case, then we’d just need to change the code snippet (given in previous reply) to match the correct pattern… Waiting for Keith Hamel on this.

Arshia, my last post was referring to Antescofo’s side.

(Just to make sure, this post is also about Antescofo, not NA Pro.)

I added your snippet to my score which should send OSC messages to port 3002.
I tried listening to port 3002 (with Wireshark and a custom OSC receiver script), nothing comes in. Meaning that your snippet doesn’t seem to be working (except if I’m doing something wrong).
When I listen to port 6789 though, I receive OSC messages (these must be the default messages used for communication with Ascograph as you said).

So the problem now is:
a. I can’t change the port
b. I can’t have my own custom message formatting

Sorry!!! I just found a stupid mistake on my part… The code snippet should be the following ("$beat_pos instead of $beatpos):

oscsend NAPro “localhost” : 3002 “syncf”
$index:=0

whenever ( $RT_TEMPO )
{
$index := $index + 1
NAPro $index $RT_TEMPO $BEAT_POS
print sending to napro $index $RT_TEMPO $BEAT_POS
}

In the older one (which I will fix in the post) the whenever would never be launched since $beatpos was considered a new variable and hence never launched!

I am downloading Wireshark to see whether there’s network activity… could you let us know if atleast on that side things are working??

ps: This means that the Reference Guide had the “beatpos” keyword wrong as well… will update ASAP!

Ok now it sends out the OSC messages, thanks Arshia!

There are still some issues though.
a. In line 2 of your snippet, ‘$index:=0’ should be ‘let $index:=0’. Found this by debugging.
b. The floating point number of $RT_TEMPO is truncated. The type is ‘f’ but the value is always truncated. The $BEAT_POS is also a float but doesn’t appear truncated.
c. $RT_TEMPO doesn’t appear to be in sync (in the OSC messages). It has a small delay if you compare the number in the Max user interface vs the output of the OSC messages. This is strange because $index and $BEAT_POS appear to be in sync.
d. I think that $RT_TEMPO and $BEAT_POS are being sent out as a string (f tag doesn’t match those), whereas $index is sent out as integer (i tag matches this). Can you please check?

The following are not problems but questions.

  1. Can I use oscrecv to command Antescofo with OSC messages through another program? Can you provide snippets that start/stop/play Antescofo for example? I looked at the reference guide but it’s not very clear. Every Max message can be received as an OSC message?
  2. How can I also send the Measure number (Event Label in the Max UI)?

Regarding the sync problem: You are right! just change the “whenever ($beat_pos)” to “whenever ( $RT_TEMPO )”. The order of variable update is the same as the Max object (from right outlet to left). Declaring whenever on $RT_TEMPO instead of $beat_pos will resolve this problem.

Sending Measure Number: In Antescofo we don’t have measure numbers per se but LABELs which are more general. We have not declared this as an internal variable but we will… (thanks for the suggestion).

I leave my colleagues to respond on the typing issues in OSC messages (float to string etc.).

Hello Gorlist.

Yes, in the current forum version (0.55-18) the variable $RT_TEMPO is truncated to the nearest integer. This unintended behavior has already been corrected and you will have access to a full floating point tempo in the next version.

You mention that the assigment must be written
let $index:=0
instead of
$index:=0

In fact, the two syntax are accepted. The let keyword is mandatory only when assigning the element of an array, as in

    $tab := tab [1, 2, 3]
$index := 2
let $tab[$index] := 0

I confirm that the code snippet given in this thread, once put in the beginning of any score, will automatically initiate NoteAbility Pro communication, and if the NETWORK SETUP on NoteAbility is set as in the following snapshot: http://cl.ly/1U1f28033W2T

If not, upgrade to the latest version of NoteAbility.

Many thanks to Keith Hamel @kahamel for his reactivity.