diff -urN midi_prog-/Makefile midi_prog/Makefile --- midi_prog-/Makefile Wed Jun 3 00:00:00 2015 +++ midi_prog/Makefile Thu Jun 25 00:00:00 2015 @@ -1,6 +1,6 @@ CC = gcc LIB = -lm -lpthread -L../cui -lcui -TARG = prog59 +TARG = prog60 OBJS = main.o vcf.o ch.o delay.o stat.o note.o env.o tone.o filter.o lfo.o modu.o vco.o wave.o out.o rd.o util.o OBJS += rec.o OBJS += cui_tone.o diff -urN midi_prog-/midtxt.c midi_prog/midtxt.c --- midi_prog-/midtxt.c Sun Jun 21 00:00:00 2015 +++ midi_prog/midtxt.c Thu Jun 25 00:00:00 2015 @@ -256,20 +256,20 @@ } int -len_get_hl(char *buf, int div4) +len_get_hl(char *buf, int div4, int n4) { int h, l = 1; int ret = sscanf(buf, "%d/%d", &h, &l); if(ret == 0) ERR("format"); - return div4 * 4 * h / l; + return div4 * n4 * h / l; } void -len_get(char *len_buf, int div4, int *len, int *len_on) +len_get(char *len_buf, int div4, int n4, int *len, int *len_on) { - *len = *len_on = len_get_hl(len_buf, div4); + *len = *len_on = len_get_hl(len_buf, div4, n4); if((len_buf = strchr(len_buf, '(')) == NULL) return; - *len_on = len_get_hl(len_buf+1, div4); + *len_on = len_get_hl(len_buf+1, div4, n4); } int @@ -425,6 +425,7 @@ len_to_delta_conv(int ac, char **av) { int div4 = opt_int("-div4", ac, av, 96); + int n4 = opt_int("-n4", ac, av, 4); int def_ch = opt_int("-ch", ac, av, 0); int def_velo = opt_int("-velo", ac, av, 100); int len, len_on, ch, note, velo, delta, l_ac, i; @@ -442,7 +443,7 @@ fputs(buf, stdout); continue; } - len_get(len_buf, div4, &len, &len_on); + len_get(len_buf, div4, n4, &len, &len_on); notes_str = opt_prefix("note=", l_ac, l_av); chord_str = opt_prefix("chord=", l_ac, l_av); diff -urN midi_prog-/note.c midi_prog/note.c --- midi_prog-/note.c Wed Jun 3 00:00:00 2015 +++ midi_prog/note.c Thu Jun 25 00:00:00 2015 @@ -4,6 +4,7 @@ struct note_rec note_buf[NOTE_BUF_N]; static int note_pure = 0, note_base = -1, note_pure_cent = 25; +static int pure_enable[MIDI_CH_N]; static double note_base_freq; static struct{ @@ -26,8 +27,18 @@ void note_init(int ac, char **av) { + int ch, v; + char *s; + note_pure = opt_idx("-pure", ac, av) >= 0; note_pure_cent = opt_int("-pure_cent", ac, av, note_pure_cent); + + for(ch=0; chch ]) continue; if(note_is_free(nt) || !nt->onoff || note_is_fix(nt)) continue; if(abs_cent(nt->note_pbend, ¬e) > note_pure_cent) continue; j = (note - base) % 12; @@ -155,6 +167,7 @@ for(i=0; ich != ch) continue; + if(!pure_enable[ nt->ch ]) continue; if(note_is_fix(nt)) continue; note_update_bend_note(nt); } diff -urN midi_prog-/tone.c midi_prog/tone.c --- midi_prog-/tone.c Sun Apr 19 00:00:00 2015 +++ midi_prog/tone.c Thu Jun 25 00:00:00 2015 @@ -246,6 +246,7 @@ "FX 8 (sci-fi)", /* 105 */ + "Sitar", "Banjo", "Shamisen", "Koto", @@ -255,6 +256,7 @@ "Shanai", /* 113 */ + "Tinkle Bell", "Agogo", "Steel Drums", "Woodblock",