Jump to content


Photo

Instantiate Failed (Magicmatch)


  • Please log in to reply
9 replies to this topic

#1 supersole

supersole

    Member

  • Normal Members
  • PipPip
  • 59 posts
  • Gender:Female
  • Location:London
  • Interests:Tracked music!!

Posted 04 February 2010 - 14:41

Last year I began tinkering with software synths... i.e. I developed a little synth in C, and used it for a rudimentary 64k intro (details here: http://soledadpenade...ne/to_the_beat/ )

But the Impulse Tracker exporter was a little limited, I couldn't adjust the parameters of the synth on the fly and it was very tedious to get the sound I wanted.

I am now developing "V2" of this synth, will now use C++ instead of C and I have thought I'll "embed" it into a VST instrument so that I can play with all the parameters on the fly, build the whole song in renoise using my synth and then export it to my demo format with an exporter I'll build later.

I was planning on using Renoise since it's the only VST host that works for me and my system (linux), plus it saves a Song.xml file that I can parse ;)

But I'm getting some problems and since there are several vst linux developers round here, I thought it could be a good idea to ask for help here.

The main problem I'm getting now is this error in Renoise's log:

VstPlugs: Trying to instantiate /home/sole/.vst/sorollet_vst.so
VstPlugs: Instantiate FAILED (MagicMatch) !!!

I don't know if that could be something related to my setup... It is somehow awkward: Ubuntu 64 bit, but I am building the plugin in 32bit (anyway, until I didn't build it with 32 bit, renoise wouldn't even try to load it).

Or maybe it is something else I have done, it's not like there's a lot of docs about vst synth dev in linux... :D

Maybe Renoise team members know what that message means... hope they don't mind telling me!

Thanks :lol:
renoise + linux + edirol pcrm50 + edirol ma-7a + yamaha pacifica + whatnot...

supersole.net | soundcloud | bandcamp

#2 taktik

taktik

    Renoise Developer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 15040 posts
  • Gender:Male
  • Location:Berlin, Germany
  • Interests:füße waschen

Posted 04 February 2010 - 17:25

MagicMatch: calling the main vst function returns an invalid AEffect or AEffect.magic != 'VstP'

#3 supersole

supersole

    Member

  • Normal Members
  • PipPip
  • 59 posts
  • Gender:Female
  • Location:London
  • Interests:Tracked music!!

Posted 04 February 2010 - 23:54

Thanks TakTik!

I wasn't returning the instance of the plugin properly... had done a mess with includes and the "main" function which has to be recreated in a magic way in linux and blablah.

Now it loads but it's crashing somewhere else (I'm getting a superdreadful error message which says the plugin crashed in VST event/function 'Dispatch').

It's being quite a bumpy road but I think I'll get to grips with this, one way or the other.

I wonder how do people debug VST's... But I guess this isn't the forum for this. Now back to work. Thanks again! :yeah:
renoise + linux + edirol pcrm50 + edirol ma-7a + yamaha pacifica + whatnot...

supersole.net | soundcloud | bandcamp

#4 taktik

taktik

    Renoise Developer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 15040 posts
  • Gender:Male
  • Location:Berlin, Germany
  • Interests:füße waschen

Posted 05 February 2010 - 00:29

Thanks TakTik!

I wasn't returning the instance of the plugin properly... had done a mess with includes and the "main" function which has to be recreated in a magic way in linux and blablah.

Now it loads but it's crashing somewhere else (I'm getting a superdreadful error message which says the plugin crashed in VST event/function 'Dispatch').

It's being quite a bumpy road but I think I'll get to grips with this, one way or the other.

I wonder how do people debug VST's... But I guess this isn't the forum for this. Now back to work. Thanks again! :yeah:


gdb PATH_TO/renoise
load the plugin in Renoise
when you build your so with debug info, gdb will load and use it...

#5 supersole

supersole

    Member

  • Normal Members
  • PipPip
  • 59 posts
  • Gender:Female
  • Location:London
  • Interests:Tracked music!!

Posted 05 February 2010 - 01:18

Oh thanks again taktik. You're great :)

I tried this but for some reason gdb just spits an strange error in my main system (x64). I have searched for more info about it (googled) but it seems to be happening in 64bit systems only:

Renoise LOG> System: Failed to create a RT thread. Trying again as FIFO thread on process scope...
/build/buildd/gdb-7.0/gdb/infrun.c:2455: internal-error: handle_inferior_event: Assertion `inf' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

/build/buildd/gdb-7.0/gdb/infrun.c:2455: internal-error: handle_inferior_event: Assertion `inf' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Renoise LOG> CrashLog: [0xf7773400]
Renoise LOG> CrashLog: [(nil)]

But I tried the same thing in a VirtualBox-ed ubuntu 32 bit and it works, and I could find the error. So it's going to be slow as hell to debug, I'll have to be supercareful x)
renoise + linux + edirol pcrm50 + edirol ma-7a + yamaha pacifica + whatnot...

supersole.net | soundcloud | bandcamp

