Jellevanderwerff / thebeat

thebeat: Rhythms in Python for science
https://thebeat.readthedocs.io
GNU General Public License v3.0
19 stars 1 forks source link

Error not raised when constructing a SoundSequence with end_with_interval=True and too long sound #42

Closed Jellevanderwerff closed 1 year ago

Jellevanderwerff commented 1 year ago

The doesn't raise a helpful error:

seq = thebeat.Sequence([500, 500, 10], end_with_interval=True)
s = thebeat.SoundStimulus.generate(duration_ms=50)
ss = thebeat.SoundSequence(s, seq)

Whereas this does:

seq = thebeat.Sequence([10, 500, 500], end_with_interval=False)
s = thebeat.SoundStimulus.generate(duration_ms=50)
ss = thebeat.SoundSequence(s, seq)
Jellevanderwerff commented 1 year ago

Also ran into a frame rounding error that wasn't caught/warned and rounded. Cannot reproduce now but raises a NumPy ValueError like "shape (2501,) couldn't be broadcast into shape (2500,)", or the other way around.