ModPlug Central

OpenMPT Development (Archive) => Bug Reports => Bug Report Archive => Topic started by: torvus on April 04, 2006, 22:46:24

Title: .41 Change instrument in patternview
Post by: torvus on April 04, 2006, 22:46:24
when i want to change instrument it changes the instrument just there where is note before instrument.
btw off topic:i liked the old change instrument option (whitch is in the stable wersions)


Edit by mod:Changed topic title conform rules
Title: .41 Change instrument in patternview
Post by: anboi on April 04, 2006, 22:52:54
yeah, this caught me out too. (in pattern editor using change instrument command does not change the instrument on rows where there is an instrument number and volume data but no note data. )
Title: Re: (S=O) .41 Change instrument in patternview
Post by: Relabsoluness on April 05, 2006, 18:39:10
Sorry about that, but good that you brought this up. The reason why the behavior was changed in the first place was that with the 'old' way, if you had notes with no instrument, 'change instrument' couldn't be used to set instrument on those notes, so instrument data had to be entered manually, or? But then again I don't know why I had to destroy the original way with it - obviously because I didn't see the idea :) - could you enlighten me when one has to change instrument data to modcommand with no note data?
Title: .41 Change instrument in patternview
Post by: rewbs on April 05, 2006, 20:00:44
Relabsoluness, if no note is specified but there is an instrument value, the last note played in that channel will be used. This kind of behaviour is inherited from the old days when every byte saved in the pattern data counted. Nowadays I think people use it just cos they've got used to it.

I don't think the change in behaviour is due to your code. It was probably introduced when I rewrote CViewPattern::OnSetSelInstrument(). The fix would be:


//if (p->note && p->instr != (BYTE)nIns)
if (p->instr && p->instr != (BYTE)nIns)
Title: .41 Change instrument in patternview
Post by: speed-goddamn-focus on April 05, 2006, 21:25:39
If my memory serves me correctly, using instrument number without note data would reset the volume to the default. At least for .mod:s.
Title: .41 Change instrument in patternview
Post by: Waxhead on April 05, 2006, 21:37:15
Quote from: "speed-goddamn-focus"If my memory serves me correctly, using instrument number without note data would reset the volume to the default. At least for .mod:s.

You are correct. At least this is true for ProTracker V2.3a ;) (just tested)
Title: .41 Change instrument in patternview
Post by: LPChip on April 05, 2006, 22:30:12
Yes, it also works that way in IT files in Impulse Tracker, so probably aswell in s3m, and xm.

In fact, The tone height (C-4) without instrument number doesn't reset the note.
Title: .41 Change instrument in patternview
Post by: rewbs on April 06, 2006, 01:15:59
Quote from: "Waxhead"
Quote from: "speed-goddamn-focus"If my memory serves me correctly, using instrument number without note data would reset the volume to the default. At least for .mod:s.

You are correct. At least this is true for ProTracker V2.3a ;) (just tested)

Yes sorry, you're right. In OpenMPT, in the following example, if sample 01 is still playing by row 4, then it will continue to play with its volume reset to default. But if the end of the sample was reached before row 4, it will play again at row 4 from the start. Is that second statement in line with other players?
|C-401v16...
|...........
|...........
|...........
|...01......
|...........
|...........
Title: .41 Change instrument in patternview
Post by: Waxhead on April 06, 2006, 16:26:10
Quote from: "rewbs"
... if the end of the sample was reached before row 4, it will play again at row 4 from the start. Is that second statement in line with other players?
|C-401v16...
|...........
|...........
|...........
|...01......
|...........
|...........

For ProTracker - A samplenumber does not start a new sample without the notedata.
Title: .41 Change instrument in patternview
Post by: Relabsoluness on April 06, 2006, 20:55:01
Thanks for the information concerning the meaning of missing note-thing.

Quote from: "rewbs"
I don't think the change in behaviour is due to your code. It was probably introduced when I rewrote CViewPattern::OnSetSelInstrument().
Actually not, see the difference between version .33 and .34 if you don't believe me :) (the fix code in your post was exactly the way it was in RC2)
Title: .41 Change instrument in patternview
Post by: rewbs on April 11, 2006, 18:48:27
Ok.. in fact, shen setting the instrument for a selection in the pattern editor:
  - We obviously want to change the instrument if there's both a note and an intrument on the selected row.
  - We also want to change the instrument in the case where there is just an instrument on the row.
  - Furthermore, we want to set the instrument in the case were there's just a note on the row.
  - But we don't want to set the instrument in rows where there's no note and no intrument, otherwise we add a load of crap in the selection where there should be "silence".

So I propose:
// If a note or an instr is present on the row, do the change, if required.
// Do not set instr if note and instr are both blank.
if ( (p->note||p->instr) && (p->instr!=nIns) ) {
p->instr = nIns;
bModified = TRUE;
}
...


Quote from: "Waxhead"For ProTracker - A samplenumber does not start a new sample without the notedata.
Waxhead, thanks - in fact OpenMPT only does that when playing an IT, so all is well. :D
Title: .41 Change instrument in patternview
Post by: rewbs on April 11, 2006, 23:49:19
Solution described above  in v1.17.02.42.
Title: .41 Change instrument in patternview
Post by: torvus on April 13, 2006, 14:58:06
ok now it works  :wink:
Title: .41 Change instrument in patternview
Post by: LPChip on April 13, 2006, 15:03:24
Quote from: "torvus"ok now it works  :wink:

Thanks Torvus, for letting us know.

Closing this one.
Title: .41 Change instrument in patternview
Post by: speed-goddamn-focus on May 17, 2006, 22:58:08
Quote from: "rewbs"
Quote from: "Waxhead"For ProTracker - A samplenumber does not start a new sample without the notedata.
Waxhead, thanks - in fact OpenMPT only does that when playing an IT, so all is well. :D
Are you sure this is the correct behavior for ITs? I'm pretty sure this has never been the behaviour of MPT in IT mode.