# !!! Be extremely careful with the organization of modes, which can be either Frequency-Time at barscale-Bars (FTB) or Bars-Frequency-Time at barscale (BFT) depending on the method.
iflen(samples)!=len(set(samples)):# Check for repetitions
ifidx!=len(bars_idx)-1:# It's not a problem if it's the last bar, because it is due to inconsistencies between the last downbeat estimated and the end of the song.
raiseerr.ToDebugException("The subdivision is too large, it leads to repeated samples chosen in the bar!")