Giter Site home page Giter Site logo

Comments (8)

Zunawe avatar Zunawe commented on May 22, 2024 3

No problem! I've been having a lot of fun with this. Youtube recommended your SFNode presentation a few days ago and I've been sharing that around a bit. Keep it up!

from scribbletune.

walmik avatar walmik commented on May 22, 2024

Sorry for the confusion. scribble.modes is not a method. It s a property. Can you try console.log(scribble.modes) instead and see if you are getting the list of modes/scales?

There is a method called scribble.mode() - mode not modes. Maybe that s the one you wanted?

from scribbletune.

Zunawe avatar Zunawe commented on May 22, 2024

Oh whoops. That's a typo. I meant scribble.mode(). I tested with scribble.mode().

On that note though, the documentation does say "You can list the available modes by invoking the modes method."

from scribbletune.

walmik avatar walmik commented on May 22, 2024

I see! Good catch... So other than the documentation, is there an issue in invoking scribble.mode() or scribble.modes?

from scribbletune.

walmik avatar walmik commented on May 22, 2024

BTW, scribble.mode() should be called with the root and the mode you want at least. For e.g. scribble.mode('c', 'ionian'). However, as per what we pushed last night, v0.10.0, we can directly do scribble.mode('c ionian') OR scribble.scale('c major')

from scribbletune.

Zunawe avatar Zunawe commented on May 22, 2024

scribble.mode() works fine when you explicitly specify the root and mode. However, looking before 1a6cb73,

scribble.mode(undefined, undefined, undefined)

returns a C Major scale on octave 3. The documentation indicates this use:

// Create a clip that plays the middle C
var cMajor = scribble.scale();  // [ 'c3', 'd3', 'e3', 'f3', 'g3', 'a3', 'b3', 'c4' ]

This code (which sets those defaults) has no effect because if root or mode are undefined, we'll get a TypeError trying to call match() or an AssertionError checking that mode exists.

And maybe that should be removed so that the user has to be explicit always, but then there should be a more explicit assertion with the arguments, and it should be removed from the documentation.

Otherwise, moving it to the top of the function should allow for those default values again. (Also the default is octave 4 now. To be super nitpicky and annoying.)

from scribbletune.

walmik avatar walmik commented on May 22, 2024

Ah I see! Last night's push caused this. I ll fix this such that mode() without any params continues to return the C Major scale.

from scribbletune.

walmik avatar walmik commented on May 22, 2024

Thank you so much for going through the code and the commits to unearth this!

from scribbletune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.