Skip to content

Out of sync docs? #137

Open
Open

Description

@JestDotty

trying to figure out how to make generated audio without extra software right now.

this video clip: https://www.youtube.com/watch?v=6Ru2H-IrOWU shows clip can have an argument of instrument, but your docs don't mention it https://scribbletune.com/documentation/core/clip

In general I'm finding this library short on example usages or info so I'm having a difficult time figuring it out. It seems too complex to get it to "work" from example code to audio even once?

Activity

  1. walmik commented on Oct 18, 2020

    @walmik
    Collaborator

    Thank you for pointing this out @JestDotty ! I will update the docs once I get some time but to unblock you for now, I m sharing some details here.

    The instrument parameter is newly updated in Scribbletune and it will replace the synth parameters in the futures. Either ways, it uses a Tone.js instrument and can be use like this

    scribble
      .clip({
        instrument: 'Synth',  // string
        pattern: 'xx[xx]', 
        notes: 'C3 Cm-3'
      })
      .start();
    

    The following synths are provided thanks to Tone.js and you can define the instrument by seeing one of the following values as a string:

    • AMSynth
    • DuoSynth
    • FMSynth
    • MembraneSynth
    • MetalSynth
    • MonoSynth
    • NoiseSynth
    • PluckSynth
    • PolySynth
    • Sampler
    • Synth

    You could even define the instrument as a Tone.js object like this,

    const synth = new Tone.Synth();
    scribble
      .clip({
        instrument: synth, 
        pattern: 'xx[xx]', 
        notes: 'C3 Cm-3'
      })
      .start();
    

    and then augment it like this

    synth.set({oscillator: {type: "sawtooth"}});
    

    There is yet another way to define synths. You can initialize a Tone.js instrument with a JSON payload that defines the properties of the synth. This is a bit advanced way of doing it, but if you feel like giving it a shot, the play around with some of the "Instruments" here https://tonejs.github.io/examples/ and change their properties. Then click the <> button on the bottom and get hold of the JSON payload and use it here

    const synth = new Tone.Synth({<jsonPayload here>});
    

    Screen Shot 2020-10-18 at 12 19 09 AM

    Hope this helps for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions