<div dir="ltr">Ok, I created an account and followed your instructions to make a proper submission to the Inbox. Looks like everything went according to plan, let me know if there are any issues! </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 5, 2022 at 11:31 AM David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</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">Thanks David and Karl. This sounds like something we should put into trunk.<br>
<br>
David, <br>
<br>
If you are comfortable using Monticello tools, could you please put<br>
this update into the inbox? That way, when we put it into trunk the<br>
update will have your initials on it.<br>
<br>
All you need to do is highlight the Sound package in a Monticello<br>
browser, then click the "+Repository" button and open a new repository<br>
of type "HTTP". Fill in the repository information with this:<br>
<br>
MCHttpRepository<br>
        location: '<a href="http://source.squeak.org/inbox" rel="noreferrer" target="_blank">http://source.squeak.org/inbox</a>'<br>
        user: ''<br>
        password: ''<br>
<br>
Then you will be able to select the inbox repository along with the<br>
Sound package, and click the Save button to save it to the inbox.<br>
<br>
It also will be helpful, but not necessary, to register a 'dto'<br>
account for yourself on <a href="http://source.squeak.org" rel="noreferrer" target="_blank">http://source.squeak.org</a> to identify yourself<br>
for this and future updates. But the inbox does not require a user<br>
or password so registering yourself is optional.<br>
<br>
Note that you can also open local file based repositories by opening<br>
a repository of type 'directory' and point it at an empty directory<br>
on your computer. If you have not worked with Monticello repositories<br>
before, you can practice on a local repository, and if you save to<br>
a local repository you can later open that repository and copy a<br>
package to the inbox.<br>
<br>
Thank you!<br>
<br>
Dave<br>
<br>
<br>
On Sat, Feb 05, 2022 at 10:13:02AM -0500, David O'Toole wrote:<br>
> With the MIDI note added to the AIFF file markers, plus my changeset,<br>
> everything works correctly; the [ScorePlayerMorph extraExample openInHand]<br>
> example plays properly (and pleasingly) when all the instruments are set to<br>
> the new SampledInstrument 'cello f'.<br>
> <br>
> On Sat, Feb 5, 2022 at 9:41 AM David O'Toole <<a href="mailto:deeteeoh1138@gmail.com" target="_blank">deeteeoh1138@gmail.com</a>> wrote:<br>
> <br>
> > Thank you so much for your help Karl!<br>
> ><br>
> ><br>
> > On Sat, Feb 5, 2022 at 9:37 AM karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>> wrote:<br>
> ><br>
> >> Cool<br>
> >><br>
> >> Best,<br>
> >> Karl<br>
> >><br>
> >> On Sat, Feb 5, 2022 at 3:32 PM David O'Toole <<a href="mailto:deeteeoh1138@gmail.com" target="_blank">deeteeoh1138@gmail.com</a>><br>
> >> wrote:<br>
> >><br>
> >>> "markers last last" <---- this isn't correct, it should be "markers<br>
> >>> second last" as it is definitely legitimate for AIFF files to contain more<br>
> >>> than two markers. Indeed with the following changeset, I get a working (if<br>
> >>> somewhat wonky and still needing to be debugged) instrument.<br>
> >>><br>
> >>> vCello := SampledInstrument readSimpleInstrument: 'cello' fromDirectory:<br>
> >>> '/home/dto/sessions/orch.mosaic'.<br>
> >>> vCello playChromaticRunFrom: 10 to: 40.<br>
> >>> (vCello soundForMidiKey: 20 dur: 8.0 loudness: 0.5) play.<br>
> >>><br>
> >>> On Sat, Feb 5, 2022 at 9:03 AM karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>><br>
> >>> wrote:<br>
> >>><br>
> >>>><br>
> >>>> I think there is something wrong with the logic for AIFFFileReader<br>
> >>>> instance variable isLooped.<br>
> >>>> I don't see the error if I hard code isLooped to false in method below.<br>
> >>>><br>
> >>>> AIFFFileReader>>readInstrumentChunk: chunkSize<br>
> >>>> ...<br>
> >>>> isLooped := sustainMode = 1.<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>
> >>>><br>
> >>>> The logic for determining if a sound is looped seems a little<br>
> >>>> error-prone.<br>
> >>>><br>
> >>>> Loop length in AIFFFileReader is calculated from markers<br>
> >>>> Markers in 36.aif is #(#(1 '' 44100) #(2 '' 88200) #(3 '' 0) #(4 ''<br>
> >>>> 0)).<br>
> >>>><br>
> >>>> markers := #(#(1 '' 44100) #(2 '' 88200) #(3 '' 0) #(4 '' 0)).<br>
> >>>> markers last last - markers first last  "How AIFFFileReader calculates<br>
> >>>> loop length"<br>
> >>>> -44100<br>
> >>>><br>
> >>>> Best,<br>
> >>>> Karl<br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>> On Sat, Feb 5, 2022 at 1:36 PM David O'Toole <<a href="mailto:deeteeoh1138@gmail.com" target="_blank">deeteeoh1138@gmail.com</a>><br>
> >>>> wrote:<br>
> >>>><br>
> >>>>> Try placing the unzipped "cello f" folder into directory "path_to_foo"<br>
> >>>>> then:<br>
> >>>>><br>
> >>>>> SampledInstrument readSimpleInstrument: 'cello' fromDirectory:<br>
> >>>>> 'path_to_foo'<br>
> >>>>><br>
> >>>>> I see your comment about the negative loop length, however this<br>
> >>>>> appears to be the bug itself---I verified in Snd that the loop points are<br>
> >>>>> 44100 and 88200.<br>
> >>>>><br>
> >>>>> On Sat, Feb 5, 2022 at 7:08 AM karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>><br>
> >>>>> wrote:<br>
> >>>>><br>
> >>>>>> Do you have a short doIt to load these samples ?<br>
> >>>>>> I'm not sure how you set it up.<br>
> >>>>>> A quick look at aiffloop.txt I see this:<br>
> >>>>>> LoopedSampledSound>>samples:loopEnd:loopLength:pitch:samplingRate:<br>
> >>>>>>        Receiver: a LoopedSampledSound<br>
> >>>>>>        Arguments and temporary variables:<br>
> >>>>>>                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...<br>
> >>>>>>                loopEndIndex:   0<br>
> >>>>>>                loopSampleCount:        -44100<br>
> >>>>>><br>
> >>>>>> So there will probably be issues with negative number of samples in the loop<br>
> >>>>>><br>
> >>>>>> Best,<br>
> >>>>>> Karl<br>
> >>>>>><br>
> >>>>>><br>
> >>>>>> On Sat, Feb 5, 2022 at 2:46 AM David O'Toole <<a href="mailto:deeteeoh1138@gmail.com" target="_blank">deeteeoh1138@gmail.com</a>><br>
> >>>>>> wrote:<br>
> >>>>>><br>
> >>>>>>> (Apologies if this is a double post, I think the other will be<br>
> >>>>>>> rejected on account of the 2+MB AIFF file I attached. Instead I've put up a<br>
> >>>>>>> Zip file of the AIFFs I'm trying to import, on GDrive:<br>
> >>>>>>> <a href="https://drive.google.com/file/d/16BvtxS9tkIPJRcx-cri1gPGM5p0E7uV_/view?usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/file/d/16BvtxS9tkIPJRcx-cri1gPGM5p0E7uV_/view?usp=sharing</a><br>
> >>>>>>><br>
> >>>>>>> Original message:<br>
> >>>>>>><br>
> >>>>>>> I have AIFF files with loop points all set the same, beginning at<br>
> >>>>>>> sample 44100 and ending at 88200. I am trying to use<br>
> >>>>>>> SampledInstrument(class)>>#readSimpleInstrument:fromDirectory: to create a<br>
> >>>>>>> sampled instrument.<br>
> >>>>>>><br>
> >>>>>>> In Snd i can verify the loop points are correct:<br>
> >>>>>>><br>
> >>>>>>> > >(sound-loop-info (open-sound "~/sessions/orch.mosaic/cello<br>
> >>>>>>> f/36.aif"))<br>
> >>>>>>> (44100 88200 0 0 0 0 1 1)<br>
> >>>>>>><br>
> >>>>>>> But as you can see in the bug report/screenshot, the end point<br>
> >>>>>>> becomes 0 somehow when it reaches note 36.aif, resulting in an error. I've<br>
> >>>>>>> also included the offending .aif file, which might be malformed in some way<br>
> >>>>>>> I haven't discovered.<br>
> >>>>>>><br>
> >>>>>>> How might I go about debugging this further?<br>
> >>>>>>><br>
> >>>>>>><br>
> >>>>>><br>
> >>>>><br>
> >>>><br>
> >>><br>
> >><br>
<br>
> <br>
<br>
<br>
</blockquote></div>