-- $NWCUT$CONFIG: FileText $ nwcut.setlevel(2) nwcut.status = nwcut.const.rc_Succes --nwcut.status = nwcut.const.rc_Report local progname = 'tempo change' local HelpMsg = [[ This tool changes the tempo with the % as a parameter ]] -------------------------------------- -- Main processing ------------------- -------------------------------------- assert(nwcut.getprop('Mode') == nwcut.const.mode_FileText, "Input type must be 'File Text'") assert(nwcut.getprop('ReturnMode') == nwcut.const.mode_FileText, "Under 'Options', check 'Returns File Text'") tempochange = nwcut.prompt("change tempo with N %. \n N =", "#",120,100) counter = 0 ; for item in nwcut.items() do if item:Is('Tempo') then counter = counter + 1 old_Tempo = item.Opts.Tempo new_Tempo = old_Tempo * tempochange / 100 item.Opts.Tempo = new_Tempo end--if nwcut.writeline(item) end--for --print (counter .. ' notes/chords were muted.') nwcut.msgbox("# of tempo changes: " .. counter, "tempo changes")