Audio Source tool

Hey folks, I'm trying to develop some new audio tools for Open Brush, so far I've created a new 'audio source tool' that simply instantiates a GameObject with a GVRAudioSource component and plays a sample, at the brush position. Positionally, this works until I re-scale my view of the scene. The object is instantiated within the MainCanvas in the scene hierarchy. This rescaling is obviously accounted for with the brushes, and so I was wondering where in the code base this happens? Update! - after doing some clicking around I have discovered 'pose'. Next up, figuring how that changes positioning of brush strokes
11 Replies
mikesky
mikesky•3y ago
That sounds awesome!! 😄 I've not dealt with this side of the codebase too much yet, perhaps @andybak would be a better person to ask. However, is your new class subclassed from GrabWidget.cs? this might provide a lot of the framework you need out of the box, and I'd take a look at the other logic used for spawning non-brush things like the 3D models and images
Pitch Black A Dusklight Story
It's currently subclassed from BaseTool. Looking at the 3D models is a great shout. I'll have a look.
andybak
andybak•3y ago
A couple of things - anything you can grab and move is a widget not a tool - definitely look at GrabWidget and consider creating a new subclass of that. In Open Brush "Tools" are things locked to the controller - not things that exist in the scene. @Pitch Black A Dusklight Story - I'm not sure I understand what the problem is when you scale your scene? If the new object is a child of MainCanvas then everything should work as intended - children inherit the transforms of their parents. Maybe post a screenshot showing the issue?
Pitch Black A Dusklight Story
Hey @andybak , thanks for the quick response. As it turns out, the issue was that I was positioning the instantiated GameObject using localPosition, rather than position. So, now in a very crude way I can instantiate GameObjects that are audio sources in the scene. Next step is to add modifiable synths to play out of the audio sources.
andybak
andybak•3y ago
Have you seen SoundStage VR ? https://github.com/googlearchive/soundstagevr
GitHub
GitHub - googlearchive/soundstagevr
Contribute to googlearchive/soundstagevr development by creating an account on GitHub.
andybak
andybak•3y ago
There's a very recent fork with loads of new stuff: https://github.com/ludzeller/opensoundlab
GitHub
GitHub - ludzeller/OpenSoundLab: A fork of SoundStage VR that offer...
A fork of SoundStage VR that offers a virtual sound laboratory for the arts running on Meta Quest. - GitHub - ludzeller/OpenSoundLab: A fork of SoundStage VR that offers a virtual sound laboratory...
andybak
andybak•3y ago
As it turns out, the issue was that I was positioning the instantiated GameObject using localPosition
Are you setting the position every frame?
Pitch Black A Dusklight Story
This is how it's working- I'm sure this is a horrible way of implementing, I haven't got fully to grips with the structure of the code base yet.
andybak
andybak•3y ago
ah ok. i see me neither!
Pitch Black A Dusklight Story
This looks really interesting, having a look now
Want results from more Discord servers?
Add your server