Author Topic: Allowing 'Bypass Plugin' via PCE - possible feature request?  (Read 21599 times)

Offline christofori

  • Workaholic artist
  • ***
  • Posts: 124
  • Gender: Male
  • christofori -aKa- Chris Molyneux
    • christofori's official web site
  • Operating System: Windows 7 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #15 on: June 22, 2011, 01:00:25 »
I wouldn't say that the code is similar to something that someone who has used BASIC (like me) or Pascal for a long time might be accustomed to or could have written. On the contrary, it's just full to the brim with pointers, macros and old-fashioned code structures, and the latter is what has spawned many redundant pieces of code, or simply code that runs fast but is hard to understand.

Old-fashioned code structures... The structure is exactly what I was talking about.. or moreover, the lack of "readable" structure that existed a while ago, before they wanted to put forth effort to train programmers to make code more readable, anyway.

I'm not thinking I'll be able to come in and clean up the code, now.. lol.. your example was time well spent.  But I might still play with it and customize it somewhat. ;)  Only problem in doing that is if I did come up with a good bit of code I ended up using (dare I say relying upon..?), I'd have to then re-implement it each time a new build came out (or submit it to you for inclusion I suppose, do you ever incorporate user-submitted code bits [FE features]?)
/christofori
'slightly disturbed and wonderfully content'
*Master of the Obvious*

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,312
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #16 on: June 22, 2011, 09:03:53 »
ers to make code more readable, anyway.
Let me tell you one thing, many parts of the code are unreadable if you don't spend some time figuring out what they do. :D And once you've understood them, you can often easily replace them by something more readble (or maybe just add a comment on what the code does).

do you ever incorporate user-submitted code bits [FE features]?
No, because there aren't any. :D Well, the last patch from outside the development team was from kode54 I think, and I gladly incorporated his fixes - everyone is welcome to make changes to the code and send them to us!
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline christofori

  • Workaholic artist
  • ***
  • Posts: 124
  • Gender: Male
  • christofori -aKa- Chris Molyneux
    • christofori's official web site
  • Operating System: Windows 7 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #17 on: June 22, 2011, 09:12:58 »
Noted for (possible) future development...  8)
/christofori
'slightly disturbed and wonderfully content'
*Master of the Obvious*

Offline Rakib

  • Crazy artist
  • ****
  • Posts: 913
  • Operating System: win7x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #18 on: June 22, 2011, 12:07:51 »
Are you sure, I know Pelya made a vsti version of modplug and he also did sync with video thingy. I dont think that that has been incorporated in todays build.
^^

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,312
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #19 on: June 22, 2011, 13:42:38 »
Uhm, so what? The VSTi patch was experimental and a dirty hack - and AFAIK pelya didn't submit it as an official patch (I wouldn't have done that, either). Some of his other patches have made it into codebase, though.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline christofori

  • Workaholic artist
  • ***
  • Posts: 124
  • Gender: Male
  • christofori -aKa- Chris Molyneux
    • christofori's official web site
  • Operating System: Windows 7 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #20 on: June 23, 2011, 06:35:22 »
