Hacker Newsnew | past | comments | ask | show | jobs | submit | saebekassebil's commentslogin

Looks really nice and it's fun to play around with. Maybe a control for inversing the chords would be fun? That would mean support for chords like A7/c# and maybe also closer chord voicings.

I should also add that the app became much more fun when I accidentally read the "Help" menu and became aware of "play" and "root" - maybe that information should be a bit more visible?

I'm interested in what if any library you've used for the theory - did you just built one yourself? You could take a look at teoria(https://github.com/saebekassebil/teoria) which is a by now pretty seasoned music theory library in js, with a chord parser included.

EDIT: (PS: Also add9 add11 chords would be nice)


Thanks! Chord inversion is definitely on my todo list.

Your point about the help page is really good, I'm going to figure out a better way to introduce the feature to new users. I was primarily thinking of users coming in via my YouTube channel in which I made a tutorial video, but I hadn't really thought about organic traffic.

For the theory I just wrote it myself, you can check it out here: https://github.com/nebs/notekitchen

Feel free to submit a PR if you find any bugs or inefficiencies.

I'll check out Teoria, haven't heard of it before.


> I like freshly squeezed oranges off my orange tree but they don't grow all year round. I am mostly happy not to consume oranges out of season but that isn't really a basis for a sustainable industry...

Actually I'd call that the definition of a basis for a sustainable industry...


Yeah there's common sense in accepting that some produce is only available some of the time. There's plenty of decent fruit even in winter; I don't need strawberries right now.


There wouldn't be plenty of decent fruit in winter where I'm from without a massive transportation infrastructure.


Had to implement a

    if not warrior
      return nil
    end
in the play_turn method, to workaround a bug. But other than that, this is great!


So true, this is actually one of the things that almost convinced me to switch to Safari. I'd miss the Developer Tools though..


But the developer tools are in Safari.


Not visible by default, hence may people miss them: Developer menu entry needs to be enabled in Preferences.


Some weird stuff going on with the if clauses:

Switch His power level is 9000. It's almost 9000?!"

This should probably be:

#### Switch His power level is [p6=5000[5000..20000,1000]]. It's [warning_2[(p6 < 8000),(p6 < 9000),(p6 == 9000),(p6 > 9000)]low.,almost 9000?!,9000!,OVER 9000!!!]

Anyways, I think this makes for completely unreadable Markdown, which is the totally opposite direction of what it ought to be.


I think this is very suitable description of today's HN - I'd just love this to emphasized more clearly, since it seems like a common mistake to believe that HN is about actual ground-breaking stuff. It's not even if it were ment to be just that.

I must say that I agree with people stating that people should present their creative works here, with the intention of getting feedback of the product - How is it any relevant for any other HN reader (than OP), that we praise him/her as a person, rather than the product? The FAQ states, that relevant information is "anything that gratifies one's intellectual curiosity" - Of course that's a quite vague definition, but still this is hardly intellectually stimulating.


Atwood's law strikes again.


May be off-topic but: Is it just me, or are macros just a new way to get confused while reading JavaScript? Introducing language-foreign syntactic constructs seems to me superfluous and confusing - This is the job of transcompiling languages like CoffeeScript.


Reading the macros first helps. They must be defined at top of program or module, if I recall sweetjs.org's design correctly, for the staged hygienic expansion to work well.

Aside from that, you're right. But JS has higher order functions and objects with ad-hoc methods, so it can be used according to many paradigms, which can make it hard for a reader unfamiliar with the dominant paradigm in code at hand.

This is not a deal-killer for macros, although with sweet.js as the prototyping tool, your assertion about "This is the job" is satisfied. Sweet.js works with node to do AOT macro expansion at present. There's effort to integrate it in the browser too, but this will be easier with ES6 module loaders (not yet prototyped in SpiderMonkey or V8).


Of course, as in every aspect of understanding, here for source code, it is important first to learn the context, here the macro definitions. My concern is that this will impose more than just a paradigm - it will impose new syntax which could effectively completely ruin the readability of JavaScript source.

The macro syntax is definitely not simple, and it could possibly get really complex for more elaborate syntactic definitions, thus rendering the source much less readable. Is the overall benefits of introducing macros to JavaScript really worth the costs of readability? And does the effort to integrate macros into the browser mean that it'll be possible to evaluate macros "runtime"?


> The macro syntax is definitely not simple, and it could possibly get really complex for more elaborate syntactic definitions, thus rendering the source much less readable.

True, but the same can be said of any API. Reading the definitions can help but for both complex macros and complex APIs built today out of just functions and objects you need to document your abstractions. Macros don't change this, they just give you another abstraction axis (syntactic) to work with.

As with most things it just depends on how you use it. Sure you can abuse macros to make tons of crazy, undocumented, hard to understand syntactic extensions that destroy readability. But you can already do that today. Used wisely macros can increase readability, used poorly they can decrease it.

> And does the effort to integrate macros into the browser mean that it'll be possible to evaluate macros "runtime"?

Not sure what you mean here. By definition macros are expanded at compile time (well, parse time really). The browser doesn't change this.


I meant compile time of course, thank you for your clarifications. I'm eager to see how this turn out.


All abstractions can make your code unreadable; the key, as always, is to create good abstractions and document them clearly. Macros are syntactic abstractions. It's just as important to document them as it is for functions or objects. Of course, if you just have a little local macro that you're using for convenience, looking at the implementation may be sufficient. But when you write a macro that you want to share from a module, rather than requiring your clients to read the implementation, you document the syntax and the semantics, just like you would if you were writing a separate language.

But by having macros directly in JS, instead of having to use a whole language that compiles to JS, you can combine syntactic features from different sources. For example, right now there's no way to use one feature you like from CoffeeScript with another feature you like from TypeScript. You just can't combine them. But with macros, you could import two different syntaxes from two different libraries and use them in the same code.

On top of that, if we actually had macros in a future version of the standard, you wouldn't even have to precompile the macros offline, and you wouldn't need a preprocessing step at all. (For latency purposes, you might want to preprocess macros offline as an optimization. But for development, not having to do a preprocessing step is more convenient.)

Dave


So this is all in the holy name of making JavaScript the assembly language of the web? Making it possible for every JavaScripter to write "his own" JavaScript syntax definitions meaning that I'll (as a contributor or just casual watcher) would have to read his whole collection of macros before I could begin to understand the code?

I don't think this can be compared to API's as they still follow the regular syntactic definitions - This will be like reading a completely new language every time I read a different repository. (Of course this is a worst-case scenario as I imagine that many macros will be used across several projects, but still.)

Is all hope gone for writing vanilla JS gone? And isn't macros kinda going in the opposite direction than the ES specs? There's no use for many of the ES6/7 features as they could just be mocked up in macros.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: