Is it possible to create an Oscillator?

0 favourites
  • 9 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I posted a thread in the "How Do I.." section a couple days ago and got no replies on if there was a way to do this without digging into the SDK and creating my own plugin, but that seem to not be the case. I'm just starting to learn the SDK, but my real question is if this is even possible.

    What I'd like to do is create a plugin that extends off of C2's Web Audio support to create an oscillator. I know how to create what I'm looking to achieve in Javascript, my problem however is implementing it into the plugin. I'd really appreciate some help or feedback on this.

    Thanks!

  • Anything that can be done in js, can be done with the Sdk. It may be tricky to get it to hook in to the audio plugin if you want a seperate plugin. Another option is just to modify the audio plugin, but any bugs introduced won't be supported officially.

  • I should first try and make a plugin that adds 2 input numbers with each others, just to check if your base files work. Once this works you can add new functions and write the oscilator plug-in.

    This isn't really simple. Another problem you can get is that your plugin does not work on all the platforms construct supports.

  • Yeah, I'm starting to realize this is more of an issue then I originally anticipated. I tried messing around with what R0J0hound suggested which was editing the audio plugin itself. This seems like the best option and then just access the Oscillator through the audio plugin. In Audio's edittime.js I managed to add the action needed:

    AddAction(34,0,"Add Oscillator", "General", "Add Oscillator", "Create Oscillator that generates sound at a given frequency.", "AddOsc");[/code:151mb08g]
    
    My problem, is when I go into Audio's [b]runtime.js[/b] I'm not sure how to work with Web Audio since it looks much different then plain WA.
    
    Creating an oscillator in plain JS is as simple as: 
    [code:151mb08g]var ctx = new AudioContext(); 
    osc = ctx.createOscillator();
    osc.connect(ctx.destination); 
    osc.start(0);[/code:151mb08g]
    
    Forgive me if this seems obvious, I'm just learning the SDK today!
  • This is something I've also been very interested in lately. It seems like one could turn Construct 2 into a powerful synthesis tool. The implications for dynamic audio would be incredible.

    But I'm kind of in the same boat, just barely familiar with the SDK.

    Have you made any progress in this area? I'm considering taking a serious crack at it, but I don't want to duplicate anyone's work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is a plugin of tone.js , which could add an oscillator nodes or other effect nodes into audio pipes.

  • Hi

  • Hi

    DIPCrystal

    Please stop making meaningless, non-thread related spam posts.

    If you continue, you are likely to be considered a spam bot and your account will be banned.

  • > Hi

    >

    DIPCrystal

    Please stop making meaningless, non-thread related spam posts.

    If you continue, you are likely to be considered a spam bot and your account will be banned.

    OK! I am not.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)