main.cpp,cfg : Latest update.

This commit is contained in:
kevin 2023-12-03 11:34:05 -05:00
parent 454e08618f
commit 01e91db221
3 changed files with 325 additions and 91 deletions

View File

@ -28,11 +28,44 @@
122,
127
],
"enableFl": false,
"enableFl": true,
"defaultFl": true,
"device": "sampler",
"name": "ivory"
},
{
"table": [
1,
1,
2,
2,
3,
5,
8,
10,
13,
16,
20,
24,
28,
33,
38,
43,
49,
55,
62,
68,
72,
85,
94,
103,
112
],
"enableFl": true,
"defaultFl": true,
"device": "piano",
"name": "spirio"
},
{
"table": [
1,
@ -62,9 +95,9 @@
83
],
"enableFl": false,
"defaultFl": true,
"defaultFl": false,
"device": "piano",
"name": "spirio"
"name": "spirio_1"
}
],
"incr_pitch": 3,

View File

@ -19,6 +19,7 @@
fileSys: {},
numbCvt: {},
object: {},
objectToJson: {},
vop:{},
time:{},
thread: {},
@ -343,12 +344,52 @@
midifile:
{
//rpt0: { midiFn:"~/media/audio/midi/988-v25.mid" }
// rpt_beg_end: print the first and last 'msg' count msgs in 'midi_fname'.
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_5/midi.mid",
msg_cnt: 10,
note_on_only_fl: true,
},
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_7/midi.mid",
msg_cnt: 5,
note_on_only_fl: true,
},
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_11/midi.mid",
msg_cnt: 5,
note_on_only_fl: true,
},
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_13/midi.mid",
msg_cnt: 5,
note_on_only_fl: true,
},
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_17/midi.mid",
msg_cnt: 5,
note_on_only_fl: true,
},
rpt_beg_end: {
midi_fname: "~/temp/shiau_uen/record_23/midi.mid",
msg_cnt: 5,
note_on_only_fl: true,
},
}
midifile0:
{
// rpt: Print a MIDI file report for the listed midi files.
// rpt: { midiFn:"~/media/audio/midi/988-v25.mid" }
// rpt: { midiFn:"~/src/currawong/audio/workshop/demare2/record_5/midi.mid"}
// csv: Convert MIDI files to CSV files
// csv: { midiFn:"~/src/currawong/audio/workshop/demare2/record_5/midi.mid", csvFn: "midi.csv" }
//csv0: { midiFn:"~/src/currawong/site/web_part_selection/GUTIM part 1 no colors, single system all sections correcting staves distance.mid",
// csv: { midiFn:"~/src/currawong/site/web_part_selection/GUTIM part 1 no colors, single system all sections correcting staves distance.mid",
// csvFn: "~/temp/midi.csv" }
// batch_convert: Convert all the MIDI files in
// <io_dir>/<session_dir>/record_<take_number>/midi.mid to CSV files.
batch_convert: {
io_dir: "~/src/currawong/audio/workshop",
session_dir: "beck1",
@ -852,13 +893,25 @@
convolve: {},
piano_score:{
filename: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg",
//filename: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg",
//filename: "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data/beck1/record_5/play_score.csv"
filename: "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data/score/20231028/temp.csv"
}
audio_transforms: {},
am_to_midi_file: { inDir: "~/src/currawong/audio/workshop/nonken2" },
// Convert the the 'am' files in 'inDir' to MIDI and CSV files
// named 'midi.mid' and 'midi.csv'.
// The 'beg_loc' and 'end_loc' will be written to a file named 'meta.cfg'.
// All output files are written in the same directory as the 'am' files.
am_to_midi_file: [
{ enable_fl: true, player_name: "beck", prefix_label:"beck_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck1" },
{ enable_fl: true, player_name: "beck", prefix_label:"beck_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck2" },
{ enable_fl: true, player_name: "taka", prefix_label:"taka_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka1" },
{ enable_fl: true, player_name: "taka", prefix_label:"taka_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka2" }
],
audio_file_proc: {
srcFn: "/home/kevin/src/currawong/audio/GUTIM_All_20200711_96k_float.wav",
@ -1385,7 +1438,6 @@
}
},
pva: { class: pv_analysis, in:{ in:ain.out }, args:{ default:{ wndSmpN:[2048,1024], hopSmpN:[512,256], hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:[kc b] },
pvs: { class: pv_synthesis, in:{ in:sd.out }, },
@ -1607,16 +1659,13 @@
},
socket: {
maxSocketCnt: 10,
recvBufByteCnt: 4096,
threadTimeOutMs: 50,
socketL: [],
}
flow: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle
maxCycleCount: 15000, // 0 disables maxCycleCount
@ -1829,95 +1878,164 @@
},
score_follow: {
srate: 48000,
out_dir: "~/temp/score_follow_test_1",
pre_test_fl: true,
show_muid_fl: false,
score_report_fl: false,
score_csv_fname: "/home/kevin/src/currawong/projects/score_proc/temp.csv",
score_parse_warn_fl: false, // print score parse warnings
score_warn_fl: false, //print SF score warnings
score_report_fl: false, // Generate an SF score report
out_score_rpt_fname: "score_report.txt",
dyn_tbl_report_fl: false, // Print the dynamics table report
score_wnd_locN: 10, // score follower score search window
midi_wnd_locN: 7, // score folloer MIDI sequence length
track_print_fl: false, // print output from the sfTrack unit
// if true score follower backtracking overwrites previous result records with new alignments
// otherwise new result records are generated for new alignments.
track_results_backtrack_fl: false,
print_rt_events_fl: false, // print real-time score following output events from cwScoreFollowTest.cpp
pre_test_fl: false, // Add a single random note prior to the first note in the sequence
show_muid_fl: false, // Show muid in the MIDI note representation of the SVG output.
meas_enable_fl: true, // enable performance measurements
meas_setup_report_fl: false, // generate a performance measurement config. report (locations of sets,'calcs' and sections)
out_dir: "~/temp/score_follow_test_2",
// each of these files will be written to the dir: <out_dir>/<perf_label>
write_perf_meas_json_fl: false,
out_perf_meas_json_fname: "perf_meas.json",
write_svg_file_fl: false,
out_svg_fname: "sf_results.html",
out_cm_score_rpt_fname: "cm_score_report.txt",
write_sf_analysis_csv_fl: false,
out_sf_analysis_csv_fname: "sf_analysis.csv",
write_midi_csv_fl: false,
out_midi_csv_fname: "midi.csv",
cfg: {
enable_flag: true,
cm_score_csv_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv",
search_area_locN: 10,
key_wnd_locN: 7,
dyn_ref:
dyn_ref: [
{ mark: "silent", level:0, vel:1 },
{ mark:"pppp-", level:1, vel:3 },
{ mark:"pppp", level:2, vel:5 },
{ mark:"pppp+", level:3, vel:7 },
{ mark:"ppp-", level:4, vel:10 },
{ mark:"ppp", level:5, vel:15 },
{ mark:"ppp+", level:6, vel:20 },
{ mark:"pp-", level:7, vel:25 },
{ mark:"pp", level:8, vel:30 },
{ mark:"pp+", level:9, vel:35 },
{ mark:"p-", level:10, vel:40 },
{ mark:"p", level:11, vel:45 },
{ mark:"p+", level:12, vel:50 },
{ mark:"mp-", level:13, vel:55 },
{ mark:"mp", level:14, vel:60 },
{ mark:"mp+", level:15, vel:65 },
{ mark:"mf-", level:16, vel:70 },
{ mark:"mf", level:17, vel:75 },
{ mark:"mf+", level:18, vel:80 },
{ mark:"f-", level:19, vel:85 },
{ mark:"f", level:20, vel:90 },
{ mark:"f+", level:21, vel:95 },
{ mark:"ff", level:22, vel:100 },
{ mark:"ff+", level:23, vel:105 },
{ mark:"fff", level:24, vel:115 },
{ mark:"fff+", level:25, vel:120 },
{ mark:"ffff", level:26, vel:125 },
]
// Generate the 'play_score.csv' by syncing a performed MIDI file to
// the score. This allows the file to be played back via cwIoPresetSelApp.
gen_synced_perf_files:
{
"silent": 1,
"pppp":10,
"ppp_m":20,
"ppp":25,
"ppp_p":30,
"pp_m":30,
"pp":35,
"pp_p":40,
"p_m":40,
"p":45,
"p_p":50,
"mp_m":50
"mp":55
"mp_p":60,
"mf_m":60,
"mf":65,
"mf_p":70,
"f_m":70,
"f":75,
"f_p":80,
"ff":85,
"fff":100,
"ffff":120
}
}
//1. first notes in shiau-uen 11 are duplicated.
// show muid in perf-notes to check if the duplicates are caused by backtracking
//
//2. valgrind shows a write error
enable_fl: true,
jobL: [
{ dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck1" },
{ dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck2" },
{ dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka1" },
{ dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka2" },
],
out_fname: "play_score.csv",
},
perfL: [
{
label: shiau_uen_5,
enable_fl: true,
start_loc: 327,
midi_fname: "~/temp/shiau_uen/record_5/midi.mid",
enable_fl: false,
player: JS,
perf_date: "20230904",
take: 1,
label: full_midi,
start_loc: 0,
end_loc:7825,
midi_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/GUTIM_20230904.mid"
},
{
label: shiau_uen_7,
enable_fl: false,
start_loc: 2547,
player: SD,
perf_date: "20230514",
take: 5,
label: shiau_uen_5,
start_loc: 120,
end_loc: 146,
midi_fname: "~/temp/shiau_uen/record_5/midi.mid",
},
{
enable_fl: false,
player: SD,
perf_date: "20230514",
take: 7,
label: shiau_uen_7,
start_loc: 888,
end_loc: 929,
midi_fname: "~/temp/shiau_uen/record_7/midi.mid",
},
{
label: shiau_uen_11,
enable_fl: false,
start_loc: 5361,
player: SD,
perf_date: "20230514",
take: 11,
label: shiau_uen_11,
start_loc: 2287,
end_loc: 2454,
midi_fname: "~/temp/shiau_uen/record_11/midi.mid",
},
{
label: shiau_uen_13,
enable_fl: false,
start_loc: 8291,
player: SD,
perf_date: "20230514",
take: 13,
label: shiau_uen_13,
start_loc: 3765,
end_loc:3883,
midi_fname: "~/temp/shiau_uen/record_13/midi.mid",
},
{
label: shiau_uen_17,
enable_fl: false,
start_loc: 11456,
player: SD,
perf_date: "20230514",
take: 17,
label: shiau_uen_17,
start_loc: 5407,
end_loc:5462,
midi_fname: "~/temp/shiau_uen/record_17/midi.mid",
},
{
label: shiau_uen_23,
enable_fl: false,
start_loc: 13565,
player: SD,
perf_date: "20230514",
take: 23,
label: shiau_uen_23,
start_loc: 6628,
end_loc: 6677,
midi_fname: "~/temp/shiau_uen/record_23/midi.mid",
}
]
@ -1979,11 +2097,13 @@
srate: 48000,
parse_fl: true, // do score parsing
parse_report_fl: false, // report parse
parse_report_fl: true, // report parse
parse_warn_fl: false, // show parser warnings
score_fl: true, // do sfscore processing
score_report_fl: false, // report sfscore
match_fl: true, // score match test
track_fl: true, // score track test
score_warn_fl: false, // show score warnings
match_fl: false, // score match test
track_fl: false, // score track test
dyn_ref: [
{ mark: "silent", level:0, vel:1 },
@ -2017,6 +2137,7 @@
sfmatch: {
// Generate an example performance
gen_perf_example:
{
enable_fl: false,
@ -2026,13 +2147,17 @@
maxScWndN: 10, // max size of the score alignment window
maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window
init_score_loc: 120, // initial score location
beg_perf_idx: 0, // first perf. index
perf_cnt: 7, // must be <= maxMidiWndN
perf: [
// init_score_loc = 0
perf0 [
{ muid:0 smpIdx:0 pitch:65 vel:44 },
{ muid:1 smpIdx:3600 pitch:63 vel:64 },
{ muid:2 smpIdx:7200 pitch:45 vel:64 },
{ muid:3 smpIdx:10800 pitch:30 vel:64 },
{ muid:4 smpIdx:14400 pitch:37 vel:64 },
{ muid:2 smpIdx:7200 pitch:45 vel:65 },
{ muid:3 smpIdx:10800 pitch:30 vel:66 },
{ muid:4 smpIdx:14400 pitch:37 vel:67 },
{ muid:5 smpIdx:18000 pitch:65 vel:112 },
{ muid:6 smpIdx:21600 pitch:87 vel:100 },
{ muid:7 smpIdx:21600 pitch:36 vel:88 },
@ -2042,6 +2167,22 @@
{ muid:11 smpIdx:638742 pitch:80 vel:100 },
]
// init_score_loc = 120
perf: [
{ muid:0 smpIdx:0 pitch:68 vel:44 },
{ muid:1 smpIdx:3600 pitch:35 vel:64 },
{ muid:2 smpIdx:7200 pitch:77 vel:65 },
{ muid:3 smpIdx:10800 pitch:42 vel:66 },
{ muid:4 smpIdx:14400 pitch:49 vel:67 },
{ muid:5 smpIdx:18000 pitch:75 vel:112 },
{ muid:6 smpIdx:21600 pitch:75 vel:100 },
{ muid:7 smpIdx:21600 pitch:46 vel:88 },
{ muid:8 smpIdx:21600 pitch:52 vel:30 },
{ muid:9 smpIdx:193028 pitch:58 vel:30 },
{ muid:10 smpIdx:330171 pitch:84 vel:88 },
{ muid:11 smpIdx:638742 pitch:50 vel:100 },
]
},
sftrack: {
@ -2050,6 +2191,8 @@
report_midi_file_fl: false,
report_track_fl: true,
print_fl: false,
backtrack_fl: true
perf:{
enable_fl:true,
@ -2057,6 +2200,63 @@
midi_fname:"/home/kevin/temp/shiau_uen/record_5/midi.mid"
}
}
},
translate_frags:
{
cur_frag_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/preset_select/m1_458.txt",
cur_score_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/score/temp.csv",
new_score_fname: "~/src/currawong/projects/score_proc/temp.csv",
out_frag_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/preset_select/m1_458_trans.txt",
cur_score_rpt_fname "~/temp/piano_score_preset_sel_rpt.txt"
new_score_rpt_fname "~/temp/sfscore_preset_sel_rpt.txt"
presets: {
preset_labelL: [ "dry", "a", "b", "c", "d", "f1", "f2", "f3", "f4", "g", "ga", "g1a", "g1d" ],
default_gain: 1.0,
default_wet_dry_gain: 0.5,
default_fade_ms: 50.0,
default_preset: "dry",
default_master_wet_in_gain: 1.0,
default_master_wet_out_gain: 1.0,
default_master_dry_gain: 1.0,
default_master_sync_delay_ms: 400, // spirio 400
},
srate: 48000,
dyn_ref: [
{ mark: "silent", level:0, vel:1 },
{ mark:"pppp-", level:1, vel:3 },
{ mark:"pppp", level:2, vel:5 },
{ mark:"pppp+", level:3, vel:7 },
{ mark:"ppp-", level:4, vel:10 },
{ mark:"ppp", level:5, vel:15 },
{ mark:"ppp+", level:6, vel:20 },
{ mark:"pp-", level:7, vel:25 },
{ mark:"pp", level:8, vel:30 },
{ mark:"pp+", level:9, vel:35 },
{ mark:"p-", level:10, vel:40 },
{ mark:"p", level:11, vel:45 },
{ mark:"p+", level:12, vel:50 },
{ mark:"mp-", level:13, vel:55 },
{ mark:"mp", level:14, vel:60 },
{ mark:"mp+", level:15, vel:65 },
{ mark:"mf-", level:16, vel:70 },
{ mark:"mf", level:17, vel:75 },
{ mark:"mf+", level:18, vel:80 },
{ mark:"f-", level:19, vel:85 },
{ mark:"f", level:20, vel:90 },
{ mark:"f+", level:21, vel:95 },
{ mark:"ff", level:22, vel:100 },
{ mark:"ff+", level:23, vel:105 },
{ mark:"fff", level:24, vel:115 },
{ mark:"fff+", level:25, vel:120 },
{ mark:"ffff", level:26, vel:125 },
]
}
}

View File

@ -34,6 +34,9 @@
#include "cwTime.h"
#include "cwMidi.h"
#include "cwMidiFile.h"
#include "cwAudioDevice.h"
#include "cwPresetSel.h"
#include "cwDynRefTbl.h"
@ -43,6 +46,7 @@
#include "cwScoreTest.h"
#include "cwSfTrack.h"
#include "cwScoreFollowerPerf.h"
#include "cwScoreFollower.h"
#include "cwScoreFollowTest.h"
@ -55,9 +59,6 @@
#include "cwUiTest.h"
#endif
#include "cwMidiFile.h"
#include "cwAudioDevice.h"
#if(cwALSA)
#include "cwMidiPort.h"
#include "cwAudioDeviceTest.h"