boscaceoil icon indicating copy to clipboard operation
boscaceoil copied to clipboard

Abandon Adobe AIR and port to Haxe

Open TerryCavanagh opened this issue 8 years ago • 19 comments

This would require a dependency on haxe SiON (https://github.com/gunnbr/SiON), which doesn't currently seem to be being worked on. If that changes, then it would be possible to port Bosca Ceoil to haxe, which would have lots of benefits!

  • Native targets would mean a speed boost on all versions, especially Linux where AIR support has been dropped completely
  • Midi keyboard support might be possible

TerryCavanagh avatar Apr 15 '16 10:04 TerryCavanagh

Please just port to Electron and make the web app in HTML 5

ttofis avatar Feb 22 '17 18:02 ttofis

Gimme a HTML5 port of SiON and then sure, why not?

TerryCavanagh avatar Feb 22 '17 18:02 TerryCavanagh

If I port it, will you do it?

On Wed, 22 Feb 2017, 20:25 Terry Cavanagh, [email protected] wrote:

Gimme a HTML5 port of SiON and then sure, why not?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TerryCavanagh/boscaceoil/issues/47#issuecomment-281756765, or mute the thread https://github.com/notifications/unsubscribe-auth/AISGwAmabbvuDtlbfUw9ErAArGn7Zljnks5rfH1-gaJpZM4IIMZG .

-- -ELChris414

ttofis avatar Feb 22 '17 18:02 ttofis

I'm not personally interested in making a HTML5 version - but if you're able to make a HTML5 version of SiON, then porting Bosca Ceoil won't take you very long... Porting SiON is probably 10 times the work of porting Bosca!

TerryCavanagh avatar Feb 22 '17 19:02 TerryCavanagh

Hahaha ok! First I want to check if a lib I have in mind already covers it's functionality!

On Wed, 22 Feb 2017, 21:00 Terry Cavanagh, [email protected] wrote:

I'm not personally interested in making a HTML5 version - but if you're able to make a HTML5 version of SiON, then porting Bosca Ceoil won't take you very long... Porting SiON is probably 10 times the work of porting Bosca!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TerryCavanagh/boscaceoil/issues/47#issuecomment-281767136, or mute the thread https://github.com/notifications/unsubscribe-auth/AISGwGGHiLSTgAagQrtY1R9E9Rss6Zh2ks5rfIXegaJpZM4IIMZG .

-- -ELChris414

ttofis avatar Feb 22 '17 19:02 ttofis

Using a different lib and completely forking the project is a pretty decent option, to be honest - SiON is a very distinctive sounding synth. Bosca Ceoil wouldn't sound like Bosca Ceoil if it used anything else.

But that doesn't mean that it's not worth exploring. A version of Bosca Ceoil using, say, soundfonts or samples or VST plugins would be kinda awesome.

TerryCavanagh avatar Feb 22 '17 20:02 TerryCavanagh

Java could be an idea. There is a kinda ported version, but I don't believe it works or it is even finished. https://code.google.com/archive/p/sion-java/

ttofis avatar Feb 25 '17 09:02 ttofis

Java's more dead than Flash. Haxe still makes the most sense - that way it'd work natively

TerryCavanagh avatar Feb 25 '17 15:02 TerryCavanagh

any news on this?

Luraktinus avatar Oct 21 '18 15:10 Luraktinus

FWIW, haxe SiON haven't seen a commit in nearly 4 years.

fuzzy76 avatar Oct 23 '18 12:10 fuzzy76

https://tonejs.github.io might be a better fit, though.

fuzzy76 avatar Oct 23 '18 12:10 fuzzy76

Probably. But if you change the underlying synth, Bosca Ceoil doesn't sound like Bosca Ceoil anymore - it sounds like something else. Which is fine! But it should probably be a different project at that point!

TerryCavanagh avatar Oct 23 '18 12:10 TerryCavanagh

@TerryCavanagh, when you have some time, I've started working on a prototype of this and would love to get your feedback.

I started by exploring a Haxe port, which I made some progress on below, although there are still lots of build issues:

  • https://github.com/mtkennerly/boscaceoil/commits/feature/haxe
  • https://github.com/mtkennerly/SiON/commits/bugfix/bosca (forked from gunnbr's fork)

However, I quickly realized that some critical functionality was only available in the Flash target - namely, openfl.media.Sound (replacement for flash.media.Sound) only supports dynamically generated audio when targeting Flash. As far as I can tell, in order to get native builds, you'd have to adjust SiON to integrate with different audio libraries per target, which diminishes the value of Haxe's "write once, run anywhere" goal.

So then I started exploring HTML/JavaScript options. Porting SiON itself would be quite the task, so I decided to experiment with using samples of SiON's instruments with Tone.js, and I think the result is virtually indistinguishable. Take a look:

  • Demo: https://mtkennerly.github.io/bosca-ceoil-js
  • Repository: https://github.com/mtkennerly/bosca-ceoil-js

This demo ~just has one instrument~ (edit: added another 16 :D), but I implemented a full pattern editor and Bosca Ceoil's effects so that you can gauge how faithful it is. The effects aren't 100% identical, but I may be able to get them closer with some tweaking.

How do you feel about this as a direction for Bosca Ceoil? Would you rather it stay a separate project?

mtkennerly avatar Jul 16 '19 08:07 mtkennerly

Wow! I just found this post. @TerryCavanagh , you should have tagged me back in 2016! Yeah, as @mtkennerly discovered, the reason I never did any more work on SiON for Haxe is because Haxe didn't support dynamically generated sound. I did a little work on trying to add that, but then ran out of time and life has been in the way ever since. As far as I know, Haxe still doesn't support dynamically generated sound, so that makes it really limiting for writing synthesizers that work everywhere.

gunnbr avatar Jun 21 '21 15:06 gunnbr

Oh, hello! Ah, that's interesting, and makes a lot of sense.

I'm going to contact to you about email about all this, I have some questions! :)

TerryCavanagh avatar Jun 22 '21 07:06 TerryCavanagh

If anyone is curious (like me) about what's the latest on this in 2023, here's what I could find:

  • SiON needs SampleDataEvent to be supported by OpenFL (for dynamic sound generation).
    • An MR for this https://github.com/openfl/openfl/pull/2515
  • Some people were able to replace SampleDataEvent usage with loadPCMFromByteArray here in OpenFL forums.

akgvn avatar Aug 12 '23 15:08 akgvn

quick update from me too, I suppose - last time I tried to get this working in modern haxe, the html5 version did work, technically! But unfortunately not to a standard where it was usable. The HTML5 version is just a sidequest, though. The C++ version just crashed immediately, which stops this whole thing in its tracks.

I'll continue to keep an eye on https://github.com/openfl/openfl/pull/2515.

TerryCavanagh avatar Aug 12 '23 16:08 TerryCavanagh

last time I tried to get this working in modern haxe, the html5 version did work, technically! [...] The C++ version just crashed immediately

Is the version you were able to compile available anywhere? Can try compiling it again since https://github.com/openfl/openfl/pull/2515 is merged and OpenFL 9.3 is out.

akgvn avatar Dec 03 '23 10:12 akgvn

I saw! I've been interested, but honestly just haven't had the time.

TerryCavanagh avatar Dec 03 '23 11:12 TerryCavanagh