license import { INoteSequence } from '@magenta/music' ; /**
 * Exception for when a sequence was unexpectedly quantized or unquantized.
 *
 * Should not happen during normal operation and likely indicates a programming
 * error.
 */ export class QuantizationStatusException extends Error { constructor ( message ? ) { super ( message ) ; Object . setPrototypeOf ( this , new . target . prototype ) ; } } /**
 * Returns whether the given NoteSequence has been quantized relative to tempo.
 */ export function isRelativeQuantizedSequence ( ns ) { return ns . quantizationInfo && ns . quantizationInfo . stepsPerQuarter > 0 ; } /**
 * Confirms that the given NoteSequence has been quantized relative to tempo.
 */ export function assertIsRelativeQuantizedSequence ( ns ) { if ( ! isRelativeQuantizedSequence ( ns ) ) { throw new QuantizationStatusException ( `NoteSequence ${ ns . id } is not quantized or is quantized based on absolute timing` ) ; } }