SunVox Engine for JavaScript
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
SunVox Engine for JavaScript
SunVox library for developers has been updated to v1.9.4c!
With a lot of changes, including JavaScript support!
Look at the example: JS SunVox Player with endless generative demo songs.
With a lot of changes, including JavaScript support!
Look at the example: JS SunVox Player with endless generative demo songs.
Re: SunVox Engine for JavaScript
This looks pretty rad. So, how difficult would you say it would be to create a simple page that would select a sunvox file at random and begin playing it whenever someone visited the page? The user would have the option to stop playing the file, or select another file at random.
I've been working with generative music for years and I've been finding SunVox to be pretty accommodating for some of my projects. I should mention, however, that I have very little JS experience. Still, I think this is definitely worth looking into.
Thanks for all of the great work you do, NightRadio!
I've been working with generative music for years and I've been finding SunVox to be pretty accommodating for some of my projects. I should mention, however, that I have very little JS experience. Still, I think this is definitely worth looking into.
Thanks for all of the great work you do, NightRadio!
Re: SunVox Engine for JavaScript
Actually, I am happy to report I've already made quite a bit of headway with this project. Having said that, I do want to make sure I'm adhering to the proper protocols.
Alexander, so long as I include the statement about it being powered by SunVox, a link to your web site and the statement regarding OGG Vorbis and Xhip.org I am ok to use this, correct? This project is not for commercial purposes, but I want to ensure that I am giving proper credit. Also, please let me know if I should remove this post and move this discussion to a private message.
Once again, thank you.
Alexander, so long as I include the statement about it being powered by SunVox, a link to your web site and the statement regarding OGG Vorbis and Xhip.org I am ok to use this, correct? This project is not for commercial purposes, but I want to ensure that I am giving proper credit. Also, please let me know if I should remove this post and move this discussion to a private message.
Once again, thank you.
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: SunVox Engine for JavaScript
It's great!Actually, I am happy to report I've already made quite a bit of headway with this project.
Yes, that's right.Alexander, so long as I include the statement about it being powered by SunVox, a link to your web site and the statement regarding OGG Vorbis and Xhip.org I am ok to use this, correct?
Please don't forget to share a link to your project when it is finished :)
Re: SunVox Engine for JavaScript
So, after having some playtime with the JS version I am running into some issues. One is file size, which is understandable. Some of my projects use rather large samples and I could see why that would create a problem when trying to load. However, I've also noticed that none of my songs that use MetaModules will play, nor will any of my songs that use more than a few percent of the CPU.
Is there any documentation available about what the limitations are for the JS version of SunVox? If not, I understand. I am more than happy to keep experimenting to see what works and what doesn't.
Thanks!
Is there any documentation available about what the limitations are for the JS version of SunVox? If not, I understand. I am more than happy to keep experimenting to see what works and what doesn't.
Thanks!
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: SunVox Engine for JavaScript
Not yet, sorry. So far I do not really know these limitations too :) I should check this in more detail...Is there any documentation available about what the limitations are for the JS version of SunVox?
Please can you send me some of your songs that don't play correctly in JS player?
nightradio@gmail.com
Re: SunVox Engine for JavaScript
@GENNA I'm sure you're well aware of this, but do not assume that everyone has a system that can play crazy complicated tracks. Even some songs that are shipped with Sunvox won't play on my main computer without overloading the CPU. I personally would keep tracks to simple chiptunes or sampler-based tracks with only a few FX. Especially for handheld devices that might be browsing your page. 8 Cores at 4Ghz isn't exactly standard for most people.
WARNINGThis angry old nerd may rant about modern computers or computer culture! It is not directed at you 99% of the time! Ignore it if it seems silly or personal!
Re: SunVox Engine for JavaScript
@NightRadio, my apologies for not replying sooner. I've been away from my computer for extended periods over the past two weeks. I'm back to experimenting though and will send you a few examples.
@hseiken, you are absolutely right. I think I definitely sometimes take my system for granted. It's fairly high-spec as I use it for live performance as well. Also, I'm new to the whole JavaScript thing so I'm really not sure what sort of limitations or flexibility is available there. I do need to remember that keeping things simple is best - thank you!
@hseiken, you are absolutely right. I think I definitely sometimes take my system for granted. It's fairly high-spec as I use it for live performance as well. Also, I'm new to the whole JavaScript thing so I'm really not sure what sort of limitations or flexibility is available there. I do need to remember that keeping things simple is best - thank you!
Re: SunVox Engine for JavaScript
I finally have some time to re-visit this; however, I have what I hope is a simple JavaScript question - is there any way to have a SunVox file play automatically when the web page is loaded? I've done some searching online but this seems to be eluding me.
Any examples or directions toward helpful resources is greatly appreciated.
Thanks!
John
Any examples or directions toward helpful resources is greatly appreciated.
Thanks!
John
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: SunVox Engine for JavaScript
You can try to add sv_play_from_beginning(0) right after the sv_load_from_memory().Is there any way to have a SunVox file play automatically when the web page is loaded?
This will definitely not work in Safari for iOS: https://developer.apple.com/library/con ... ounds.html
(see "Playing Sounds" section):
... the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap ...
I think the other browsers go the same way.
Re: SunVox Engine for JavaScript
Alex,
That worked; however, you make a great point about the other browsers. That is something that never occurred to me, so it looks like I'll be sticking with the buttons after all.
Thanks again for your help!
John
That worked; however, you make a great point about the other browsers. That is something that never occurred to me, so it looks like I'll be sticking with the buttons after all.
Thanks again for your help!
John
-
- Posts: 51
- Joined: Tue Dec 01, 2015 5:50 am
Re: SunVox Engine for JavaScript
Looking forward to what you have been working on GENNA!
I am too interested in presenting something similar one day.... when I have time..... time...
I am too interested in presenting something similar one day.... when I have time..... time...
Re: SunVox Engine for JavaScript
For the JS engine, I noticed that you're using wasm. I'm using an engine where I load multiple samples. Since they all need to be AIFF or WAV files, they can get pretty big, so I'm running up against the memory limitation "cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X" etc. I did some digging and it seems you have the module set to 256 pages in the wasm file itself. What do you think of going to 512?
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: SunVox Engine for JavaScript
Thanks for this info!I did some digging and it seems you have the module set to 256 pages in the wasm file itself. What do you think of going to 512?
I will check it before the new version release.