.41 Change instrument in patternview

Started by torvus, April 04, 2006, 22:46:24

Previous topic - Next topic

torvus

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

anboi

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. )

Relabsoluness

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?

rewbs

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)

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.

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)

LPChip

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.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

rewbs

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......
|...........
|...........

Waxhead

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.

Relabsoluness

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)

rewbs

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

rewbs

Solution described above  in v1.17.02.42.

torvus


LPChip

Quote from: "torvus"ok now it works  :wink:

Thanks Torvus, for letting us know.

Closing this one.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

speed-goddamn-focus

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.