< Back to IRCAM Forum

Antescofo detects early, but not if I delete some bars

I’m working with Antescofo and noticed that some bass notes in the piano part are detected about half a bar before they happen— the first bass note is always correct and then the follower seems to want to “jump” by about half a bar.

In debugging this I made a copy of the score and sliced off the introduction, so that I could get to the bass notes right away and try to fix it.

In the copy, though, the bass notes trigger correctly.

This is making me feel a bit crazy so I thought I’d ask here if anyone knows how I can fix this?

I’m attaching the score and mp3s so anyone can try to reproduce this.

For the record I’m on an M1 iMac.

Vincennes-not-working.asco (11.9 KB)
Vincennes-exerpt-working.asco (5.4 KB)

With a fresh brain this morning I have fixed this by increasing Signal Vector Size in Max— it’s still a mystery to me though why it would work only when I chop off the start of the piece!

No longer an emergency, but if anyone has wisdom about this I always like solving a mystery.

Hey @c-harl-ie . First of all, congrats for all that and sounds touching! :slight_smile:

First of all: Not normal that Max’s Signal Vector size changes behavior here! :face_with_raised_eyebrow: Can you share what were the values? Can you send an [info] message to Antescofo and share the console output? Something is not right here that is overriding deterministic behavior (which is what you want in any case).

I will find a copy of Max to test your scores/recordings but looking quickly here are some thoughts :

  • You activate the pedal but you also need to provide pedaltime and pedalcoeff. I suggest using 500 (in milli-seconds) and 0.3 to start with. This creates an audio buffer of 500ms and try to suppress an average of the past with a coeff of 0.3 (to emphasize new activities).
  • Your variance seem strangely low… any reason for that? Have you checked the tuning of your Piano? (one quick way to check is to use Metronaut App for iOS whose Tuner is free!:innocent:)

Thanks Arshia! Here’s info (before adding the pedal changes you suggested)

antescofo~:                      by Arshia Cont, Philippe Cuvillier, Jose Echeveste, Jean-Louis Giavitto © Antescofo™ 2016-2018
antescofo~:                      release master - 1.0-1, Compiled on Mar  5 2018 17:50:54
antescofo~:           Follower is ON
antescofo~:           Analysis Parameters: nfft=4096, hop=512 (resolution 0.0Hz)
antescofo~:           Number of Harmonics used for spectral match: 20
antescofo~:           Gamma (Energy Correction): 0.000
antescofo~:           Tuned to 0.0Hz
antescofo~:           Pedal 1, Pedal Coefficient 0.000, Pedal Time (ms) 14439403097493127228086572627788896342812099556930892048722311937856193118221372248518281681174069920931931461622825570535372435079126051790396840464266040536268570340989112267311387540993639444768045531094056960000
antescofo~:           Temposmoothness 0.000
antescofo~:           Piano mode OFF
antescofo~:           Prevent zigzag ON (forward only)
antescofo~:           Inference version is 2
antescofo~:           Occupancy model is 0.0000
antescofo~:           Decode window length is 21
antescofo~:           KL mode is left
antescofo~:           Current score: "/Volumes/Macintosh HD/Users/cw/Documents/Max 8/Projects/setlist/05-Vincennes.asco.txt" with 2564 events and 21 actions
antescofo~:           No preloaded scores.
antescofo~:           AscoGraph communication is OFF.
antescofo~:           Verbosity: 0

Weird that piano mode is OFF, no?

I had previously reduced variance because I was getting false detections, but maybe that was a similar issue to what I’m seeing here— I can comment that line out anyway.

@arshiacont Just flagging up that this happens in another section of the score, in a similar way, but I’ve not been able to find a fix. Here bar 33 takes essentially no time (⅓ sec) and jumps ahead to bar 34, then from bar 35 it stays reliably 1 bar ahead for several bars. I’ve tried various combinations of @hook and @fermata but nothing has helped.

