COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 01-13-2010, 10:41 AM   #1
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,964
Default My first IPlug: Combo Model V

Hi all,

I have just released a sneak preview of my first real IPlug project. It is a transistor organ simulation called Combo Model V. Although it has only a very basic GUI (for now anyway), it does feature stepped sliders (drawbars) and a keyboard:



My project is not open source (sorry!), but if anyone is interested I am willing to share the IPlug related stuff; just ask.

If you want to give the VSTi a try you can download the DLL from my company's website:
http://www.martinic.com/combov/
__________________
Martinic Scanner Vibrato - Elka Panther - Tale's JSFX Pack - WDL.git

Last edited by Tale; 04-28-2010 at 03:22 PM. Reason: Fixed broken image
Tale is offline   Reply With Quote
Old 01-16-2010, 01:23 AM   #2
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Quote:
Originally Posted by Tale View Post
My project is not open source (sorry!), but if anyone is interested I am willing to share the IPlug related stuff; just ask.
What did you add? I'm always interested in IPlug related stuff!
cc_ is offline   Reply With Quote
Old 01-18-2010, 02:13 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,964
Default IDrawbarControl

Here's my organ drawbar control. It's a reversed vertical fader with 9 discrete steps (0..8). You can drag its handle/tip to move the drawbar, or you can click on the numbers (usually) displayed on the drawbar itself.

Code:
// Handles the GUI control for the drawbars. The value for len is the height
// of the drawbar, *not* including the tip/handle.

class IDrawbarControl: public IControl
{
public:
	IDrawbarControl(IPlugBase* pPlug, int x, int y, int len, int paramIdx, IBitmap* pBitmap): IControl(pPlug, &IRECT(x, y, x + pBitmap->W, y + pBitmap->H), paramIdx),
		mLen(len), mBitmap(*pBitmap) {}
	~IDrawbarControl() {}

	void OnMouseDown(int x, int y, IMouseMod* pMod)
	{
		if (pMod->R)
		{
			PromptUserInput();
			return;
		}

		y -= mRECT.T;
		if (y < int(mValue * (double)mLen))
		{
			mValue = mValue - floor((double)y / (double)mLen / 0.125) * 0.125;
			SetDirty();	
		}
	}

	void OnMouseDrag(int x, int y, int dX, int dY, IMouseMod* pMod)
	{
		mValue += (double)dY / (double)mLen;
		SetDirty();
	}

	bool Draw(IGraphics* pGraphics)
	{
		return pGraphics->DrawBitmap(&mBitmap, &mRECT, 0, int((1. - floor(mValue / 0.125 + 0.5) * 0.125) * (double)mLen), &mBlend);
	}

protected:
	int mLen;
	IBitmap mBitmap;
};
You should feed this control a single bitmap which contains the drawbar including the handle. You'll need to specify the length (height) of the drawbar (without the handle) when you attach it to the plug's GUI:

Code:
MyPlug::MyPlug(IPlugInstanceInfo instanceInfo): IPLUG_CTOR(kNumParams, 0, instanceInfo)
{
	...

	int width = 500, height = 426;
	IGraphics* pGraphics = MakeGraphics(this, width, height);

	// Add drawbar control
	IBitmap bitmap = pGraphics->LoadIBitmap(DRAWBAR_ID, DRAWBAR_FN);
	int x = 48, y = 86;
	int len = 62;
	pGraphics->AttachControl(new IDrawbarControl(this, x, y, len, kMyDrawbar,  &bitmap));

	AttachGraphics(pGraphics);

	...
}
I will also post my keyboard control, but not right now as I really need to get some work done.
__________________
Martinic Scanner Vibrato - Elka Panther - Tale's JSFX Pack - WDL.git
Tale is offline   Reply With Quote
Old 01-19-2010, 01:12 AM   #4
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Cool, I don't think I'll be using the drawbar any time soon, but a keyboard would be useful...
cc_ is offline   Reply With Quote
Old 01-19-2010, 01:49 AM   #5
yhertogh
Human being with feelings
 
yhertogh's Avatar
 
Join Date: Nov 2006
Location: Belgium
Posts: 1,461
Default

cool plug-in.

I hit the random key and i got instant B-52's :-D

Yves
yhertogh is offline   Reply With Quote
Old 01-19-2010, 03:28 AM   #6
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
Default

Awesome! Thank you very much for that control, I just started writing my first synth (only fx before... and mostly dynamics processing) which is... a drawbar organ!
l0calh05t is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.