Is it possible to open two instances of Synthesia at the same time?

Have questions? Just saying hello? This is the place.
No explicit, hateful, or hurtful language. Nothing illegal.
Post Reply
Pure1108
Posts: 19

Post by Pure1108 »

I have two midi files that I'd like to compare side-by-side on my dual monitors - is there a way to open two instances of Synthesia at the same time?
Nicholas
Posts: 13170

Post by Nicholas »

There isn't a way to open two instances today. We specifically guard against it because it's dangerous to the data files: Synthesia writes all its data just as the app is closing. So whichever window is closed last would "win" and overwrite any new/changed information from the other window's data. Worse: if you closed them at roughly the same time, they might step on each other's toes and arbitrarily be denied access to some of the files or--in the worst case--introduce a bit of inconsistency (or even corruption) where one instance writes to certain files and the other instance is allowed to write to others.

As I start migrating Synthesia's data files over to something more robust (a SQLite database with the WAL-mode enabled), all of these problems disappear. Data will be written as it is changed so a crash doesn't lose anything. The format is inherently more robust against corruption. Everything will be transaction-based so multiple instances shouldn't be able to step on each other's toes.

I hadn't considered that we'd be able to relax the multiple-instances restriction afterward, but thinking about it just now, it should be safe to do.
Pure1108
Posts: 19

Post by Pure1108 »

Many thanks Nick, this is very informative :D
Piotr Barcz
Posts: 5

Post by Piotr Barcz »

I've had two windows of Synthesia open by some miracle, I think it was because my computer had just started and everything was a bit laggy, then I clicked on the synthesia app button a ton of times and I opened two windows
Pure1108 wrote: 10-06-21 5:40 am I have two midi files that I'd like to compare side-by-side on my dual monitors - is there a way to open two instances of Synthesia at the same time?
Why don't you download Piano From Above and use that as the second program? It's definitely nowhere close to Synthesia quality but it's free (I think Brian Pantano wanted a free synthesia alternative or he just made it because he wanted to join in the popularity of this type of software)

Anyway, you could use that as the second visualizer.
Nicholas
Posts: 13170

Post by Nicholas »

Piotr Barcz wrote: 10-21-21 9:34 am... but it's free (I think Brian Pantano wanted a free synthesia alternative or he just made it because he wanted to join in the popularity of this type of software)
It wasn't originally free and his reasoning for making it can be found at the bottom of this page. :lol:
diggidoyo
Posts: 13

Post by diggidoyo »

Piotr Barcz wrote: 10-21-21 9:34 am I've had two windows of Synthesia open by some miracle, I think it was because my computer had just started and everything was a bit laggy, then I clicked on the synthesia app button a ton of times and I opened two windows
I've noticed this, as well.
When Chrome starts acting up and using a lot of memory, if I'm a tad overeager on getting Synthesia to start, I have accidentally been able to get as many as three instances fully running and accepting input, at least until one inevitably crashes.
I actually like this dual screen display to see the free play chord names alongside the lesson, so it would be really helpful if this feature was an option.

Image
Image
Image
Nicholas
Posts: 13170

Post by Nicholas »

That's... something special. How strange!

I was under the impression that the mechanism I was using (Windows' system-wide, global mutexes) should have been able to prevent that. Back to the drawing board, I guess. :grimace:
Nicholas
Posts: 13170

Post by Nicholas »

I found it. If the time between launching the app and the window actually appearing was longer than four seconds or so, there was a loophole in my code that would allow more than one instance to start.

That is consistent with your description of a system under heavy load during start-up.

I just fixed it for the 10.10 release.
Post Reply