Jump to content

[1.10.x] Kerbal Synth - Synthesizer in KSP


AST_SIL_834

Recommended Posts

 Synthesizer for Kerbal Space Program
 This mod adds a customizable synthesizer block in Utility category.

banner-.png

rmenu.png

Note: Click PlayStart to activate it, then you can play around with other options.

Controlling via action groups and controllers are supported.

Dependencies
- Module Manager
- Indicator Lights (Optional, Recommended)

Note : If Indicator Lights is not installed, the note block will have the exactly same model as "The Not-Rockomax Micronode". If Indicator Lights is installed, then the note block will have a fancy glowing frame and adjustable color. So it's highly recommended to install Indicator Lights.

Download

from Github

from SpaceDock

Demo Video

or Bilibili

Custom Tones

 You can define harmonics to synthesize custom tones. see KerbalSynth/Tones/ folder for examples.

Source

Github

Lincese : MIT

Edited by AST_SIL_834
Add demo video
Link to comment
Share on other sites

On a Linux install, I get a StackOverflowException error when trying to enter the VAB and KSP stops:

Spoiler

[EXC] StackOverflowException: The requested operation caused a stack overflow.
        KerbalSynth.AudioManager.OnAudioFilterRead (System.Single[] data, System.Int32 channels) (at <4707ad8c5a9349d0881b7a0e4c9f704d>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        System.Object:__icall_wrapper_ves_icall_object_new_specific(IntPtr)
        KerbalSynth.AudioManager:OnAudioFilterRead(Single[], Int32)

 

Does anyone else see this? I'll try to grab a better log with reduced and cleaned mod list later.

Oh and while I'm looking at it, this is an improper use of "FOR" and should be "NEEDS":

Spoiler

// add light if IndicatorLights exists
@PART[NoteBlock]:FOR[IndicatorLights] {

 

This forces "IndicatorLights" to exist and applies the config regardless, resulting in some probably harmless errors because of missing models and modules. It's not the source of the StackOverflow, though.

Edited by HansAcker
Link to comment
Share on other sites

23 hours ago, HansAcker said:

On a Linux install, I get a StackOverflowException error when trying to enter the VAB and KSP stops:

  Hide contents


[EXC] StackOverflowException: The requested operation caused a stack overflow.
        KerbalSynth.AudioManager.OnAudioFilterRead (System.Single[] data, System.Int32 channels) (at <4707ad8c5a9349d0881b7a0e4c9f704d>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        System.Object:__icall_wrapper_ves_icall_object_new_specific(IntPtr)
        KerbalSynth.AudioManager:OnAudioFilterRead(Single[], Int32)

 

Does anyone else see this? I'll try to grab a better log with reduced and cleaned mod list later.

Oh and while I'm looking at it, this is an improper use of "FOR" and should be "NEEDS":

  Hide contents


// add light if IndicatorLights exists
@PART[NoteBlock]:FOR[IndicatorLights] {

 

This forces "IndicatorLights" to exist and applies the config regardless, resulting in some probably harmless errors because of missing models and modules. It's not the source of the StackOverflow, though.

thx for feedback!

 

This is OnAudioFilterRead method:

        public void OnAudioFilterRead(float[] data, int channels)
        {
            if (canPlay)
            {
                buzzers.ForEach(b =>
                {
                    if (!b.Idle) b.GenerateAudio(data, channels);
                });
            }
        }

When entering VAB, buzzers is initialized as an empty list so this method should be doing nothing. So maybe the exception is triggered outside the method, when Unity tries to call OnAudioFilterRead from its Messaging System. If so, this could be Unity's problem.

I'm not familiar with linux so I currently have no idea why this goes wrong in linux.

Link to comment
Share on other sites

On 9/11/2020 at 5:13 PM, AST_SIL_834 said:

So maybe the exception is triggered outside the method, when Unity tries to call OnAudioFilterRead from its Messaging System. If so, this could be Unity's problem.

Looks like it. The stack overflow already happens when the function is entered, a Debug.Log call at the start of the function does not log anything. It could be a quirk of Unity on this particular Linux distribution (Linux Mint "Serena" is already outdated a bit). I'll run tests on a more recent distribution. Everything works fine under Windows 10.

 

Link to comment
Share on other sites

I installed this mod in 1.9.1 with IndicatorLights plus community extensions and got a weird bug- the lights showed up, but the cube inside did not and it didn't work at all; I couldn't even remove the parts once they were placed. It worked fine in 1.9.1 when there were no other mods installed but I didn't try adding IndicatorLights to that (yet) but will do that to see if I can replicate the problem.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...