waterbearlang / waterbear

Visual block syntax for programming languages
http://waterbearlang.com/
358 stars 88 forks source link

Starting new audio lib #1248

Closed alexjsmac closed 8 years ago

alexjsmac commented 8 years ago

Not ready to merge but feel free to try it out.

CelticMinstrel commented 8 years ago

This seems like a good step. I assume you plan a lot more new blocks.

alexjsmac commented 8 years ago

Awesome :+1: and indeed I do

dethe commented 8 years ago

I want to play with this but am not sure where to begin. Can you post a Gist (or add example or more) which exercises the new blocks to give a starting point and reference?

alexjsmac commented 8 years ago

@dethe For sure I'll do that right now

dethe commented 8 years ago

:+1:

alexjsmac commented 8 years ago

As of tonight we now have chords, check out gist ea53332c53d85fbb7a7d for a quick example

dethe commented 8 years ago

Sweet! Sounds great.

CelticMinstrel commented 8 years ago

I don't know how to use that hash to find the gist. Isn't there a way to actually link to it rather than posting the hash?

Also, I don't see anything in the diff that suggests chords. Did you not commit that yet, or did I miss it?

alexjsmac commented 8 years ago

You can load a gist with that hash. The chord was made with several note blocks that execute at once so you wouldn't see a reference to chords just in the code.

CelticMinstrel commented 8 years ago

Oh, you mean it's meant to be used in the Waterbear interface itself? I was trying to view it on GitHub.

Maybe I'll check it out at some point, then.

alexjsmac commented 8 years ago

One option for composing a bit of music is using Music Macro Language (https://en.wikipedia.org/wiki/Music_Macro_Language). Pretty easy syntax to pick up.

CelticMinstrel commented 8 years ago

The MML block doesn't seem intuitive to me (who will know what MML is?). Also, Wikipedia seems to be unclear on whether MML can make chords.

alexjsmac commented 8 years ago

Yeah it definitely involves a learning curve but it's just one option. Simple enough to learn the basics quickly. I am having trouble getting notes to play one after the other without it.

dethe commented 8 years ago

If we have to go the way of embedding a mini-language I would prefer to go with something more well-known like ABC (https://en.wikipedia.org/wiki/ABC_notation), but ultimately we should hide the details behind blocks, at least until we add support for quick expression blocks ( #192 ).

CelticMinstrel commented 8 years ago

I think you misunderstood me. It's not the choice of MML that I'm complaining about, it's the interface of the block that doesn't do a good job explaining what you're supposed to put there.

alexjsmac commented 8 years ago

Okay this is ready to be merged now, except that I haven't figured out how to get the new audio icons to fit right/appear at all in the wb-value's and wb-expression's. Maybe someone could shed some light on that?

alexjsmac commented 8 years ago

Here's a gist to show how to write melodies out: 6cbf5a2509ceb1ffd81b

CelticMinstrel commented 8 years ago

Okay, so the note blocks and such write to some sort of "temporary buffer" which is used by the play block?

Regarding the conflicts to be resolved, I've already merged them in my local copy, so I could push them as soon as @dethe gives the okay. Unless he'd rather do it himself.

By the way, how do you do chords with this? The previous gist on that appears to be out-of-date.

dethe commented 8 years ago

@amaclean199 Whenever there are known issues (like the icons) in a PR, go ahead and file an issue for them (if there is more than one known issue, file one each) and reference the new issue(s) in the PR.

dethe commented 8 years ago

@CelticMinstrel: I've been letting the assignee push the final merge, but could you push your changes that resolve the merge conflict into this PR branch?

CelticMinstrel commented 8 years ago

Sorry, that would require me to have write access to @amaclean199 's copy of the Waterbear repo, so I can't do it. That said... I didn't actually get any conflicts when I merged (not sure why github says there are some), so it shouldn't be too hard for him to do it himself.

dethe commented 8 years ago

@CelticMinstrel You can make a pull request targeting @amaclean199 's repo and branch, or he can just merge in from master, either way is OK with me.

alexjsmac commented 8 years ago

@dethe both keyboard.js and ndict.js were requirements for the keyboard block and were provided by Timbre so I just dropped them in lib. Does that affect how we consider the comments you made on them?

alexjsmac commented 8 years ago

By the way, how do you do chords with this? The previous gist on that appears to be out-of-date.

  • @CelticMinstrel

I have repurposed those not blocks for melodies. I was thinking I would make a chord block.

alexjsmac commented 8 years ago

So do you want me to merge even with the audio icon issue still open ( #1288 )?

CelticMinstrel commented 8 years ago

A chord block might be fine, though I wonder how you'd do it. Logically, a chord is simply a set of notes just like a melody is a set of notes.

And then, what about counterpoint? It's not uncommon to want to play two different melodies simultaneously.

alexjsmac commented 8 years ago

Fixes issue #825

alexjsmac commented 8 years ago

Fixes issue #1189 too