< Back to IRCAM Forum

"Cowardly refuse to send 833 messages" error

Hello, I’m trying to convert a (relatively long) Antescofo score to Bach.roll, but this error pops up. Is there a limit to the number of notes that can be converted, and if so, can it be changed? My score is about 192 bars long, and it only converts half.

Thanks,
Arnau

Hello Arnaudb.

The constraint does not come from the score conversion, but from the number of Max messages that can be sent in a logical instant. Antescofo imposes an implicit limit of 512 messages sent simultaneously, because sometimes Max is not able to handle all these messages at once, resulting in message dropout or even a crash. The exact behavior of Max depends on the other objects in the patch, the priority of the messages, the size of Max’s queues, etc., which makes it difficult to know whether sending more messages is harmless or not.

However, there is a function that can be used to change this limit: @set_max_message_sent_instantaneously(limit)

Usually, there is no problem to increase this limit before the conversion. For safety, you can decrease it after the conversion.

Another approach is to not use the antescofo::bachscore command (or the equivalent bachscore message), but to use the @bach_score() function and to program a process to send the resulting tab items in batches of 500 with a small delay between the batches (even 1ms is enough).

1 Like

@arnaub just be aware (following @giavitto 's message) that this can lead to message drops in Max depending on how you have configured Max’s scheduler (meaning some messages will never arrive). So you might want to speed limit those messages really as Jean-Louis mentionned.

2 Likes

Thanks a lot for the comments, unfortunately the @set_max_message_sent_instantaneously(limit) message doesn’t seem to work for me (tried with up to “poll throttle 800” and “queue throttle 1000”)… Is there something I’m doing wrong? Regarding the @proc_def I’ve tried (with my noob knowledge):

@proc_def ::load($num, $delay)
          {
                 	 @bach_score($num) 
              $delay @bach_score($num+300) 
              $delay @bach_score($num+600) 
              $delay @bach_score($num+900) 
              $delay @bach_score($num+1200) 
          }

And then ::load(300, 0.1)

It loads the score, but not the whole of it…

Hello Arnaub.

The function @bachscore() does not take the measure to start as an argument. So your process send 5 times teh entire score.

If you put

_ := @set_max_message_sent_instantaneously(1000)

before calling @bachscore(), does it raises any message on the console?

Yes, this is it:

Edit: sometimes it does work (the last message “Cowardly refuse” does not appear, but the “unknown function” error is still there), it’s just not very clear why that’s the case.

Hello Arnaub.

Houps, I have made a mistake in my last answer : note that the function to call is ‘@bach_score()’ (see the man page) and not ‘@bachscore()’ (there is an underscore in the name). The erroneous call is in line 3 of your file.

For the call to ‘@set_max_message_sent_instantaneously(1000)’ (see doc), it must appear before the call to ‘@bach_score()’ and it will emit a confirmation message on the console if you increase the verbosity (before loading your score), that is:

  • Increase the verbosity of antescofo by sending a message ‘verbosity 1’ to the antescofo object (there is a button for that in the example patch).

  • Then load your score.

  • A message limit of messages sent in one cycle set to 1000 must appear on the console.

The call to ‘@bach_score’ should be ok then.

If the message does not appear, there is something wrong somewhere (send me the screenshoot of the console).

Hello Jean-Louis,

Thanks, it seems it’s still not coping. I’m using same scheduler settings, and I’ve tried @set_max_message_sent_instantaneously(1000), as well as _ := @set_max_message_sent_instantaneously(1000), followed by @bach_score().

My mistake: I am too elliptic in my explanation. Calling the function @bach_score() only build a tab with the messages to send to bach.roll. But if you have increased the max message limit, you can use the antescofo::bachscore command which sends the messages.

The header of your score should be:

@set_max_message_sent_instantaneously(1000) 
antescofo::bachscore "to_bach"

where "to_bach" should be replaced by the Max receiver used to reach bach.roll in your patch.

Hello Mr. Giavitto,

Is there a way to do @proc_def to send multiple @bach_score() functions in batches of 500? I have a very large file (7000), and would rather not risk crashing Max.

The function @bach_score() returns a tab whose values are the messages sent by antescofo::bach_score. You can split this tab in batch of 500, with a function like

@fun_def split_tab($t)
{
   @local $tt := [], $reste := $t
   loop {
      $tt.push_back($reste.take(500))
      $reste := $reste.drop(500)	    
  } while (!$reste.empty())
  return $tt
}

Then you can send these batches, says every 0.1s for instance:

$tab := @bach_score()
$ttab := @split_tab($tab)

$i := 0
loop 0.1s
{
     forall $e in $ttab[$i]  { to_bach $e }
     $i += 1
} while ($i < $ttab.size())

Hope it helps,
Jl.

1 Like

Since you are in Max, the correspondance between Antescofo andd Bach seem to use simple message passing as you’d communicate with another object. (@giavitto will correct me if it’s not the case).

In any case, there are limits to the Max scheduler that you can set in “Audio Status” in Options. For example, if things haven’t changed, putting Overdrive On will allow max to postpone messages if it can’t handled them in one cycle. Also, playing with I/O VS and Signal VS will leave more room for controls such as this one. There’s always a comprise to find here and it’s not obvious. This is Max!

Thank you so much! This works perfectly!!

For those who are as deficient in coding like myself, this is what I pasted into my asco.txt file:
"
@fun_def split_tab($t)
{
@local $tt := [], $reste := $t
loop {
$tt.push_back($reste.take(500))
$reste := $reste.drop(500)
} while (!$reste.empty())
return $tt
}
$tab := @bach_score()
$ttab := @split_tab($tab)

$i := 0
loop 0.01s
{
forall $e in $ttab[$i] { msgbsco $e }
$i += 1
} while ($i < $ttab.size())
"

  • Where the “msgbsco” is the recv in your max patch. (I admit this took me a long time to figure out)
  • Also changed it to 0.01s from 0.1s otherwise it will take you over 10 minutes to load

I hope this is not too weird of a question, but is there a way to run this process with @eval_when_load? It would be amazing if I can send the messages to Bach.roll whenever a score is loaded; currently whenever I start a score, it is unresponsive at the beginning because it is also loading the score each time. Thank you for being so quick in all of your responses @giavitto!

Thanks for the tips @arshiacont, sending the messages work well on my newer Mac - and I haven’t come across any problems yet.

Part of the reason that I really want this process to work is so that I can run this on my older Mac with the 0.92 version object with Bach, as well as make use of the more reliable MIDI listening system (0.92 recognizes @bach_score, but doesn’t recognize @set_max_message_sent_instantaneously(limit). I am eagerly awaiting version 1.1!

Hello Cow.

It will not work because the action takes times: @eval_when_load is supposed to trigger “instantaneous” evaluation (i.e., function no process, no delay, etc.).

But it is easy trigger the sending of the messages to Bach.roll on demand only, after the start of the score. You can send a max message “setvar send2bach 1” that will trigger a whenever which runs the code. Put at the begining of your score:

@fun_def split_tab($t)
{
   @local $tt := [], $reste := $t
   loop {
      $tt.push_back($reste.take(500))
      $reste := $reste.drop(500)	    
  } while (!$reste.empty())
  return $tt
}

whenever ($send2bach)
{
   @local $tab := @bach_score(), $ttab := @split_tab($tab), $i := 0
   loop 0.1s
   {
        forall $e in $ttab[$i]  { msgbsco $e }
        $i += 1
    } while ($i < $ttab.size())
}

After the start of the score, send the max message “setvar send2bach 1” to antescofo. It will trigger the whenever and run the code. If you don’t send the message, no message will be sent to Bach.roll.

1 Like