<div dir="ltr">Oh, it appears I included some whitespace-only changes, this must be the result of having 'prettyPrint' turned on. I'll make sure I turn that off when editing system methods in the future! </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 5, 2022 at 1:19 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">David O'Toole uploaded a new version of Sound to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Sound-dto.85.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Sound-dto.85.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Sound-dto.85<br>
Author: dto<br>
Time: 5 February 2022, 1:19:37.313377 pm<br>
UUID: 1f3917a1-5536-4c9f-80b7-6f3613e7d087<br>
Ancestors: Sound-ct.84<br>
<br>
Fixes incorrect AIFF loop marker extraction, and removes obsolete path delimiters in SampledInstrument.<br>
<br>
=============== Diff against Sound-ct.84 ===============<br>
<br>
Item was changed:<br>
----- Method: AIFFFileReader>>loopEnd (in category 'accessing') -----<br>
loopEnd<br>
+ ^ markers second last!<br>
- <br>
- ^ markers last last<br>
- !<br>
<br>
Item was changed:<br>
----- Method: AIFFFileReader>>loopLength (in category 'accessing') -----<br>
loopLength<br>
+ ^ markers second last - markers first last!<br>
- <br>
- ^ markers last last - markers first last<br>
- !<br>
<br>
Item was changed:<br>
----- Method: AIFFFileReader>>readInstrumentChunk: (in category 'private') -----<br>
+ readInstrumentChunk: chunkSize <br>
+ | midiKey detune lowNote highNote lowVelocity highVelocity sustainMode sustainStartID sustainEndID releaseMode releaseStartID releaseEndID |<br>
- readInstrumentChunk: chunkSize<br>
- <br>
- | midiKey detune lowNote highNote lowVelocity highVelocity<br>
- sustainMode sustainStartID sustainEndID<br>
- releaseMode releaseStartID releaseEndID |<br>
- <br>
midiKey := in next.<br>
detune := in next.<br>
lowNote := in next.<br>
highNote := in next.<br>
lowVelocity := in next.<br>
highVelocity := in next.<br>
gain := in nextNumber: 2.<br>
sustainMode := in nextNumber: 2.<br>
sustainStartID := in nextNumber: 2.<br>
sustainEndID := in nextNumber: 2.<br>
releaseMode := in nextNumber: 2.<br>
releaseStartID := in nextNumber: 2.<br>
releaseEndID := in nextNumber: 2.<br>
isLooped := sustainMode = 1.<br>
+ (isLooped<br>
+ and: [markers notNil])<br>
+ ifTrue: [(markers first last > frameCount<br>
+ or: [markers second last > frameCount])<br>
+ ifTrue: ["bad loop data; some sample CD files claim to be<br>
+ looped but aren't"<br>
+ isLooped := false]].<br>
+ pitch := self pitchForKey: midiKey!<br>
- (isLooped and: [markers notNil]) ifTrue: [<br>
- ((markers first last > frameCount) or:<br>
- [markers last last > frameCount]) ifTrue: [<br>
- "bad loop data; some sample CD files claim to be looped but aren't"<br>
- isLooped := false]].<br>
- pitch := self pitchForKey: midiKey.<br>
- !<br>
<br>
Item was changed:<br>
----- Method: SampledInstrument class>>readLoudAndStaccatoInstrument:fromDirectory: (in category 'instance creation') -----<br>
+ readLoudAndStaccatoInstrument: instName fromDirectory: orchestraDir <br>
- readLoudAndStaccatoInstrument: instName fromDirectory: orchestraDir<br>
"SampledInstrument<br>
+ readLoudAndStaccatoInstrument: 'oboe'<br>
+ fromDirectory: 'Tosh:Sample Library:Orchestra'"<br>
- readLoudAndStaccatoInstrument: 'oboe'<br>
- fromDirectory: 'Tosh:Sample Library:Orchestra'"<br>
- <br>
| sampleSetDir memBefore memAfter loud short snd |<br>
+ sampleSetDir := orchestraDir , FileDirectory slash , instName.<br>
- sampleSetDir := orchestraDir, ':', instName.<br>
memBefore := Smalltalk garbageCollect.<br>
+ loud := SampledInstrument new readSampleSetFrom: sampleSetDir , ' f'.<br>
+ short := SampledInstrument new readSampleSetFrom: sampleSetDir , ' stacc'.<br>
- loud := SampledInstrument new readSampleSetFrom: sampleSetDir, ' f'.<br>
- short := SampledInstrument new readSampleSetFrom: sampleSetDir, ' stacc'.<br>
memAfter := Smalltalk garbageCollect.<br>
+ Transcript show: instName , ': ' , (memBefore - memAfter) printString , ' bytes; ' , memAfter printString , ' bytes left';<br>
+ cr.<br>
+ AbstractSound soundNamed: instName , '-f&stacc' put: (snd := SampledInstrument new allSampleSets: loud;<br>
+ staccatoLoudAndSoftSampleSet: short).<br>
- Transcript show:<br>
- instName, ': ', (memBefore - memAfter) printString,<br>
- ' bytes; ', memAfter printString, ' bytes left'; cr.<br>
- AbstractSound soundNamed: instName, '-f&stacc' put:<br>
- (snd := SampledInstrument new<br>
- allSampleSets: loud;<br>
- staccatoLoudAndSoftSampleSet: short).<br>
"fix slow attacks"<br>
+ snd allNotes<br>
+ do: [:n | n<br>
+ firstSample: (n findStartPointForThreshold: 500)].<br>
+ AbstractSound soundNamed: instName , '-f' put: (snd := SampledInstrument new allSampleSets: loud).<br>
- snd allNotes do: [:n | n firstSample: (n findStartPointForThreshold: 500)].<br>
- <br>
- AbstractSound soundNamed: instName, '-f' put:<br>
- (snd := SampledInstrument new<br>
- allSampleSets: loud).<br>
"fix slow attacks"<br>
+ snd allNotes<br>
+ do: [:n | n<br>
+ firstSample: (n findStartPointForThreshold: 1000)]!<br>
- snd allNotes do: [:n | n firstSample: (n findStartPointForThreshold: 1000)].<br>
- !<br>
<br>
Item was changed:<br>
----- Method: SampledInstrument class>>readPizzInstrument:fromDirectory: (in category 'instance creation') -----<br>
+ readPizzInstrument: instName fromDirectory: orchestraDir <br>
- readPizzInstrument: instName fromDirectory: orchestraDir<br>
"SampledInstrument<br>
+ readPizzInstrument: 'violin'<br>
+ fromDirectory: 'Tosh:Sample Library:Orchestra'"<br>
- readPizzInstrument: 'violin'<br>
- fromDirectory: 'Tosh:Sample Library:Orchestra'"<br>
- <br>
| sampleSetDir memBefore memAfter sampleSet snd |<br>
+ sampleSetDir := orchestraDir , FileDirectory slash , instName , ' pizz'.<br>
- sampleSetDir := orchestraDir, ':', instName, ' pizz'.<br>
memBefore := Smalltalk garbageCollect.<br>
sampleSet := SampledInstrument new readSampleSetFrom: sampleSetDir.<br>
memAfter := Smalltalk garbageCollect.<br>
+ Transcript show: instName , ': ' , (memBefore - memAfter) printString , ' bytes; ' , memAfter printString , ' bytes left';<br>
+ cr.<br>
+ AbstractSound soundNamed: instName , '-pizz' put: (snd := SampledInstrument new allSampleSets: sampleSet).<br>
- Transcript show:<br>
- instName, ': ', (memBefore - memAfter) printString,<br>
- ' bytes; ', memAfter printString, ' bytes left'; cr.<br>
- AbstractSound soundNamed: instName, '-pizz' put:<br>
- (snd := SampledInstrument new allSampleSets: sampleSet).<br>
- <br>
"fix slow attacks"<br>
+ snd allNotes<br>
+ do: [:n | n<br>
+ firstSample: (n findStartPointForThreshold: 1000)].<br>
+ ^ snd!<br>
- snd allNotes do: [:n |<br>
- n firstSample: (n findStartPointForThreshold: 1000)].<br>
- <br>
- ^ snd<br>
- !<br>
<br>
Item was changed:<br>
----- Method: SampledInstrument class>>readSimpleInstrument:fromDirectory: (in category 'instance creation') -----<br>
readSimpleInstrument: instName fromDirectory: orchestraDir<br>
"SampledInstrument<br>
readSimpleInstrument: 'oboe'<br>
fromDirectory: 'Tosh:Sample Library:Orchestra'"<br>
<br>
| sampleSetDir memBefore memAfter sampleSet snd |<br>
+ sampleSetDir := orchestraDir, FileDirectory slash, instName, ' f'.<br>
- sampleSetDir := orchestraDir, ':', instName, ' f'.<br>
memBefore := Smalltalk garbageCollect.<br>
sampleSet := SampledInstrument new readSampleSetFrom: sampleSetDir.<br>
memAfter := Smalltalk garbageCollect.<br>
Transcript show:<br>
instName, ': ', (memBefore - memAfter) printString,<br>
' bytes; ', memAfter printString, ' bytes left'; cr.<br>
AbstractSound soundNamed: instName, '-f' put:<br>
(snd := SampledInstrument new allSampleSets: sampleSet).<br>
<br>
"fix slow attacks"<br>
snd allNotes do: [:n |<br>
n firstSample: (n findStartPointForThreshold: 1000)].<br>
<br>
^ snd<br>
!<br>
<br>
<br>
</blockquote></div>