|
I put together a quick example of Unity3d browser plugin doing a simple just intonation pattern with 3 "oscillators", each using a 32bit 96k waveform generated by Csound. Total applet size is 59kb. Requires Unity3d browser plugin, Windows and Mac only.
http://bwong.ca/Aunity.html
Andy,
Good to know about Time.fixedDeltaTime, I will be experimenting with that. The example uses simple linear envelopes and a "k-rate" of .01. Other than frequent paranoid backups I have not been using any code management. I am not familiar with SVN, but certainly would welcome a collaborative effort.
Brian
----------------------------------------
> Date: Sat, 13 Nov 2010 15:31:26 -0500
> From: andy.fillebrown@gmail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: Re: Unity Audio Envelopes/Creating Waveform files
>
> Excellent! It works via scripting, too (e.g. Time.fixedDeltaTime = 0.001;)
>
> Are you doing any source code management with your Unity file
> structures? I've got it working fairly well with a local SVN
> repository on my hard-drive, but I'm not sure the setup will work with
> collaboration. The way Unity keeps moving things around and deleting
> keyed files is making things difficult.
>
> Regardless, knowing about the fixedDeltaTime setting is making using
> Unity fun again =) All my work-arounds are unnecessary now that I can
> control Unity's "k-rate". Thanks again for posting your findings.
>
> Cheers,
> ~ andy.f
>
>
>
> On Sat, Nov 13, 2010 at 2:00 PM, Brian Wong wrote:
> >
> > Andy,
> > I set the fixed update time interval with dropdown menu Edit/Project Settings/Time. Then just create a script that has a FixedUpdate() function (instead of the standard Update() function) and it will loop once every fixed update time interval. From there you can do anything you need. I am not sure it can be set dynamically through scripting.
> > I am now creating 32 bit 96k waveform samples for Unity with Csound and using them as looped waveforms in the browser plugin without problems. :)
> > Brian
> >
> > ----------------------------------------
> >> Date: Sat, 13 Nov 2010 12:13:02 -0500
> >> From: andy.fillebrown@gmail.com
> >> To: csound@lists.bath.ac.uk
> >> Subject: [Csnd] Re: Unity Audio Envelopes/Creating Waveform files
> >>
> >> Wow, thanks for posting this info! I had not realized the FixedUpdate
> >> frequency could be modified. Are you setting the Time.fixedDeltaTime
> >> property to achieve this?
> >>
> >> Nice discovery on the bitrate/samplerate, too.
> >>
> >> Thanks again. I may take another look at Unity3d, knowing this. I
> >> guess the last thing to test out would be if the browser plugin works
> >> in Wine. It works as far back as IE6, so it will probably work fine
> >> under Wine, too, but I can't say for sure without trying it =)
> >>
> >> Cheers,
> >> ~ andy.f
> >>
> >>
> >>
> >> On Fri, Nov 12, 2010 at 6:50 PM, Brian Wong wrote:
> >>>
> >>> Andy,
> >>> As per Rory's request I continue this OT discussion in the mailing list.
> >>> I have been getting decent results creating audio envelopes using 2d mono sounds and a script with the FixedUpdate() function. You can set the fixed update time interval to anything you want, so it is possible to get quite smooth audio and panning envelopes this way. Obviously if you want to also use the physics engine simultaneously you will have to tweak things to get an update time that works well for both the audio and physics.
> >>> On a related topic, I was pleasantly surprised to find out that the browser plugin will allow use of 24 bit 96k samples! I managed to find some nice standard waveforms in Wuzikstation (sine, saw, etc.) that sound great (and only take up 2.3k each), but would like to be able to create my own custom waveforms with Csound. I know a guy who creates nice ones using Mathematica, and I believe Matlab can also be used for this purpose. I have made a couple attempts at this in Csound over the years, but have never managed to get it working correctly. Can anyone give an example of how to do this in Csound?
> >>> Brian
> >>>>>> On Thu, Oct 21, 2010 at 8:51 AM, andy fillebrown
> >>>>>> wrote:
> >>>>>>> It may be that "Audio Source" objects need to be bound to a game
> >>>>>>> object that contains a physics component in order for FMOD to update
> >>>>>>> the pan, volume, and doppler values seemlessly at
> >>>>>>> faster-than-framerate speeds. I'll let you know how it works out when
> >>>>>>> I get an example put together that uses physics components.
> >>>>>>>
> >>>>>>> Also, if you're interested in going the open-source route, check out
> >>>>>>> WebGL and x3dom. They're not quite ready for prime-time but they'll
> >>>>>>> eliminate the need for a plugin when the WebGL standard is finished
> >>>>>>> and browsers have it fully implemented -- and it should work on Linux,
> >>>>>>> too. When I'm done vetting Unity3D I'll be testing out the
> >>>>>>> WebGL/x3dom combination to see how it stacks up.
> >>>>>>>
> >>>>>>> Cheers,
> >>>>>>> ~ andy.f
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On Wed, Oct 20, 2010 at 9:34 PM, Brian Wong wrote:
> >>>>>>>>
> >>>>>>>> Thanks Andy, please keep me updated about your Unity3d work off-forum, as I am also interested in similar aspects of Unity3d (browser-based algorithmic music and video). A Csound plugin for Unity would of course be great, but I lack the necessary C++ skills for such an endeavour. FMOD, supposedly "the world's leading audio engine" might be impressive compared to other game audio engines, but to us Csounders it seems pretty pathetic. Maybe one of the C++ wizards here might consider taking on the project so we could show the gaming world what a REAL audio engine can do.
> >>>>>>>> Brian
> >>>>>>>> ----------------------------------------
> >>>>>>>>> Date: Wed, 20 Oct 2010 07:19:57 -0400
> >>>>>>>>> From: andy.fillebrown@gmail.com
> >>>>>>>>> To: csound@lists.bath.ac.uk
> >>>>>>>>> Subject: [Csnd] Re: RE: Re: OT : Unity browser test
> >>>>>>>>>
> >>>>>>>>> Thanks for the tip, but the issue with the audio objects is due to the
> >>>>>>>>> relatively slow rate that Update() gets called. Since it only gets
> >>>>>>>>> called once per frame, the audio objects' volume and pan settings can
> >>>>>>>>> only be updated once per frame -- which is nowhere near fast enough to
> >>>>>>>>> get smooth envelopes. afaik there is no way to update the audio
> >>>>>>>>> objects faster than the frame rate, and the Unity3D engine is not
> >>>>>>>>> smoothing out the volume and pan settings internally. The way I'm
> >>>>>>>>> currently dealing with it is to use a portamento type script to slow
> >>>>>>>>> down the volume and pan changes, but there is a trade-off in
> >>>>>>>>> positional accuracy. I'll let you know if I figure out a better
> >>>>>>>>> solution.
> >>>>>>>>>
> >>>>>>>>> Cheers,
> >>>>>>>>> ~ andy.f
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Tue, Oct 19, 2010 at 8:29 PM, Brian Wong wrote:
> >>>>>>>>>>
> >>>>>>>>>> Too bad there is no Unity browser plugin for Linux; on Mac and Windows the applet worked well. Sorry, I should have checked that before posting.
> >>>>>>>>>> Cool example Andy! Sorry to hear about the the audio problems. I have only been playing with Unity for a couple of days and have not delved much into the audio aspects yet, so I appreciate the info. Are you using the deltaTime variable for the Time class? In my example I used Time.delta time to make the cube rotation speed independent of frame rate. Just an idea, but possibly it might help to apply this to the object movement. Here is the source code for my Rotate.js script :
> >>>>>>>>>> var speed = 5.0;
> >>>>>>>>>> function Update () { speed = speed + Input.GetAxis("Horizontal"); transform.Rotate(0, speed*Time.deltaTime, 0);}
> >>>>>>>>>> You can find the documentation for the Time class in the Scripting Reference.
> >>>>>>>>>> BW
> >>>>>>>>>>
> >>>>>>>>>> ----------------------------------------
> >>>>>>>>>>> Date: Tue, 19 Oct 2010 06:07:52 -0400
> >>>>>>>>>>> From: andy.fillebrown@gmail.com
> >>>>>>>>>>> To: csound@lists.bath.ac.uk
> >>>>>>>>>>> Subject: [Csnd] Re: OT : Unity browser test
> >>>>>>>>>>>
> >>>>>>>>>>> Hi Brian,
> >>>>>>>>>>>
> >>>>>>>>>>> I've been testing out Unity3D for a few weeks and I've found that
> >>>>>>>>>>> there are some big issues with the "Audio Source" game objects that
> >>>>>>>>>>> result in pops and clicks on some systems, particularly XP. I've
> >>>>>>>>>>> worked around the issues somewhat, but I keep running into limitations
> >>>>>>>>>>> on how fast I can move Audio Source objects before the pops and clicks
> >>>>>>>>>>> re-appear. I could be doing something wrong, of course =) ...but it
> >>>>>>>>>>> seems to me that Unity3D's "k" rate is locked to the current
> >>>>>>>>>>> frame-rate, and I haven't figured out a way to make the Audio Source
> >>>>>>>>>>> game objects update faster than the frame-rate, yet.
> >>>>>>>>>>>
> >>>>>>>>>>> My initial excitement at discovering Unity3D has been tempered a bit
> >>>>>>>>>>> since running into these issues, but it's still interesting. My most
> >>>>>>>>>>> recent experiment can be found at
> >>>>>>>>>>> http://audiosculptures.com/unity/sines/20101018
> >>>>>>>>>>>
> >>>>>>>>>>> Cheers,
> >>>>>>>>>>> ~ andy.f
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> On Tue, Oct 19, 2010 at 1:14 AM, Brian Wong wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>> After the disappointing compatibility results with the minim web mp3 player I decided to try out the Unity platform to make a simple interactive "music video". Well, the video is interactive, the music is not. The music is a Csound piece (pinkcube#1) I did about a year ago.
> >>>>>>>>>>>> Unity allows Ogg Vorbis files and has optional streaming. It requires a browser plugin to be installed. Unity is a game development platform which can build for web, mobile, standalone, or console, and the web browser plugin in particular is impressive, on XP at least. I would be interested in hearing whether it works on the broad range of platforms/browsers used by the people here.
> >>>>>>>>>>>> http://bwong.ca/gcube.html
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>>>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Michael Gogins
> >>>>> Irreducible Productions
> >>>>> http://www.michael-gogins.com
> >>>>> Michael dot Gogins at gmail dot com
> >>>>>
> >>>>>
> >>>>> Send bugs reports to the Sourceforge bug tracker
> >>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>>> Discussions of bugs and features can be posted here
> >>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> Send bugs reports to the Sourceforge bug tracker
> >>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>>> Discussions of bugs and features can be posted here
> >>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>>
> >>>
> >>>
> >>> Send bugs reports to the Sourceforge bug tracker
> >>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >>> Discussions of bugs and features can be posted here
> >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>>
> >>>
> >>
> >>
> >> Send bugs reports to the Sourceforge bug tracker
> >> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> >> Discussions of bugs and features can be posted here
> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >>
> >
> >
> > Send bugs reports to the Sourceforge bug tracker
> > https://sourceforge.net/tracker/?group_id=81968&atid=564599
> > Discussions of bugs and features can be posted here
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >
> >
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
Send bugs reports to the Sourceforge bug tracker
https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|