#6 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2987 posts
  • Gender:Not Telling
  • Interests:macOS fanboying

Posted 04 April 2017 - 13:02

What does this error mean:

VstPlugs: Plugin is a Mach-O executable...
VstPlugs: Instantiate FAILED (MagicMatch failed - is no VST Plugin) !!!
VstPlugs: CreateInstance FAILED

Any idea? It loads in Bitwig...


MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)


#7 4Tey

4Tey

    Chief Above Chief Member

  • Normal Members
  • PipPipPipPipPipPip
  • 384 posts
  • Gender:Male

Posted 04 April 2017 - 14:36

Hmm.  TakTik above said...

 

MagicMatch: calling the main vst function returns an invalid AEffect or AEffect.magic != 'VstP'

In other words, when the vst is instanced from its VSTMain function it should return a valid pointer to a AEffect structure.  See http://ygrabit.stein...ude/AEffect.h  In that file you will see the lines...

#define kEffectMagic CCONST ('V', 's', 't', 'P')


//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------

struct AEffect
{
	long magic;			// must be kEffectMagic ('VstP')
	long (VSTCALLBACK *dispatcher)(AEffect *effect, long opCode, long index, long value,
		void *ptr, float opt);
	void (VSTCALLBACK *process)(AEffect *effect, float **inputs, float **outputs, long sampleframes);
	void (VSTCALLBACK *setParameter)(AEffect *effect, long index, float parameter);
	float (VSTCALLBACK *getParameter)(AEffect *effect, long index);

	long numPrograms;
	long numParams;		// all programs are assumed to have numParams parameters
	long numInputs;		//
	long numOutputs;	//
	long flags;			// see constants
	long resvd1;		// reserved, must be 0
	long resvd2;		// reserved, must be 0
	long initialDelay;	// for algorithms which need input in the first place
	long realQualities;	// number of realtime qualities (0: realtime)
	long offQualities;	// number of offline qualities (0: realtime only)
	float ioRatio;		// input samplerate to output samplerate ratio, not used yet
	void *object;		// for class access (see AudioEffect.hpp), MUST be 0 else!
	void *user;			// user access
	long uniqueID;		// pls choose 4 character as unique as possible.
						// this is used to identify an effect for save+load
	long version;		//
	void (VSTCALLBACK *processReplacing)(AEffect *effect, float **inputs, float **outputs, long sampleframes);
	char future[60];	// pls zero
};

That 'long magic' entry in that structure must contain the bytes 'VstP' for it to be considered a valid pointer to the structure (hence the term 'MagicMatch').  If it works in Bitwig however they could be ignoring the check of the magic entry in the structure?  They could assume they have a valid AEffect pointer so long as it is not null.  But that is very very very speculative on my part.

 

Worth probably checking if the vst loads in other hosts?


Edited by 4Tey, 04 April 2017 - 14:40.

  • ffx likes this

#8 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2987 posts
  • Gender:Not Telling
  • Interests:macOS fanboying

Posted 04 April 2017 - 16:34

Thanks, still wonder, because after 10.9->10.12.4 upgrade, Korg Wavestation refuses to load as VST in Renoise, but component still works. The vst also works in bitwig.

 

Any idea maybe? 

 

Is there a way to extract the fxp data from song xml, and put it into the wave station preset dir, hopefully the synth can handle fxp preset loading itself?

 

Seems to be a Sierra/Korg/Renoise problem :)

 

 

EDIT: Uhm btw it would be awesome, if Renoise would make the fxp data accessible in such a case, e.g. a context menu entry "save fxp", so even if the vst does not load, you still can save the preset...   I had quite a bunch of such cases.  Sometimes it was an OS update, sometimes a synth update...


Edited by ffx, 04 April 2017 - 16:40.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)


#9 4Tey

4Tey

    Chief Above Chief Member

  • Normal Members
  • PipPipPipPipPipPip
  • 384 posts
  • Gender:Male

Posted 04 April 2017 - 17:03

 

Is there a way to extract the fxp data from song xml....

The only real thing I can quickly see ffx is that the parameters for a vst are encoded in Base64/CDATA format in the song.xml file.  So you would first have to extract that and convert it into plain ascii.  Then I suppose you would have to add a fxp header to try and recreate a valid fxp file.  There could be other small factors involved as well :)

 

As for the Korg Wavestation loading thing, I agree it's going to be a Sierra/Korg/Renoise problem somewhere ffx :)


  • ffx likes this

#10 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2987 posts
  • Gender:Not Telling
  • Interests:macOS fanboying

Posted 05 April 2017 - 20:32

I found a strange workaround to make Korg Wavestation VST starting again:

 

- Load the Wavestation AU

- Now load your song which uses the Wavestation VST

 

 

Vague explanation: Since the AU version only is a wrapper and also loads the VST version (but here works), the VST is now cached in memory. If you now load the song, the VST will be loaded from cache and that bug preventing the usual loading way will not apply...?


Edited by ffx, 05 April 2017 - 20:34.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)