An idea that'll probably never be implemented as most don't use this setup (yet... I believe it will become more common than it is today..) -- support for multiple monitors for OMPT content (I know you can move VST(i)'s... I'm talking about sample/instrument/pattern/general tidbits -- being able to see it all, baby!)... but after having read some about the GUI in various snippits from past dev conversations (maybe some from the issue tracker.. hard to remember where I found 'em now..), I know... I know.  I can dream..! :D

But, this all goes to reinforce why I've quit submitting issue tickets without checking around a lot more, first.. and then even posting here for debate first.  Because of course, what I might think of as a 'must-have' most others might care less for..! :P  At any rate, I figured there was no need to add clutter to the IT.
/christofori
'slightly disturbed and wonderfully content'
*Master of the Obvious*

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,312
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #21 on: June 23, 2011, 11:19:20 »
Try Window -> New Window. I think this is what you want.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,146
  • Gender: Male
  • Operating System: Windows XP
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #22 on: June 23, 2011, 13:55:19 »
(*) Here's a nice riddle for you: What does the following code do (m is a pattern cell)?

Code: [Select]
if ((!*((LPDWORD)m)) && (!*(((LPWORD)m)+2)))

Well, i understand the syntax, the vocabulary, but i often have trouble interpreting what it's trying to do...

Let's see...
Take the value of m as a DWORD pointer (in its DWORD-length memory location) and compare the bits (AND) with the value of m's WORD-length pointer plus 2, if they're the same...

Is that close? I forget what the exclamation point is for (if i know at all), and that may have a drastic effect on the interpretation...

That statement is exactly why i didn't what to mess with the code, i barely have a clue what's going on from one line to the next. I started creating a REM-happy version of the code with each line put in plain English, but i kept getting stuck on lines like that one.

I'm secretly hoping that one day before the code gets too obsolete, you'll refactor everything into something so clear i can actually do something with it...

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,312
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #23 on: June 23, 2011, 14:05:12 »
You've gotten pretty close actually! The && is not a logical AND, though, so the two statements are not compared or anything - the code is only executed if both are true.

Let's take a closer look...
(LPDWORD)m - Reinterpret the mod command pointer as a DWORD (32-bit integer) pointer
*(LPDWORD)m - Dereference the pointer, i.e. look at the DWORD value at the given address
!*((LPDWORD)m - Check if that DWORD value is 0

(LPWORD)m - Reinterpret the mod command pointer as a WORD (16-bit integer) pointer
((LPWORD)m)+2 - Skip two WORDs (i.e. 4 bytes)
*(((LPWORD)m)+2) - Dereference the pointer, i.e. look at the WORD value at the given address
!*(((LPWORD)m)+2) - Check if that WORD value is 0

In other words, this code check if 6 consecutive bytes (that's the size of a pattern cell) at address m are zero. After refactoring, it looks like this:

Code: [Select]
if(m->Empty())
;D
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,146
  • Gender: Male
  • Operating System: Windows XP
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #24 on: June 23, 2011, 15:03:54 »
That's right! The exclamation point is the NOT operator!
 
Your final code is what is needed throughout. It's so elegant! ;)
 
BTW: Is/was that snippet really present in the code? Why do you figure it was originally written in longhand like that? Any guesses?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,312
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #25 on: June 23, 2011, 15:13:32 »
Is/was that snippet really present in the code?
Yes.

And why it was used? I'm sure Olivier wanted to be efficient (this is probably even faster than a memcmp() call), and he was the only person working on the code, so if he understood it, it was fine. Remember that most of the old code was not strictly object-oriented, so object functions like MODCOMMAND::Empty() didn't even exist in the old code.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,122
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #26 on: June 23, 2011, 16:13:22 »
Code: [Select]
if(m->Empty())

Now that part I understand. It questions itself and then makes M empty! Yeah, that must be it. :nuts:
"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 christofori

  • Workaholic artist
  • ***
  • Posts: 124
  • Gender: Male
  • christofori -aKa- Chris Molyneux
    • christofori's official web site
  • Operating System: Windows 7 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #27 on: June 24, 2011, 13:28:47 »
Try Window -> New Window. I think this is what you want.

Sorta; although you cannot move any of the windows outside of the main OpenMPT application window (which was the goal of the comment, being that multiple monitors were mentioned) and onto another physical screen.  Part of the functionality is there already as you point out, since one is able to split the existing display and arrange the parts as desired; but this assumes one has a rather large monitor (well, someone with a LCDTV as one perhaps would work..) to be able to see portions that were useful... if you can't see but a fraction as your screen is too small however, it doesn't do any good.
/christofori
'slightly disturbed and wonderfully content'
*Master of the Obvious*

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,146
  • Gender: Male
  • Operating System: Windows XP
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #28 on: June 27, 2011, 20:33:38 »
Actually, this brings up an interesting question, since you're working with more than one monitor...
 
Are you able to stretch ModPlug's window over into more than one monitor? This could definitely expand MultiView's functionality (multiple windows of the same track)...and i'd like to mention the possibilities in the OHM...

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,122
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
Re: Allowing 'Bypass Plugin' via PCE - possible feature request?
« Reply #29 on: June 27, 2011, 22:56:07 »
Actually, this brings up an interesting question, since you're working with more than one monitor...
 
Are you able to stretch ModPlug's window over into more than one monitor? This could definitely expand MultiView's functionality (multiple windows of the same track)...and i'd like to mention the possibilities in the OHM...
Its windows. Any window that you can resize, can be moved to several monitors at the same time, so yes.

There are programs and drivers that allow you to create one huge desktop made out of more displays. If you have this kind of setup, maximize will actually put the screen on both windows automatically.
"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