[squeak-dev] Bad loop parameters in AIFF [Repost without large attachment]

David O'Toole deeteeoh1138 at gmail.com
Sat Feb 5 01:46:39 UTC 2022


(Apologies if this is a double post, I think the other will be rejected on
account of the 2+MB AIFF file I attached. Instead I've put up a Zip file of
the AIFFs I'm trying to import, on GDrive:
https://drive.google.com/file/d/16BvtxS9tkIPJRcx-cri1gPGM5p0E7uV_/view?usp=sharing

Original message:

I have AIFF files with loop points all set the same, beginning at sample
44100 and ending at 88200. I am trying to use
SampledInstrument(class)>>#readSimpleInstrument:fromDirectory: to create a
sampled instrument.

In Snd i can verify the loop points are correct:

> >(sound-loop-info (open-sound "~/sessions/orch.mosaic/cello f/36.aif"))
(44100 88200 0 0 0 0 1 1)

But as you can see in the bug report/screenshot, the end point becomes 0
somehow when it reaches note 36.aif, resulting in an error. I've also
included the offending .aif file, which might be malformed in some way I
haven't discovered.

How might I go about debugging this further?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220204/d1803c5a/attachment-0001.html>
-------------- next part --------------
4 February 2022 8:23:09.18281 pm

VM: unix - Smalltalk
Image: Squeak6.0alpha [latest update: #21171]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/dto/Squeak/shared
Trusted Dir /home/dto/Squeak/shared/secure
Untrusted Dir /home/dto/Squeak/shared/My Squeak

LoopedSampledSound(Object)>>error:
	Receiver: a LoopedSampledSound
	Arguments and temporary variables: 
		aString: 	'bad loop parameters'
	Receiver's instance variables: 
		envelopes: 	#()
		mSecsSinceStart: 	0
		samplesUntilNextControl: 	0
		scaledVol: 	32768
		scaledVolIncr: 	0
		scaledVolLimit: 	32768
		initialCount: 	22050
		count: 	22050
		releaseCount: 	0
		sampleCountForRelease: 	0
		leftSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 669...etc...
		rightSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 66...etc...
		originalSamplingRate: 	4000.0
		perceivedPitch: 	1.0
		gain: 	1.0
		firstSample: 	1
		lastSample: 	4000
		loopEnd: 	4000
		scaledLoopLength: 	2048000
		scaledIndex: 	512
		scaledIndexIncr: 	40867

LoopedSampledSound>>samples:loopEnd:loopLength:pitch:samplingRate:
	Receiver: a LoopedSampledSound
	Arguments and temporary variables: 
		aSoundBuffer: 	a SoundBuffer(0 0 0 1 1 1 2 2 2 2 2 3 3 3 3 3 3 3 3 2 2 2 2 1 1 0...etc...
		loopEndIndex: 	0
		loopSampleCount: 	-44100
		perceivedPitchInHz: 	8.1758
		samplingRateInHz: 	44100.0
		loopStartIndex: 	44101
	Receiver's instance variables: 
		envelopes: 	#()
		mSecsSinceStart: 	0
		samplesUntilNextControl: 	0
		scaledVol: 	32768
		scaledVolIncr: 	0
		scaledVolLimit: 	32768
		initialCount: 	22050
		count: 	22050
		releaseCount: 	0
		sampleCountForRelease: 	0
		leftSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 669...etc...
		rightSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 66...etc...
		originalSamplingRate: 	4000.0
		perceivedPitch: 	1.0
		gain: 	1.0
		firstSample: 	1
		lastSample: 	4000
		loopEnd: 	4000
		scaledLoopLength: 	2048000
		scaledIndex: 	512
		scaledIndexIncr: 	40867

LoopedSampledSound>>fromAIFFFileNamed:mergeIfStereo:
	Receiver: a LoopedSampledSound
	Arguments and temporary variables: 
		fileName: 	'/home/dto/sessions/orch.mosaic/cello f/36.aif'
		mergeFlag: 	true
		aiffFileReader: 	an AIFFFileReader
	Receiver's instance variables: 
		envelopes: 	#()
		mSecsSinceStart: 	0
		samplesUntilNextControl: 	0
		scaledVol: 	32768
		scaledVolIncr: 	0
		scaledVolLimit: 	32768
		initialCount: 	22050
		count: 	22050
		releaseCount: 	0
		sampleCountForRelease: 	0
		leftSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 669...etc...
		rightSamples: 	a SoundBuffer(0 51 103 154 206 257 309 360 412 463 515 566 618 66...etc...
		originalSamplingRate: 	4000.0
		perceivedPitch: 	1.0
		gain: 	1.0
		firstSample: 	1
		lastSample: 	4000
		loopEnd: 	4000
		scaledLoopLength: 	2048000
		scaledIndex: 	512
		scaledIndexIncr: 	40867

[] in [] in SampledInstrument>>readSampleSetFrom:
	Receiver: a SampledInstrument
	Arguments and temporary variables: 
		dirName: 	'/home/dto/sessions/orch.mosaic/cello f'
		all: 	an OrderedCollection()
		dir: 	UnixFileDirectory on '/home/dto/sessions/orch.mosaic/cello f'
		n: 	'36.aif'
		fullName: 	'/home/dto/sessions/orch.mosaic/cello f/36.aif'
		snd: 	nil
	Receiver's instance variables: 
		sustainedSoft: 	nil
		sustainedLoud: 	nil
		staccatoSoft: 	nil
		staccatoLoud: 	nil
		sustainedThreshold: 	0.15
		loudThreshold: 	0.5

[] in MorphicUIManager(UIManager)>>informUser:during:
	Receiver: a MorphicUIManager
	Arguments and temporary variables: 
		aString: 	'Reading AIFF file 36.aif'
		aBlock: 	[closure] in [] in SampledInstrument>>readSampleSetFrom:
		bar: 	[closure] in SystemProgressMorph>>position:label:min:max:
	Receiver's instance variables: 
		builderClass: 	MorphicToolBuilder

[] in [] in MorphicUIManager>>displayProgress:at:from:to:during:
	Receiver: a MorphicUIManager
	Arguments and temporary variables: 
		titleString: 	' '
		aPoint: 	960 at 540
		minVal: 	0
		maxVal: 	0
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		progress: 	[closure] in SystemProgressMorph>>position:label:min:max:
		result: 	nil
	Receiver's instance variables: 
		builderClass: 	MorphicToolBuilder

FullBlockClosure(BlockClosure)>>on:do:
	Receiver: [closure] in [] in MorphicUIManager>>displayProgress:at:from:to:during:
	Arguments and temporary variables: 
		exceptionOrExceptionSet: 	ProgressNotification
		handlerAction: 	[closure] in [] in MorphicUIManager>>displayProgress:at:from:to:during:...etc...
		handlerActive: 	true
		handlerRearmed: 	false
	Receiver's instance variables: 
		outerContext: 	[] in MorphicUIManager>>displayProgress:at:from:to:during:
		startpcOrMethod: 	([] in MorphicUIManager>>#displayProgress:at:from:to:during: "...etc...
		numArgs: 	0
		receiver: 	a MorphicUIManager

[] in MorphicUIManager>>displayProgress:at:from:to:during:
	Receiver: a MorphicUIManager
	Arguments and temporary variables: 
		titleString: 	' '
		aPoint: 	960 at 540
		minVal: 	0
		maxVal: 	0
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		progress: 	[closure] in SystemProgressMorph>>position:label:min:max:
		result: 	nil
	Receiver's instance variables: 
		builderClass: 	MorphicToolBuilder

FullBlockClosure(BlockClosure)>>ensure:
	Receiver: [closure] in MorphicUIManager>>displayProgress:at:from:to:during:
	Arguments and temporary variables: 
		aBlock: 	[closure] in MorphicUIManager>>displayProgress:at:from:to:during:
		complete: 	nil
		returnValue: 	nil
	Receiver's instance variables: 
		outerContext: 	MorphicUIManager>>displayProgress:at:from:to:during:
		startpcOrMethod: 	([] in MorphicUIManager>>#displayProgress:at:from:to:during: "...etc...
		numArgs: 	0
		receiver: 	a MorphicUIManager

MorphicUIManager>>displayProgress:at:from:to:during:
	Receiver: a MorphicUIManager
	Arguments and temporary variables: 
		titleString: 	' '
		aPoint: 	960 at 540
		minVal: 	0
		maxVal: 	0
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		progress: 	[closure] in SystemProgressMorph>>position:label:min:max:
		result: 	nil
	Receiver's instance variables: 
		builderClass: 	MorphicToolBuilder

ProgressInitiationException>>defaultResumeValue
	Receiver: ProgressInitiationException: 
	Arguments and temporary variables: 

	Receiver's instance variables: 
		messageText: 	nil
		tag: 	nil
		signalContext: 	ProgressInitiationException(Exception)>>signal
		handlerContext: 	nil
		outerContext: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		maxVal: 	0
		minVal: 	0
		aPoint: 	960 at 540
		progressTitle: 	' '

ProgressInitiationException(Exception)>>resume
	Receiver: ProgressInitiationException: 
	Arguments and temporary variables: 

	Receiver's instance variables: 
		messageText: 	nil
		tag: 	nil
		signalContext: 	ProgressInitiationException(Exception)>>signal
		handlerContext: 	nil
		outerContext: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		maxVal: 	0
		minVal: 	0
		aPoint: 	960 at 540
		progressTitle: 	' '

ProgressInitiationException>>defaultAction
	Receiver: ProgressInitiationException: 
	Arguments and temporary variables: 

	Receiver's instance variables: 
		messageText: 	nil
		tag: 	nil
		signalContext: 	ProgressInitiationException(Exception)>>signal
		handlerContext: 	nil
		outerContext: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		maxVal: 	0
		minVal: 	0
		aPoint: 	960 at 540
		progressTitle: 	' '

UndefinedObject>>handleSignal:
	Receiver: nil
	Arguments and temporary variables: 
		exception: 	ProgressInitiationException: 
	Receiver's instance variables: 
nil

ProgressInitiationException(Exception)>>signal
	Receiver: ProgressInitiationException: 
	Arguments and temporary variables: 

	Receiver's instance variables: 
		messageText: 	nil
		tag: 	nil
		signalContext: 	ProgressInitiationException(Exception)>>signal
		handlerContext: 	nil
		outerContext: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		maxVal: 	0
		minVal: 	0
		aPoint: 	960 at 540
		progressTitle: 	' '

ProgressInitiationException>>display:at:from:to:during:
	Receiver: ProgressInitiationException: 
	Arguments and temporary variables: 
		argString: 	' '
		argPoint: 	960 at 540
		argMinVal: 	0
		argMaxVal: 	0
		argWorkBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
	Receiver's instance variables: 
		messageText: 	nil
		tag: 	nil
		signalContext: 	ProgressInitiationException(Exception)>>signal
		handlerContext: 	nil
		outerContext: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
		maxVal: 	0
		minVal: 	0
		aPoint: 	960 at 540
		progressTitle: 	' '

ProgressInitiationException class>>display:at:from:to:during:
	Receiver: ProgressInitiationException
	Arguments and temporary variables: 
		aString: 	' '
		aPoint: 	nil
		minVal: 	0
		maxVal: 	0
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
	Receiver's instance variables: 
		superclass: 	Notification
		methodDict: 	a MethodDictionary(#defaultAction->(ProgressInitiationException>>#d...etc...
		format: 	65546
		instanceVariables: 	#('workBlock' 'maxVal' 'minVal' 'aPoint' 'progressTitle')
		organization: 	('handling' defaultAction defaultResumeValue resumeSuppressingProgress...etc...
		subclasses: 	nil
		name: 	#ProgressInitiationException
		classPool: 	a Dictionary(#PreferredProgressBarPosition->nil )
		sharedPools: 	nil
		environment: 	Smalltalk
		category: 	#'ToolBuilder-Kernel'

SystemProgressMorph class>>informUserAt:during:
	Receiver: SystemProgressMorph
	Arguments and temporary variables: 
		aPoint: 	nil
		workBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
	Receiver's instance variables: 
		superclass: 	Morph
		methodDict: 	a MethodDictionary(#activeSlots->(SystemProgressMorph>>#activeSlots...etc...
		format: 	65549
		instanceVariables: 	#('activeSlots' 'bars' 'labels' 'font' 'lock' 'requestedPosition...etc...
		organization: 	('dropping/grabbing' slideToTrash:)
('initialization' initialize setDefaultParameters...etc...
		subclasses: 	{PreferenceWizardProgressMorph}
		name: 	#SystemProgressMorph
		classPool: 	a Dictionary(#BarHeight->8 #BarWidth->300 #Inset->30 at 30 #UniqueInstance...etc...
		sharedPools: 	nil
		environment: 	Smalltalk
		category: 	#'Morphic-Widgets'

MorphicUIManager>>informUserDuring:
	Receiver: a MorphicUIManager
	Arguments and temporary variables: 
		aBlock: 	[closure] in MorphicUIManager(UIManager)>>informUser:during:
	Receiver's instance variables: 
		builderClass: 	MorphicToolBuilder


--- The full stack ---
LoopedSampledSound(Object)>>error:
LoopedSampledSound>>samples:loopEnd:loopLength:pitch:samplingRate:
LoopedSampledSound>>fromAIFFFileNamed:mergeIfStereo:
[] in [] in SampledInstrument>>readSampleSetFrom:
[] in MorphicUIManager(UIManager)>>informUser:during:
[] in [] in MorphicUIManager>>displayProgress:at:from:to:during:
FullBlockClosure(BlockClosure)>>on:do:
[] in MorphicUIManager>>displayProgress:at:from:to:during:
FullBlockClosure(BlockClosure)>>ensure:
MorphicUIManager>>displayProgress:at:from:to:during:
ProgressInitiationException>>defaultResumeValue
ProgressInitiationException(Exception)>>resume
ProgressInitiationException>>defaultAction
UndefinedObject>>handleSignal:
ProgressInitiationException(Exception)>>signal
ProgressInitiationException>>display:at:from:to:during:
ProgressInitiationException class>>display:at:from:to:during:
SystemProgressMorph class>>informUserAt:during:
MorphicUIManager>>informUserDuring:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MorphicUIManager(UIManager)>>informUser:during:
[] in SampledInstrument>>readSampleSetFrom:
Array(SequenceableCollection)>>do:
SampledInstrument>>readSampleSetFrom:
SampledInstrument class>>readSimpleInstrument:fromDirectory:
UndefinedObject>>DoIt
Compiler>>evaluateCue:ifFail:
Compiler>>evaluateCue:ifFail:logged:
Compiler>>evaluate:in:to:environment:notifying:ifFail:logged:
[] in SmalltalkEditor(TextEditor)>>evaluateSelectionAndDo:
FullBlockClosure(BlockClosure)>>on:do:
SmalltalkEditor(TextEditor)>>evaluateSelectionAndDo:
SmalltalkEditor(TextEditor)>>evaluateSelection
SmalltalkEditor(TextEditor)>>doIt
SmalltalkEditor(TextEditor)>>doIt:
SmalltalkEditor(TextEditor)>>dispatchOnKeyboardEvent:
SmalltalkEditor(TextEditor)>>keyStroke:
[] in [] in TextMorphForEditView(TextMorph)>>keyStroke:
TextMorphForEditView(TextMorph)>>handleInteraction:fromEvent:
TextMorphForEditView>>handleInteraction:fromEvent:
[] in TextMorphForEditView(TextMorph)>>keyStroke:
ViToolSet class(ECToolSet class)>>codeCompletionAround:textMorph:keyStroke:
ToolSet class>>codeCompletionAround:textMorph:keyStroke:
TextMorphForEditView(TextMorph)>>keyStroke:
TextMorphForEditView>>keyStroke:
TextMorphForEditView(Morph)>>handleKeystroke:
TextMorphForEditView(TextMorph)>>handleKeystroke:
KeyboardEvent>>sentTo:
TextMorphForEditView(Morph)>>handleEvent:
TextMorphForEditView(Morph)>>handleFocusEvent:
MorphicEventDispatcher>>doHandlingForFocusEvent:with:
MorphicEventDispatcher>>dispatchFocusEvent:with:
TextMorphForEditView(Morph)>>processFocusEvent:using:
TextMorphForEditView(Morph)>>processFocusEvent:
[] in [] in [] in HandMorph>>sendFocusEvent:to:clear:
[] in ActiveEventVariable class(DynamicVariable class)>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveEventVariable class(DynamicVariable class)>>value:during:
[] in ActiveEventVariable class>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
ActiveEventVariable class>>value:during:
KeyboardEvent(MorphicEvent)>>becomeActiveDuring:
-- and more not shown --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot at 2022-02-04 20-22-41.png
Type: image/png
Size: 396712 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220204/d1803c5a/attachment-0001.png>


More information about the Squeak-dev mailing list