Author Topic: .41 Change instrument in patternview  (Read 10056 times)

Offline torvus

  • Shy artist
  • Posts: 8
    • http://dhost.info/torvus/
.41 Change instrument in patternview
« 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

Offline anboi

  • Inspired artist
  • **
  • Posts: 94
    • http://greenbank.zombierobotsfromouterspace.com/
.41 Change instrument in patternview
« Reply #1 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. )

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 709
Re: (S=O) .41 Change instrument in patternview
« Reply #2 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?

Offline rewbs

  • OpenMPT Developers
  • *****
  • Posts: 578
.41 Change instrument in patternview
« Reply #3 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:

Code: [Select]

//if (p->note && p->instr != (BYTE)nIns)
if (p->instr && p->instr != (BYTE)nIns)

Offline speed-goddamn-focus

  • Crazy artist
  • ****
  • Posts: 689
.41 Change instrument in patternview
« Reply #4 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.

Offline Waxhead

  • Workaholic artist
  • ***
  • Posts: 251
  • Gender: Male
    • http://www.dirtcellar.net
  • Operating System: WinXP , Linux
.41 Change instrument in patternview
« Reply #5 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)

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,065
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
.41 Change instrument in patternview
« Reply #6 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.
"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

Offline rewbs

  • OpenMPT Developers
  • *****
  • Posts: 578
.41 Change instrument in patternview
« Reply #7 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?
Code: [Select]
|C-401v16...
|...........
|...........
|...........
|...01......
|...........
|...........

Offline Waxhead

  • Workaholic artist
  • ***
  • Posts: 251
  • Gender: Male
    • http://www.dirtcellar.net
  • Operating System: WinXP , Linux
.41 Change instrument in patternview
« Reply #8 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?
Code: [Select]
|C-401v16...
|...........
|...........
|...........
|...01......
|...........
|...........


For ProTracker - A samplenumber does not start a new sample without the notedata.

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 709
.41 Change instrument in patternview
« Reply #9 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)

Offline rewbs

  • OpenMPT Developers
  • *****
  • Posts: 578
.41 Change instrument in patternview
« Reply #10 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:
Code: [Select]
// 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

Offline rewbs

  • OpenMPT Developers
  • *****
  • Posts: 578
.41 Change instrument in patternview
« Reply #11 on: April 11, 2006, 23:49:19 »
Solution described above  in v1.17.02.42.

Offline torvus

  • Shy artist
  • Posts: 8
    • http://dhost.info/torvus/
.41 Change instrument in patternview
« Reply #12 on: April 13, 2006, 14:58:06 »
ok now it works  :wink:

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,065
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
.41 Change instrument in patternview
« Reply #13 on: April 13, 2006, 15:03:24 »
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

Offline speed-goddamn-focus

  • Crazy artist
  • ****
  • Posts: 689
.41 Change instrument in patternview
« Reply #14 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.