Skip to content

Conversation

@marwahaha
Copy link
Contributor

No description provided.

@marwahaha
Copy link
Contributor Author

This is code from @achalddave merged with the most recent version of Snap, and with the timeout removed. In some sense, #91 + morphic.

@pconrad I can work on integrating the ADSR work you've done in #95 (unless you have more recent code to work with)

@jmoenig I'm really enjoying this!

@pconrad
Copy link

pconrad commented Jun 26, 2014

Kunal,
I suggest starting with that code, and then we can make adjustments as
needed.

One thing we will likely want to do is this: instead of a separate "play
guitar string" block, we would want "guitar" to simply be another
instrument, and invoke Achal Dave's code when guitar is the selected
instrument. We may want to choose the number used in Standard MIDI for
acoustic guitar, in the hopes that over time we can synthesize other
approximations of instruments from the General MIDI spec.
On Jun 26, 2014 1:53 AM, "Kunal Marwaha" notifications@github.com wrote:

This is code from @achalddave https://github.com/achalddave merged with
the most recent version of Snap, and with the timeout removed. In some
sense, #91
#91 +
morphic.

@pconrad https://github.com/pconrad I can work on integrating the ADSR
work you've done in #95
#95 (unless
you have more recent code to work with)

@jmoenig https://github.com/jmoenig I'm really enjoying this!


Reply to this email directly or view it on GitHub
#489 (comment)
.

@marwahaha
Copy link
Contributor Author

Okay! All things are merged together except for the ADSR envelope. I think it's best practice to make a subclass ADSRNote from Note to implement the envelope. I have begun work but haven't got it working yet. This version in this pull request is working and with the requested changes (single block, etc)

@achalddave
Copy link

Minor note: Could we add instrument enum so that we can specify instruments by, e.g., instrument.Sine instead of 129?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these going to be added back in before the code is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add them back, but they don't have implementations....

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably makes sense only to add the ones that have implementations.
On Jun 29, 2014 8:39 PM, "Kunal Marwaha" notifications@github.com wrote:

In blocks.js:

@@ -781,16 +781,21 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
null,
true,
{

  •                '(1) Acoustic Grand' : 1,
    
  •                '(2) Bright Acoustic' : 2,
    
  •                '(3) Electric Grand' : 3,
    
  •                '(4) Honky Tonk' : 4,
    
  •                '(5) Electric Piano 1' : 5,
    
  •                '(6) Electric Piano 2' : 6,
    
  •                '(7) Harpsichord' : 7
    
  •                // '(1) Acoustic Grand' : 1,
    

I can add them back, but they don't have implementations....


Reply to this email directly or view it on GitHub
https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/489/files#r14334681
.

@marwahaha
Copy link
Contributor Author

@pconrad @jmoenig

I did most of the integration - I think it makes sense to have certain types of notes (subclass) follow an ADSR envelope.

What's missing in this integration is a set of functions of ADSRNote that handle the setting of the envelope.

Thoughts?

@brianharvey
Copy link
Collaborator

What is the status of this? Do you all think there's something ready to pull?

@marwahaha
Copy link
Contributor Author

Yes, please try it out @brianharvey @pconrad @jmoenig @cycomachead

@marwahaha
Copy link
Contributor Author

@brianharvey
Copy link
Collaborator

Waiting for @pconrad to be done with it.

@marwahaha
Copy link
Contributor Author

Any update @pconrad ?

@pconrad
Copy link

pconrad commented Sep 25, 2014

So, @msalexallen and I are working on this finally---she just got back from a year studying abroad in the UK.

We are finding that a lot of our code that was working before---as well as the code in this pull request---is no longer working. I see that the W3C just issued a new draft of the Web Audio API on 11 September 2014, and I'm wondering if we are dealing with a moving target?

I sent @marwahaha an email with a screenshot of the problem we ran into when trying to test this code---basically when you try to play a note, you get this:

screenshot 3

Can anyone else either confirm that they see the same problem, or that they ARE able to play notes with the code in this pull reuqest? If its is just a local problem for us, that would be helpful to know. If instead, it is that something has changed in the browsers implementation of the Web Audio API, that would also be helpful to know.

@achalddave
Copy link

Seems to me that createGainNode has been renamed to createGain. Unfortunately this is just from debugging on the link that Kunal posted since I don't have things set up locally, but I'm almost certain that a simple s/createGainNode/createGain/g will fix this.

@achalddave
Copy link

@pconrad
Copy link

pconrad commented Sep 29, 2014

Achal Dave----thanks for the recon. I'll get together with Alex and see
if we can use that to figure out where to go from here.

On Mon, Sep 29, 2014 at 1:19 PM, Achal Dave notifications@github.com
wrote:

More generally, here are things that we may need to change:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext


Reply to this email directly or view it on GitHub
#489 (comment)
.

Phill Conrad, Lecturer (SOE)*, Dept. of Computer Science
University of California, Santa Barbara
Joint Appointment: College of Creative Studies (www.ccs.ucsb.edu)

pconrad@cs.ucsb.edu, www.cs.ucsb.edu/~pconrad

*SOE: a UC teaching faculty appointment, corresponding in rank and job
security to a tenured associate professor

@marwahaha
Copy link
Contributor Author

I've updated to conform with the Web Audio API changes @pconrad . There is still some popping noise - perhaps you could look into it?

@marwahaha
Copy link
Contributor Author

The link should work again.

@marwahaha
Copy link
Contributor Author

any update on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get "SyntaxError: An invalid or illegal string was specified" when I try to play a note (FF 36).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants