Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!orion.oac.uci.edu!cerritos.edu!arizona.edu!soliton!zazula From: zazula@soliton.uucp (Ralph Zazula) Newsgroups: comp.sys.next Subject: Bug in MusickKit????? (ScorePerformer) Message-ID: <1991Jun11.112010.781@arizona.edu> Date: 11 Jun 91 18:20:09 GMT Distribution: world,local Organization: University of Arizona, Tucson AZ Lines: 57 Nntp-Posting-Host: soliton.physics.arizona.edu I was having a bunch of problems with the setScore: method of the ScorePerformer class. It seems that the PartPerformers of the ScorePerformer DO NOT get updated if you do a setScore: with a modified version of a previously used score. For example : id myScore; id myScorePerformer; myScore = [[Score alloc] init]; myScorePerformer = [[ScorePerformer alloc] init]; [myScore readMidifile:"file_with_2_parts.midi"]; [myScorePerformer setScore:myScore]; // ... play the score ... [myScore readMidifile:"file_with_5_parts.midi"]; [myScorePerformer setScore:myScore]; Now, I look in AppInspector and see that the PartPerformer list for myScorePerformer still only has 2 parts in it, NOT 5. The setScore: method says: " The PartPerformers from a previously set Score (if any) are first removed and freed.". It seems like I have 2 options, free the Score every time _or_ free the ScorePerformer every time (I've tried the latter). Okay, I just tried manually freeing all of the PartPerformers ie. [myScorePerformer freePartPerformers]; instead of: [myScorePerformer free]; myScorePerformer = [[ScorePerformer alloc] init]; // again... This worked too. So, does this make sense? It appears that the above quote only applies to a new Score *instance* instead of a new Score (in the music sense). This is bad! One shouldn't have to free the ScorePerformer instance just to register an update in the Score!!!!!!!!!!!!!!! Well, I only wasted about 6 hours on this... I should have gotten AppInspector out much earlier... It's in my dock now :-) Ralph |----------------------------------------------------------------------| | Ralph Zazula "Computer Addict!" | | University of Arizona --- Department of Physics | | UAZHEP::ZAZULA (DecNet/HEPNet) | | zazula@uazhe0.physics.arizona.edu (Internet) | |----------------------------------------------------------------------| | "You can twist perceptions, reality won't budge." - Neil Peart | |----------------------------------------------------------------------|