BPM 55
	antescofo-mess tune 440.0
	antescofo-mess piano 1
	antescofo-mess pedal 1
	antescofo-mess pedaltime 1500
	antescofo-mess pedalcoeff 0.3
	;antescofo-mess variance 0.1
	antescofo-mess nofharm 20
	antescofo-mess info

	antescofo_section 0
	antescofo_breathing 0
	antescofo_event1 0
	antescofo_event2 0
	antescofo_event3 0

	split 66 ; F#

	antescofo_section 2.9
; ----------- measure 31 --- beat 120.0 --- time signature 6/4

NOTE G#3 1/6 measure31
	antescofo_section 3
	split 71
CHORD (-G#3 C4) 1/6
CHORD (-G#3 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6
NOTE D#4 1/6
CHORD (C4 -D#4) 1/6
CHORD (-D#4 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6
NOTE G#3 1/6
CHORD (-G#3 C4) 1/6
CHORD (-G#3 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6
NOTE D#4 1/6
CHORD (C4 -D#4) 1/6
CHORD (-D#4 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6
NOTE G#3 1/6
CHORD (-G#3 C4) 1/6
CHORD (-G#3 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6
NOTE D#4 1/6
CHORD (C4 -D#4) 1/6
CHORD (-D#4 G4) 1/6
NOTE F4 1/6
CHORD (C4 -F4) 1/6
CHORD (-F4 G4) 1/6 @fermata @hook

; ----------- measure 32 --- beat 126.0 --- time signature 4/4

CHORD (G#3 C5) 1/6 measure32 @hook @fermata
TRILL (G#3 C4 D#4 F4 G4 -C5) 20/6 @fermata 
CHORD (F4 C5) 1/6 @fermata @hook
CHORD (C4 -F4 -C5) 1/6
CHORD (-F4 G4 -C5) 1/6 @fermata @hook

; ----------- measure 33 --- beat 130 --- time signature 4/4
	split 74
CHORD (G#3 D#5) 1/6 measure33 @hook @fermata
TRILL (G#3 D#4 F4 G4 C5) 23/6 @hook @fermata

; ----------- measure 34 --- beat 134 --- time signature 4/4

CHORD (C#4 F5) 1/6 measure34 @hook @fermata
TRILL (C#4 D#4 F4 G#4 C#5 -F5) 17/6 @fermata
CHORD (D#4 D#5) 1/6 @hook
CHORD (-D#4 G#4 -D#5) 1/6
CHORD (-D#4 C#5 -D#5) 1/6
CHORD (F4 -D#5) 1/6
CHORD (-F4 G#4 -D#5) 1/6
CHORD (-F4 C#5 -D#5) 1/6 @fermata @hook

; ----------- measure 35 --- beat 138 --- time signature 4/4
	split 69
CHORD (G#3 C5) 1/6 measure35 @hook
TRILL (G#3 C4 D#4 F4 G#4 -C5) 23/6 @fermata

; ----------- measure 36 --- beat 142 --- time signature 4/4

CHORD (F3 C5) 1/6 measure36 @hook
TRILL (-F3 C4 D#4 F4 G#4 -C5) 17/6 @fermata
CHORD (C#4 A#4) 1/6 @hook
CHORD (-C#4 D#4 -A#4) 1/6
CHORD (-C#4 G#4 -A#4) 1/6
CHORD (F4 -A#4) 1/6
CHORD (D#4 -F4 -A#4) 1/6
CHORD (-F4 G#4 -A#4) 1/6 @fermata

I’m happy to send an mp3 that starts from exactly this point; it doesn’t seem that I can attach a file to a reply.

@arshiacont to follow up, this also happens on my Intel Macbook Pro running Max 8.2.1

Here’s the output from info on that machine:

antescofo~: Follower Mode is ON (was off).
antescofo~: Entering pedal mode.
antescofo~: Number of harmonics set to 20 (was 10)
antescofo~: Antescofo~ - Score Following and Real-time Programming
antescofo~:                      by Arshia Cont, Philippe Cuvillier, Jose Echeveste, Jean-Louis Giavitto © Antescofo™ 2016-2018
antescofo~:                      release master - 1.0-1, Compiled on Mar  5 2018 17:50:54
antescofo~:           Follower is ON
antescofo~:           Analysis Parameters: nfft=4096, hop=512 (resolution 0.0Hz)
antescofo~:           Number of Harmonics used for spectral match: 20
antescofo~:           Gamma (Energy Correction): 0.000
antescofo~:           Tuned to 0.0Hz
antescofo~:           Pedal 1, Pedal Coefficient 0.000, Pedal Time (ms) 14439403097493127228086572627788896342812099556930892048722311937856193118221372248518281681174069920931931461622825570535372435079126051790396840464266040536268570340989112267311387540993639444768045531094056960000
antescofo~:           Temposmoothness 0.000
antescofo~:           Piano mode ON
antescofo~:           Prevent zigzag ON (forward only)
antescofo~:           Inference version is 2
antescofo~:           Occupancy model is 0.0000
antescofo~:           Decode window length is 21
antescofo~:           KL mode is left
antescofo~:           Current score: "/Volumes/Mac SSD/Users/cw/Documents/Max 8/Projects/setlist/05-Vincennes-B.asco.txt" with 1657 events and 35 actions
antescofo~:           No preloaded scores.
antescofo~:           AscoGraph communication is OFF.
antescofo~:           Verbosity: 0

@c-harl-ie It’s hard to judge without looking at the performance with an audio recording. But here are some thoughts:

From what you describe (measure 33 jumping to 34 and looking at the score), it seems like a chord in 34 is detected while the one in 33 is being held. This can happen for various reasons. Here are some recommendations:

  • Your pedal time is way too high. Keep it low (like 300ms instead of 1500ms). If not, while the chord vanishes (it’s a Piano after all) the system might think (as harmonics vanish one by one and pedal effect taking them away) that despite the duration an attack is occuring. In general I recommend not using pedal option on the entire piece but on specific sections where detecting wouldn’t be otherwise possible. A famous example of this is the beginning of Pluton by Philippe Manoury (repeated low chords with pedal!) where attacks wouldn’t be otherwise observable. In short: use the pedal option sparsely.

  • Your score seems a bit strange! I have to look at a PDF to confirm. It seems like it was somehow tweaked for the listening machine. I actually advise against these nowadays! :slight_smile: What is the TRILL in measure 34? I believe this is the guy causing the jump. What is the original notation for this?

Feel free to get in touch and share MusicXML/PDF/Audio on my pro email which I believe you already have! :wink:

PS: I believe that @hook is legacy and non-effective! Should check this with @giavitto . I can also see bugs in the output of info which will be corrected for next release.

1 Like

Ah I have (maybe) found something!

Using verbosity 2 and watching the output stream, I see a bunch of errors right when the follower starts jumping ahead. They look like:

antescofo~: StateSemiMarkov::Infere: too big ForwardLast - state ( 4900 5800 6000 6300 6500 6800 ) - u=317 - ForwardLast 6.4815e-314, Forward 0.0000e+00

I don’t know what this means but the fact that it’s flagged as an error and happens right around when the score follower stops being accurate… feels like it’s related.

I’m attaching a larger segment of output; it’s too verbose for pasting here.

Thanks @arshiacont!
Max-output-excerpt.txt (118.6 KB)

This appears to resolve when I switch my sample rate to 44.1 globally. I don’t see a requirement for 44.1 anywhere in the docs though— I’m leaving this for now because I had this issue temporarily resolve before, but if this fix sticks that would be :100:

Hello c-harl-ie.

Antescofo may run in 44.1 or at any other sampling rate. But if the input is at 44.1 and the sample rate is not, the input signal is seen as distorted and it leads to errors. Antescofo has no way of finding out the characteristics of the input signal from the signal itself, and therefore relies on the global sample rate given by Max.

@c-harl-ie does that solve all the recognition issues?

Antescofo adapts internally to Max’s Sampling Frequency… this is not necessarily the case for other objects. For example, a file reader might just output your file in 44.1K, in a general 48K Max session : when you listen to it, the DAC receiver might convert it back to 48K while Antescofo is receiving it in 44.1K! I know it’s weird but hey… :slight_smile:

Yep thanks— I’m not sure where the sticky bit is in my Max project exactly but that’s a great concept to keep in mind. Moving everything to 44.1kHz fixes the recognition issues, so I’ll leave it there for now :slight_smile:

I appreciate your help!