Rock Bar html5! Audio Front-end interaction! (Hello, jsonic!)

Source: Internet
Author: User

Software engineers tinker with 1 and 0 to write their utopia, musicians who play with 12 average-law notes to build their Garden of Eden. Recently, I accidentally saw the "blue Bones" of the film, the actor is a hacker, but also a musical creative talent. In real life, although this is not typical, but is not a special case, I have some fiddling with 0 and 1 of friends, slightly emotional fever.

Previous blog post Rock Bar html5! Audio Front-end interaction! (a) , I introduced the 12 average law, introduced the pitch and value, and talked about its implementation in web audio. At this rhythm, the legato spectrum has a tune. Through this series of blog posts, I have compiled the audio interaction-related JavaScript framework that I wrote before, creating the jsonic.js. With Jsonic.js, audio visualization, speech recognition, audio encoding and composing can be achieved. This article describes how to use Jsonic.js to compose music.

  official website http://jsonic.net

Jsonic's composer module is named Melody, where note, Musicscore, and Track3 classes correspond to the implementation of notes, music scores, and audio tracks, respectively. For specific documentation, bash the API!

Note Object can specify the note's roll, time value (full note, 1/2 notes, 1/4 notes ... ), pitch in the word group (default 0, small group), whether there is an attachment point

var New Jsonic.Melody.Note (1,1/2,0,true);

The Musicscore object can specify the mode, and the beat. The following code creates a score of 4/4 beats in E major.

var New Jsonic.Melody.MusicScore (' E ', ' major ', ' 4/4 ');

By changing the mode of the Musicscore, it is convenient to perform the lifting and lowering, and the Musicscore W method can write the note to the score and call the Complie method before playing.

MUSICSOCRE.W (new Jsonic.Melody.Note (3),new Jsonic.Melody.Note (4));

Track objects are used to play Musicscore objects, multiple track objects can play simultaneously, and chords and harmonies can be achieved using the same principle.

var New Jsonic.Melody.Track ();

Call the Play method to play the score, and you can specify the speed of the play, referring to the concept of the value mentioned earlier.

Track.play (musicscore,90);

can refer to the "until the end of the world" Demo, please click Start to play, exposure to childhood ... The demo also realizes the visualization of the signal in the frequency domain and expands it later.

Front-end is a composite career, a composition, I hope that the common progress.

  Giithub https://github.com/ArthusLiang/jsonic

  Forwarding Please specify the source:http://www.cnblogs.com/Arthus/p/4218572.html

Rock Bar html5! Audio Front-end interaction! (Hello, jsonic!)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.