Search Unity

Released: Visualizer Studio - A Music Visualization scripting package!

Discussion in 'Assets and Asset Store' started by AlteredReality, Aug 16, 2011.

  1. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    SUCCESS!!! EUREKA!!!!
    So ya I gave up on writing my own modifier script for ImageEffects on the camera After I realized the full potential of Unity's Animation system and your AnimationStatePropertyModifier and AnimationStatePropertyTrigger scripts!!!

    That has basically solved ALL of my problems! and at the same time opened an almost infinite amount of doors for me.

    Andy I wish I could hug you right now because Im so pleased with the results I've just gotten using your Visualizer package !!
    SO here is what I've got so far:
    (it needs alot of tweaking still but WOW... my mind is BLOWN at what this combo will allow me to accomplish)
    http://dl.dropbox.com/u/3697270/Unity/Web_Demos/VJ1/VJ1.html
     
    Last edited: Oct 25, 2011
  2. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Cool! Nice work! I'm really glad to hear it is allowing you to accomplish so much! I love seeing what you've done so far!


    Keep up the good work!
     
  3. kersk

    kersk

    Joined:
    Jan 2, 2012
    Posts:
    56
    Hi,

    Any word on how well this package plays with the Unity 3.5 public beta?
     
  4. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I have not had a chance to try it with the beta yet, but I don't expect any major issues with it. I will attempt to try it out in the next few days and let you know.
     
  5. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    I can definitely confirm that Visualizer Studio works just fine in 3.5 public beta (see screenshot).
    http://s18.postimage.org/pdkjkcb0p/Screen_Shot_2012_02_10_at_7_51_14_AM.png

    Also Andy, any further development on using the microphone/line in for realtime audio analysis?

    Would love to use unity to do live visuals for some musicians I'm working with (already using OSC for live stuff but realtime audio analysis would be better).
     
  6. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    It works fine with mic input under 3.5 RC1. You can easily modify the VS example "Music Player" by adding the script from http://forum.unity3d.com/threads/118215-Blow-detection-(Using-iOS-Microphone) (might need to mod it slightly) and turning the audio source into a mic input. Also Mute the Audio Source, and uncheck playOnAwake so you don't get feedback.
     
  7. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Thanks for the info, I was able to get this working by looking at the thread. Once 3.5 is released, I will officially add this to Visualizer Studio. In the meantime though, here is the script you need:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. [AddComponentMenu("Visualizer Studio/3.5 Beta/Microphone")]
    6. public class VisMicrophone : MonoBehaviour
    7. {
    8.     void Start ()
    9.     {
    10.         //make sure it's okay to start the microphone
    11.         if (audio  Microphone.devices != null  Microphone.devices.Length > 0)
    12.         {
    13.             //assign and start microphone and then mute the audio source
    14.             audio.clip = Microphone.Start(Microphone.devices[0], true, 999, AudioSettings.outputSampleRate);
    15.             audio.mute = true;
    16.            
    17.             //HACK - Wait for microphone to be ready
    18.             while (!(Microphone.GetPosition(Microphone.devices[0]) > 0)) { }
    19.            
    20.             //start the audio source
    21.             audio.Play();
    22.         }
    23.         else
    24.             Debug.Log("No audio source was found, can't start microphone!");
    25.     }
    26. }
    27.  
    You just need to attach this to the same game object as the audio source that you are using, and it will instead use the microphone. It would be the object "MusicPlayer" in the case of the demo I ship with Visualizer Studio.

    Let me know if that works for either of you. Enjoy!
     
    Last edited: Feb 12, 2012
  8. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    For iOS, can this use the music going through their mediaplayer in the background (iPod music library)? Or only audio from Unity?
     
    Last edited: Feb 12, 2012
  9. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Last edited: Feb 12, 2012
  10. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    If you can access the iOS media player music as an AudioSource, then you should be able to. However, I did a little research and I didn't see a way to do this. So unless someone knows of a way to do this, it wouldn't be possible right now. Visualizer Studio only works using an AudioSource object in Unity.
     
  11. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I replied to your post on the other thread. However, did you try the script that I provided for using Visualizer Studio with the Microphone on iOS?
     
  12. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    Heya Andy,
    So I tested your new script twice now and it doesn't work for me. I don't get any errors in the console. just the else statement.
    --------------------------------------------------------------------------------
    No audio source was found, can't start microphone!
    UnityEngine.Debug:Log(Object)
    VisMicrophone:Start() (at Assets/VisualizerStudio/Scripts/Modifiers/VisMicrophone.cs:25)
    ----------------------------------------------------------------------------------
    any ideas why its not working?
    Does it have anything to do with how your calling the microphone device? I know that your on Windows and I'm on OSX, is there differences in the script when calling audio devices on Mac ?
    Not sure....
     
  13. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I just submitted Visualizer Studio 1.2 to the asset store. It has the final version of the microphone script. I just tested it on my Mac, and the microphone support works just fine.

    However, it is very similar to what i posted here. So, that should work too. Did you attach the script to the same game object as your Audio Source? It essentially hi-jacks it, so it needs to be on the same game object.
     
  14. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    Odd,
    Ya I definitely attached the script to the same game object as the audio source. I even tried it with your example scene. Same result.
    I will try it out again soon with your new version of Visualizer studio to see if I can diagnose why this is happening......
     
  15. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    Ok, just tested it again after downloading your update and it works. Now the next step. How do I get it to use my line-in (1/8th inch input) audio source instead of the built in microphone?
    Also not to be overly pedantic but in your read me file for the 1.2.1 update it says that its still version 1.0.5 - not that it really matters that much. Just confused me a bit when I was trying to upgrade it.
     
  16. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Awesome, glad to know it's working now! I forgot to add the Microphone feature to the documentation, I'll have to update it and submit a new version.

    As for pointing it at a different device, you'll have to modify VisMicrophone.cs, where it refers to "Microphone.devices[0]". You will have to update it to point at the proper device. I'll check into updating it at some point soon to present a drop down to select which input to use. However, I don't think that will really work, because the list of devices is dependent on the platform you are running on.

    I'll post on here if I come up with a solution for this.
     
  17. VJ_Anomolee

    VJ_Anomolee

    Joined:
    Dec 23, 2008
    Posts:
    40
    Thanks for the quick reply Andy!
    Your active support and improvement is extremely helpful.

    So I tested it again just strait out of my iPad and it does indeed work.
    All that was needed was for me to change "Microphone.devices[0]" to "Built-in Input"

    Which is weird because I thought I had done this before and it didn't work.

    I was also a bit puzzled at how the conditional "Microphone.devices.Length in
    " if (audio Microphone.devices != null Microphone.devices.Length > 0) "
    relates to the code I replaced.
    ?

    It all works great. Now Im off to build some cool stuff with it. Thanks again. SO much.
     
  18. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Visualizer Studio 1.2.2 has been released! The main changes are as follows...

    • Added compatibilty for PlayMode Persist.
    • Moved code for VisBasePropertyModifier and VisBasePropertyTrigger into the package. These can be used as an example of how to derive from VisModifier and VisTrigger.
    • Added a custom editor for VisMicrophone to display a popup list of all microhpone devices on the current machine. For other platforms, you can now key in a device name directly. If a device name is not found, it will use the first device found on the platform.
    • Updated documentation to include how to use VisMicrophone. Also replaced readme.rtf with a How-To pdf file.

    Let me know if anyone has any questions. Enjoy!
     
  19. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    The latest changes to VisMicrophone in 1.2.2 should make working with it easier. You can now enter what device to use directly! Let me know if it helps!
     
  20. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  21. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  22. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey there! Loving this at the moment, bought it ages ago but finally it forms the backbone of a game of mine, unfortunately im having a similar prob to above, getting no audio source detected (added one) then after, all mics are removed from the preset menu prompting a restart of unity, any idea whats up?

    EDIT: Actually i find it's more than that, im not sure what's up, just pressing play, on an existing or new scene removes the ability to show microphones and prompting a restart, i suppose its a case for the support forum
     
    Last edited: Mar 31, 2012
  23. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I just played with it a bit more on my computer (Macbook Air Core i7 with Windows 7), and I'm not seeing any weirdness with microphone devices not showing up after playing. Although, I only have on device hooked up, so it just shows Default and then the one device. What OS are you on, and how many devices do you have connected? Is it just in selecting the device to use that you are having issues? Or is it more than that?

    If it is just the list of devices, I do think this would mostly be a Unity issue though, as I am just using Microphone.devices to get the list of devices. You can look at VisMicrophoneEditor.cs to see how I implemented the drop down, but I don't see any potential issues there.

    Let me know if it's more than just the list, or if you find anything else out. Thanks.
     
  24. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
  25. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  26. mattblack

    mattblack

    Joined:
    Jan 9, 2012
    Posts:
    3
    hi
    we want to build a Unity music visualizer for Android mobile devices...do you know if anyone has done this using your Visualizer studio? any examples ?

    thanks!
     
  27. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Using it on Android is not something I have done, nor can I think of anyone off the top of my head that I know is using it on Android. However, my goal for Visualizer Studio from the beginning was to make sure it works on all Unity platforms. I am pretty sure it would work with no problems at all. The only thing I could see you needing to do is to adjust how many samples the VisManager takes each frame for performance reasons.

    If you try it on Android and have any issues at all, let me know ASAP and I'll fix any bugs that may occur. (But I am 90% sure you would have no issues at all)

    Let me know how it works out for you. Thanks!
     
  28. elpernyl

    elpernyl

    Joined:
    Sep 5, 2011
    Posts:
    3
    Hi Andy, VisStudio is awesome! Been waiting for something like this for a while
    I can run the demo scene fine, but when I create a new one I get strange errors

    ---------------------------
    This controller must have a VisDataGroup assigned to it in order to function. Please double check the spelling of the target data group.
    UnityEngine.Debug:LogError(Object)
    VisFrequencyController:Start() (at Assets/VisualizerStudio/Scripts/Controllers/VisFrequencyController.cs:110)
    ---------------------------

    The scene is only a cube with a VisGameObjectPropertyModifier, camera and VisStudio prefabs
    I set up everything as explained and the debug shows the audio going through, but in the controllers all Data Groups appear as "NONE"
    Also, once I stop the project, if I click on the Controller prefab before the Manager, all the Data Groups appear empty in the inspector
    If I click on the Manager and then on the Controller again everything is fixed, but I still get the erros when it runs
    It's like the Data Group selection doesn't stick

    Tried updating in the shop, reimporting everything, making a new project, restarting unity
    Running Unity 3.5.0f5 in OSX 10.6.8
     
  29. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I actually just submitted a fix for this last night, so it should be in the asset store soon. Essentially, this update strongly encourages the user to place all Manager, Data Group, and Controller components to all in the same Game Object to prevent these issues. I did some more behind the scenes to make this easier to use. The included prefab and documentation were updated to reflect this as well.

    If you don't want to wait for the update, you can email your invoice number to alteredrealityent@yahoo.com, and I'll email you the update directly.

    Sorry for any inconvenience!
     
  30. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Visualizer Studio 1.3.0 has been accepted into the asset store! This includes changes that help prevent the issues mentioned by elpernyl above, which make it even easier to work with!
     
  31. elpernyl

    elpernyl

    Joined:
    Sep 5, 2011
    Posts:
    3
    Great!
    I'll update asap

    I just found a way around it by naming the Data Groups differently from the names in the Manager
    But it is much better to go with the official fixes

    Thanks!
     
  32. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I have just released Visualizer Studio Pro \w Source Code onto our website for $100! Visualizer Studio

    If you already own Visualizer Studio, and are interested in it, please let me know and you can get a $50 off coupon!

    Let me know if you have any questions!
     
  33. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    For anyone following this thread, Visualizer Studio is 25% off on our website until tomorrow morning (6/11)!

    You can get Visualizer Studio Basic \w Dlls for only $37.50. And Visualizer Studio Pro \w Source Code for $75!
     
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Thanks, I will wait for a promotion for the asset store version.
     
  35. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Visualizer Studio 1.3.2 has been released!

    - Added the ability to properly set/change the audio source on a Visualizer Manager at runtime.
     
  36. tobobox

    tobobox

    Joined:
    Jul 7, 2012
    Posts:
    25
    First off... Great plugin!!!

    I'm new to editor programming and am a bit confused when trying to create a new modifier. I want to be able to control a variable in another script. Can you post a template for a new modifier and modifierEditor script for controlling public variables? This would be extremely helpful for me. Thanks.
     
  37. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    It should be pretty easy to create a new one, did you look at any of the existing custom modifier editors? Such as VisAnimationStatePropertyModifierEditor.cs?

    Just follow what was done in other custom ones for your new modifier.
     
  38. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Brilliant plugin and loads of fun already! One question:

    I am having problems changing a value of a dropdown in the Vis Game Object Property Modifier component. I can do things like disable/enable the component for example:

    scriptName1.GetComponent("VisGameObjectPropertyModifier").enabled = false;

    But I seem unable to change the value of the drop down list in that component. The Option is called 'Controller', and the values in the drop down are 'High', 'Medium', 'Low'.

    I've tried all sorts of ways, but end up getting null references, unexpected tokens, and all sorts of other stuff.

    Any ideas? In JS if possible please.

    Thanks and great worl

    Paul
     
  39. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    First off, are you using the source code or dll version? Are you unable to change it any other controller at all? Or are you having issues adding your own new controller and switching to it? Have you made sure you have a valid visualizer manager set on the modifier? I just loaded up VS 1.3.2 (dlls) and I'm able to switch the controller with no issues. Let me know a bit more info on your specific issue, and hopefully we'll be able figure things out. :)
     
  40. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi Andy,

    I am using the DLL version.

    The Vis Game Object Property Modifier component works fine and does everything I need when controlled via the inspector panel. However I would like to be able to change the values in it at runtime via javascript. So for example:

    Change the Target Property from UniformScale to Zvelocity.

    Can you provide an example of how to do this please?

    I know I can already target the Vis Game Object Property Modifier by testing to see if I can enable / disable it, which I successfully do by using:
    Code (csharp):
    1. scriptName1.GetComponent("VisGameObjectPropertyModifier").enabled = false;
    Hope this makes more sense ;)

    Paul
     
    Last edited: Aug 6, 2012
  41. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Ahhh, okay, I see what you are trying to do now. First off, I don't do any of my development with Unity in JavaScript, as I feel C# is a much better/robust language than JS. Not to mention the issues you can run into when trying to mix C# and JS in large projects. But that's a different conversation I suppose. ;)

    So, I'll just be completely honest...I really don't know the proper way to do this in JS. I just don't know correct way to use variables and enums from C# in a JS script. So I'll provide the answer I do know, which is how to do this in C#...

    Code (csharp):
    1.  
    2. VisGameObjectPropertyModifier modifier = scriptName1.GetComponent<VisGameObjectPropertyModifier>();
    3. if (modifier != null)
    4.     modifier.targetProperty = GameObjectProperty.ZVelocity;
    5.  
    That should work perfectly fine in C#! Sorry I can't provide the exact way to pull this off in JS (I'm not at a location I could test anything anyway). Let me know if you have further questions.
     
  42. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Hi Andy,

    Thanks for your time on this!

    I managed to work out after research and chatting in other forums the following which may prove useful to other low life JS users lol!

    Code (csharp):
    1. scriptName1.GetComponent("VisGameObjectPropertyModifier").targetProperty = 12;
    12 is the corresponding value of the setting I need, in this case "Uniform Scale" (just count down the list to get the value you need)

    Paul
     
    Last edited: Aug 6, 2012
  43. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Lol looks like we cross posted. I modified my last post to keep it simple. You might want to edit your last one! Thanks for you time on this. Much appreciated and great support response!
     
  44. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Ahh, okay. The makes sense, as enumerations pretty much just ints anyway. Good to know. Thanks!
     
  45. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    The cross post has been deleted. :p And I'm always more than happy to help!
     
  46. tr1stan

    tr1stan

    Joined:
    Jan 23, 2009
    Posts:
    150
    Hi,

    Thanks for developing such an amazing middleware!
    I have a question with VisMaterialPropertyModifer. There is a "Target Property" to look for the variables in material. If I want to modify rgb value of the _TintColor variable, what should I do? I read through the how-to document I still have no idea. Please help.
     
    Last edited: Aug 7, 2012
  47. tr1stan

    tr1stan

    Joined:
    Jan 23, 2009
    Posts:
    150
    I have figured it out myself. In VisMaterialPropertyModifier.cs class there's a switch block to handle the target property names. Just replace material.color with GetColor("_TintColor") and SetColor("_TintColor", newColor) will resolve my problem. I hope this may also be helpful to others.
     
  48. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Your plugin look really cool!
    Is it possible to know in advance the frequency or it just analyze 1 frame each time?
    I am asking because I would be interested in using this plugin for a music game, and I would require to know with 1-2 second advance the coming of bass-mid-high frequency to put the image on the screen for the user to click at the right time, the button cannot appear the same second it must be clicked.
     
  49. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Oh, I'm glad you were able to figure it out! I'm sorry I didn't reply earlier, I didn't notice your posts until someone else posted to the thread and I got an email notification! ;)

    Let me know if you need help with anything else at all.
     
  50. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Unfortunately, no. Visualizer Studio uses realtime audio analysis for everything. There is no support for reading ahead to determine what the audio is going to be like. :( Sorry!