;ς "{ψ@c@sΚdkZdkZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZdS(NcCst|dƒadS(Nsw(sopens device_argsport(s device_arg((smidi_functions.pys open_portscCs@|d@}|d?}tidd|||fƒtiƒdS(Niis%c%c%ciΰ(sbendslow_bytes high_bytesportswriteschannelsflush(schannelsbends high_byteslow_byte((smidi_functions.pys pitch_bend s   cCs0tidd|d|dfƒtiƒdS(Ns%c%c%ciΰii€(sportswriteschannelsbendsflush(schannelsbend((smidi_functions.pyspbs"cCs,tidd|||fƒtiƒdS(Ns%c%c%ci(sportswriteschannelsnotesvolumesflush(schannelsnotesvolume((smidi_functions.pysnote_onscCs,tidd||dfƒtiƒdS(Ns%c%c%ci€i(sportswriteschannelsnotesflush(schannelsnote((smidi_functions.pysnote_offscCsCx<tdƒD].}tidd|ddfƒtiƒq WdS(Nis%c%c%ci°i{i(srangeschannelsportswritesflush(schannel((smidi_functions.pys all_notes_off#s  cCstiƒdS(N(sportsclose(((smidi_functions.pys close_port)scCsmd}t|idƒƒ}|d@}x=|d@djo+t|idƒƒ}|d>|d@}q(W|SdS(Niiii€i(soutputsordsfpsreadsinbyte(sfpsoutputsinbyte((smidi_functions.pysread_var_length/s cCsŒdkl}g}|i|d@ƒ|dL}x1|djo#|i|d@dBƒ|dL}q1W|iƒx|D]}t|ƒGHqsWdS(N(sstdoutiiii€(ssyssstdouts result_arraysappendsvarsreversesitemshex(svarsitems result_arraysstdout((smidi_functions.pyswrite_var_length8s    cCst|ƒddjo dGHdSndddddg}x•tt|ƒdƒD]}}||d|d d!}d}x&|D]}||d @B}|d ?}q|W|i|ƒx|D]}|i|d @ƒq²WqPW|id ƒx)|D]!}t i d |ƒt i ƒqεWdS(Niis2data array must be a multiple of 7 bytes in lengthiπiBi0i6iQii€iiχs%c( slens data_arrays out_arraysrangesmultsworking_data_arrays first_bytesitemsappendsportswritesflush(s data_arraysworking_data_arraysitems first_bytes out_arraysmult((smidi_functions.pysglobal_data_dumpJs,  cCs2|djp ||jo|||Sn|SdS(Ni(sindexsmax(sindexsmax((smidi_functions.pysbounce`scCst||d|ƒSdS(Ni(sbouncesindexsmax(sindexsmax((smidi_functions.pyssee_sawfscCs*t|dƒatid||fƒdS(NswsMFile %i %i 120 MTrk (sopensfiles text_fileswritesmidi_file_types num_channels(sfilesmidi_file_types num_channels((smidi_functions.pysmidi_text_openlscCstiƒdS(N(s text_filesclose(((smidi_functions.pysmidi_text_closerscCstidƒdS(Ns TrkEnd MTrk (s text_fileswrite(((smidi_functions.pysmidi_text_new_channelvscCstidƒdS(NsTrkEnd (s text_fileswrite(((smidi_functions.pysmidi_text_final_trkendzscCs"tid||d|fƒdS(Ns%i Pb ch=%i v=%i i(s text_fileswritestimeschannelsbend(stimeschannelsbend((smidi_functions.pysmidi_text_pitch_bend~scCs%tid||d||fƒdS(Ns%i On ch=%i n=%i v=%i i(s text_fileswritestimeschannelsnotesvolume(stimeschannelsnotesvolume((smidi_functions.pysmidi_text_note_on‚scCs"tid||d|fƒdS(Ns%i Off ch=%i n=%i v=0 i(s text_fileswritestimeschannelsnote(stimeschannelsnote((smidi_functions.pysmidi_text_note_off†scCs/td|dƒ}tid||fƒdS(Nf60.0i@Bs %i Tempo %i (sintstempos text_fileswritestime(stimestempo((smidi_functions.pysmidi_text_tempoŠs(sstringsoss open_ports pitch_bendspbsnote_onsnote_offs all_notes_offs close_portsread_var_lengthswrite_var_lengthsglobal_data_dumpsbouncessee_sawsmidi_text_opensmidi_text_closesmidi_text_new_channelsmidi_text_final_trkendsmidi_text_pitch_bendsmidi_text_note_onsmidi_text_note_offsmidi_text_tempo(s pitch_bends close_portsbouncesnote_offsmidi_text_temposmidi_text_note_onsmidi_text_closes open_portspbssee_sawsmidi_text_new_channelsstringsmidi_text_final_trkendsmidi_text_opensmidi_text_pitch_bends all_notes_offsnote_onsread_var_lengthsmidi_text_note_offsglobal_data_dumpsosswrite_var_length((smidi_functions.pys?s*