Note

Constructor

rollcallstring[0,1,2,3,4,5,6,7]/1#.2b
durationnumber1,1/2,1/4,1/8,1/12,1/16
freqIndexnumberthe index of the note array(Defalut 0)
hasDotstringWhether has dot
isPartstringonly for complie
var note = new Jsonic.Melody.Note(0,1/2,0,true);

Property

Rollcallstring[0,1,2,3,4,5,6,7]/1#.2b
FreqIndexnumberthe index of the note array(Defalut 0)
Durationnumber1,1/2,1/4,1/8,1/12,1/16
HasDotstringWhether has dot
_lenstringThe real duration with the dot
BaseRollCallstring[0,1,2,3,4,5,6,7]
HalfRollCall0,-1,1#,b

Method

.divid()

private method for complie

remainnumberDuration
sectionMaxnumberThe max length of a section

.setDot()

To set the _len of new Object

MusicScore

Constructor

alphabetstringC,D,E,F,G,A,B
intervalNamestring'major' | 'minor' | 'major5' | 'minor5'
beatstring'4/4','3/4','6/8'
var musicSocre = new Jsonic.Melody.MusicScore('E','major','4/4');

Property

ModeObjectStore base information
DataArrayThe Notes in the music score
SectionsArrayThe Notes which have been complied
IsCompiledstringWhether has been complied
FreqChatObjectThe frequent of notes

Method

.w()

Append note to music score

musicSocre.w(new Jsonic.Melody.Note(3),new Jsonic.Melody.Note(4));

.d()

Delete note from music score

indexnumberstart position
numnumberthe number of note
musicSocre.d(0,1);

.u()

update note from music score

arguments[0]numberstart position
arguments[1]numberhow many
arguments[2+]ObjectNew notes
musicSocre.u(0,2,new Jsonic.Melody.Note(3),new Jsonic.Melody.Note(4));

.r()

Read note from music score

startnumberstart position
endnumberend position
returnArrayNotes
musicSocre.r(0,1);

.reverse()

Reverse the data in music score

musicSocre.reverse();

.merge()

Append a music score to the current music score

musicSocre.merge(musicSocre2);

.compile()

Complie music score for track to play

musicSocre.compile();

Track

Constructor

contextObject | nullAudio Contect
var track = new Jsonic.Melody.Track();

Property

CtxObjectThe contect of the track
IsRunningbooleanIs Running
AnalyserNodeObjectweb aduio analyserNode
WaveShaperNodeObjectweb aduio waveShaperNode

Method

.play()

play a music score

musicScoreObjectthe instance of MusicScore
speednumberhow many 1/4 note in a minute
curvenumberthe amount of curve
track.play(musicSocre,90);

.stop()

Stop playing

track.stop();