diff --git a/README.md b/README.md index 0e9efe7..4b4d882 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ sets of parameters. The primary parameter file is `src/cwtest/cfg/main.cfg`. # MIDI - MIDI devices and files. ----- Label | Source File | Function ----------------------|----------------------|-------------- @@ -45,7 +44,6 @@ __midiDeviceReport__ | cwMidiDeviceTest.cpp | testReport() List The current set of MIDI hardware devices ------ Label | Source File | Function ------------------|----------------------|-------------- @@ -57,7 +55,6 @@ latency of the device by comparing the time between MIDI events as generated by the device to the actual time between the events in the MIDI file. ----- Label | Source File | Function ------------------|----------------------|-------------- @@ -85,9 +82,7 @@ rpt : { midiFn: } batch_convert: { io_dir:, session_dir:, take_begin:, take_end: print_warnings_flag: } ``` - - - +---- ## Serial - Serial Port Manager @@ -100,6 +95,8 @@ The function continuously transmits ASCII values '0' through 'z' to external dev Those devices should increment the received value and send it back, where it is receieved and printed to the console. Firmware to run on ATMEGA328 based devices, like the Arduino Uno, is provided in `study/serial/arduino_xmt_recv/main.c`. +---- + ## wesockSrv - Web Sockets Server CLI Label | Source File | Function @@ -110,6 +107,8 @@ websockSrv | cwWebSockSvr.cpp | websockSrvTest() Interactive websocket server testing application. Run the app and navigate in a web browser to `localhost:5687` to run the application. +---- + ## nbmpscQueue - Non-Blocking Multiple Producer Single Consumer Queue CLI Label | Source File | Function @@ -120,13 +119,27 @@ Run the non-blocking, multiple producer, single consumer queue for 'testDurMs' m and write the result into 'out_fname'. This is the queue used by the websocket implementation (See cwWebSock.h/cpp) to support incoming calls form multiple threads without blocking the calling threads. +---- + # Audio CLI Label | Source File | Function ------------------|-----------------------|--------------------- -audioDevAlsa | cwAudioDeviceAlsa.cpp | report() +audioDevTest | cwAudioDeviceTest.cpp | test() -Generate a list of devices and device attributes directly from the ALSA sub-system. +Interactive testing of a specified audio device using the +cwAudioBuf functions: tones, pass-through, metering. +Use 'audioDevRpt' to get the possible labels for 'inDev' and 'outDev'. + + +CLI Label | Source File | Function +------------------|-----------------------|--------------------- +audioDevFileTest | cwAudioDeviceFile.cpp | Test() + +Test the input and output audio file device driver +by setting a input file to 'inAudioFname' and writing +the output file to 'outAudioFname'. 'cycleCnt' +is the total count of test audio cycles. CLI Label | Source File | Function @@ -139,7 +152,7 @@ CLI Label | Source File | Function ------------------|----------------------|--------------------- audiofile | cwAudioFile.cpp | test() -Print the audio file format. +Report the audio file format and a selected set of sample values. # Operations on Audio Files @@ -150,12 +163,26 @@ afop | cwAudioFile.cpp | test() sine - generate a sine signal mix - mix multiple audio files with selectable gains per file. select_to_file - save sections of audio files to new audio files -cutAndMix -parallelMix -transformApp -convolve -generate +cutAndMix - Extract a section of source audio, apply fade in/out ramps, and mix it into a destination file. +parallelMix - Given a set of overlapping source files of identical length solo a given source during a specified time interval. +transformApp - Currawong online transform audition demo. +convolve - Convolve an audio file with an impulse response +generate - Synthesize a signal. +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +audio_file_proc | cwAudioFileProc.cpp | file_processor() + +General purpose audio file processing pipeline. + +CLI Label | Source File | Function +---------------------|-----------------------|--------------------- +pvoc_file_proc | cwPvAudioFileProc.cpp | pvoc_file_processor() + +General purpose audio file processing for phase-vocoder based processing. + + +---- # Socket @@ -164,16 +191,68 @@ CLI Label | Source File | Function socketMgrSrvTest | cwSocket.cpp | mainTest() socketMgrClientTest | cwSocket.cpp | mainTest() +This is based on the current cwSocket implementation. Interactive socket based client/server application. Start `socketMgrSrvTest` in one process, then `socketMgrClientTest` in a second processor. + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +socketUdp | cwTcpSocketTest.cpp | test_udp() + +This is based on the cwTcpSocket implemetation, as developed for use with MDNS,DNSD,EUCON. +Interactive tester. + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +socketTcpClient | cwTcpSocketTest.cpp | test_tcp() +socketTcpServer | cwTcpSocketTest.cpp | test_tcp() + +This is based on the cwTcpSocket implemetation, as developed for use with MDNS,DNSD,EUCON. +Interactive tester. + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +socketSrvUdp | cwTcpSocketTest.cpp | test_udp_srv() +socketSrvTcp | cwTcpSocketTest.cpp | test_tcp_srv() + +This is based on the cwTcpSocket implemetation, as developed for use with MDNS,DNSD,EUCON. +Interactive tester. + + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +socketMdns | cwMdns.cpp | test() + +Runs a very specific test for simulating a Euphonix MC Mixer surface. + + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +dnssd | cwDnssd.cpp | test() + +Runs a very specific test for simulating a Euphonix MC Mix surface. + + +CLI Label | Source File | Function +---------------------|----------------------|--------------------- +eucon | cwEuCon.cpp | test() + +Runs a very specific test for simulating a Euphonix MC Mix surface. + +---- + +# File system + + CLI Label | Source File | Function ------------------|----------------------|--------------------- dirEntry | cwFileSys.cpp | dirEntryTest() Exercise the directory reader. +---- # IO Interface @@ -181,13 +260,56 @@ CLI Label | Source File | Function ------------------|----------------------|--------------------- io_minimal | cwIoMinTest.cpp | min_test() -cwIoMinTest.cpp gives minimal template for an interactive application based on cwIo.h/cpp. +Incomplete minimal template for an application based on cwIo.h/cpp without a GUI. CLI Label | Source File | Function ------------------|----------------------|--------------------- io | cwIoTest.cpp | test() +Incomplete but working interactive app used to test and develop cwIo based applications. +---- + + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +audio_midi | cwIoAudioMidiApp.cpp | main() + +Program for recording and playing back real-time Audio and MIDI. +Based on cwIoAudioRecordPlay and cwIoMidiRecordPlay. + + +# Dataset Related + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +mnist | cwDatasets.cpp | mnist::test() + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +dataset_wtr | cwDatasets.cpp | wtr::test() + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +dataset_rdr | cwDatasets.cpp | rdr::test() + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +dataset_adapter | cwDatasets.cpp | adapter::test() + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +dataset | cwDatasets.cpp | test() + +Read MNIST native file -> write dataset file -> read datasetfile -> write SVG file + +# SVG + +CLI Label | Source File | Function +------------------|----------------------|--------------------- +svg | cwSvg.cpp | test() + +Test the SVG file writer. ## Run Unit Tests: diff --git a/src/cwtest/cfg/audio_midi_record.cfg b/src/cwtest/cfg/audio_midi_record.cfg index 3362e9b..0e2a9de 100644 --- a/src/cwtest/cfg/audio_midi_record.cfg +++ b/src/cwtest/cfg/audio_midi_record.cfg @@ -27,17 +27,22 @@ // piano { enableFl: true, + label: "piano", + //midi_out_device: "MIDIFACE 2x2", //midi_out_port: "MIDIFACE 2x2 Midi Out 1", //midi_out_device: "Scarlett 18i20 USB", //midi_out_port: "Scarlett 18i20 USB MIDI 1", - midi_out_device: "iRig MIDI 2", - midi_out_port: "iRig MIDI 2 MIDI 1", + //midi_out_device: "iRig MIDI 2", + //midi_out_port: "iRig MIDI 2 MIDI 1", - //midi_out_device: "Fastlane", - //midi_out_port: "Fastlane MIDI A", + //midi_out_device: "PipeWire-RT-Event", + //midi_out_port: "input", + + midi_out_device: "Fastlane", + midi_out_port: "Fastlane MIDI A", force_damper_down_fl: false, force_damper_down_threshold: 35, @@ -48,8 +53,6 @@ damper_dead_band_min_value: 1, damper_dead_band_max_value: 30, - //midi_out_device: "PipeWire-RT-Event", - //midi_out_port: "input", // pedal down velocity input/output mapping //pedal: { @@ -81,6 +84,8 @@ } ui: { + enableFl: true, + asyncFl:false, physRootDir: "/home/kevin/src/cwtest/src/libcw/html/audio_midi", dfltPageFn: "index.html", port: 5687, @@ -90,12 +95,16 @@ websockTimeOutMs: 50, // max time out while blocking for a websock event idleMsgPeriodMs: 50, // period without messages before an idle message is generated uiCfgFn: "ui.cfg", // default UI resource description - asyncFl: false + queueBlkCnt: 8, + queueBlkByteCnt: 32768, + idleMsgPeriodMs: 50, // period without messages before an idle message is generated + extraLogsFl: false, }, serial: { + enableFl: false, pollPeriodMs: 50, recvBufByteN: 512, array: [ @@ -114,11 +123,29 @@ midi: { - parserBufByteN: 1024, + enableFl: true, asyncFl: true, + parseBufByteCnt: 1024, + appNameStr: "cwtest", + fileDevName: "file_dev", + fileDevReadAheadMicros: 3000, + testFileLabel: "file_0", + testFileEnableFl: false + enableBufFl:true, + bufferMsgCnt:4096, + filterRtSenseFl:true + + file_ports: [ + + { "label":"file_0", + //"file": "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1/record_4/midi.mid", + "enable_fl": false }, + ] + }, audio: { + enableFl: true, meterMs: 50, // audio meter filter length and meter callback period threadTimeOutMs: 50, // audio thread cond var time out @@ -136,12 +163,14 @@ deviceL: [ { // System device name - device: "Scarlett 18i20 USB USB Audio", + //device: "Scarlett 18i20 USB USB Audio", //device: "USB Audio CODEC USB Audio", //device: "HDA Intel PCH CS4208 Analog", //device: "ICUSBAUDIO7D USB Audio", + device: "MBox USB Audio", - enableFl: true, // (req) + activeFl: true, // (req) + meterFl: true, // (opt) label: "main", // (req) User label userId: 0, // (opt) User id (can also be set at runtime) framesPerCycle: 512, // (req) Samples per audio device cycle @@ -153,7 +182,7 @@ }, socket: { - + enableFl: false, asyncFl: false, maxSocketCnt: 10, recvBufByteCnt: 4096, diff --git a/src/cwtest/cfg/main.cfg b/src/cwtest/cfg/main.cfg index af835bd..b0a59bd 100644 --- a/src/cwtest/cfg/main.cfg +++ b/src/cwtest/cfg/main.cfg @@ -109,317 +109,6 @@ ] }, - - audioDevAlsa: {}, - audioDevRpt: {}, // print a list of audio device - - // Interactive send/recv tester - socketUdp: { - localPort: 5687, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5688 - }, - - socketTcpClient: { - localPort: 5687, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5688 - dgramFl: false, - serverFl: false, - timeOutMs: 100 - }, - - socketTcpServer: { - localPort: 5688, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5687, - dgramFl: false, - serverFl: true, - timeOutMs: 100 - }, - - socketSrvUdp: { - localPort: 5688, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5687, - }, - - socketSrvTcp: { - localPort: 5688, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5687, - }, - - socketMdns: {}, - dnssd: {}, - eucon: {}, - - - // Create a server to listen on a known port - sockMgrSrvTest: { - protocol: tcp, // tcp | udp - //nicDev: // optional NIC device - localPort: 5688, - }, - - sockMgrClientTest: { - //nicDev: // optional NIC device - protocol: tcp, - localPort: 5687, - remoteAddr: "127.0.0.1", // localhost - remotePort: 5688, - - } - - - dirEntry: { - path: "~/src/cwtest/src/cwtest/cfg/test", - attrL: [ "file","dir","link","hidden","cur_dir","parent_dir","full_path","recurse","recurse_links"] - }, - - io: { - ui: { - physRootDir: "/home/kevin/src/cwtest/src/libcw/html/ioTest", - dfltPageFn: "index.html", - port: 5687, - rcvBufByteN: 2048, - xmtBufByteN: 2048, - fmtBufByteN: 4096, - websockTimeOutMs: 50, // max time out while blocking for a websock event - uiCfgFn: "ui.cfg" // default UI resource description - }, - - - serial: { - - pollPeriodMs: 50, - recvBufByteN: 512, - - array: [ - { - enable_flag: true, - label: "port1", // User label - device: "/dev/ttyACM0", // Serial device name - baud: 115200, - bits: 8, - stop: 1, - parity: no - } - ], - }, - - midi: { - parserBufByteN: 1024, - }, - - - audio: { - meterMs: 50, // audio meter filter length and meter callback period - threadTimeOutMs: 50, // audio thread cond var time out - - groupL: [ - { - enableFl: true, // (req) - label: "main", // (req) User label - id: 0, // (req) User id (can also be set at runtime) - srate: 48000, // (req) Sample rate used by all devices in this group - dspFrameCnt: 64 // (req) Size of DSP processing buffers - } - ], - - deviceL: [ - { - // System device name - //device: "Scarlett 18i20 USB USB Audio", - //device: "USB Audio CODEC USB Audio", - device: "HDA Intel PCH CS4208 Analog", - - enableFl: true, // (req) - label: "main", // (req) User label - userId: 0, // (opt) User id (can also be set at runtime) - framesPerCycle: 512, // (req) Samples per audio device cycle - cycleCnt: 3, // (req) Count of device cycle buffers. - inGroup: "main", // (opt) All devices in a group must be 'ready' to source - outGroup: "main", // (opt) or sink data before an audio callback is made for that group - } - ] - }, - - socket: { - - maxSocketCnt: 10, - recvBufByteCnt: 4096, - threadTimeOutMs: 50, - - socketL: [ - { - enableFl: true, // (req) - label: "sock0", // (req) - userId: 0, // (opt) - port: 5687, // (req) This sockets port number - timeOutMs: 50, // (req) Timeout used for blocking sockets. - - // Attributes: - // blocking or non-blocking, - // udp or tcp, - // listen, broadcast - // reuse_addr, reuse_port, multi_cast_ttl, multi_cast_loop - // stream - attrL: [ udp, blocking ], - - // Automatically connect to this remote socket. - // remoteAddr: "192.168.0.10", // (opt) - // remotePort: 5687 // (opt) - }, - - { - enableFl: true, // (req) - label: "sock1", // (req) - userId: 1, // (opt) - port: 5688, // (req) This sockets port number - timeOutMs: 50, // (req) Timeout used for blocking sockets. - - attrL: [ udp, blocking ], - } - - - - ] - - - } - }, - - - io_minimal: { - - }, - - - audio_midi: { - - audio_midi: { - record_dir: "/home/kevin/temp/audio_midi_app", - record_folder: "record", - record_fn_ext: "am", - max_midi_msg_count: 32768, - midi_timer_period_micro_sec: 15000, - //midi_out_device: "Fastlane", - //midi_out_port: "Fastlane MIDI A", - - midi_out_device: "iRig MIDI 2", - midi_out_port: "iRig MIDI 2 MIDI 1", - - audio_in_ch_map: [0, 1 ], - audio_out_ch_map: [0, 1 ] - }, - - ui: { - physRootDir: "/home/kevin/src/cwtest/src/libcw/html/audio_midi", - dfltPageFn: "index.html", - port: 5687, - rcvBufByteN: 2048, - xmtBufByteN: 2048, - fmtBufByteN: 4096, - websockTimeOutMs: 50, // max time out while blocking for a websock event - uiCfgFn: "ui.cfg" // default UI resource description - idleMsgPeriodMs: 50, // period without messages before an idle message is generated - asyncFl: false - }, - - - serial: - { - pollPeriodMs: 50, - recvBufByteN: 512 - array: [ - { - enableFl: false, - asyncFl: false, - label: "port1", // User label - device: "/dev/ttyACM0", // Serial device name - baud: 38400, - bits: 8, - stop: 1, - parity: no, - } - ] - }, - - - midi: { - parserBufByteN: 1024, - asyncFl: false - }, - - audio: { - meterMs: 50, // audio meter filter length and meter callback period - threadTimeOutMs: 50, // audio thread cond var time out - - groupL: [ - { - enableFl: true, // (req) - asyncFl: true, - label: "main", // (req) User label - id: 0, // (req) User id (can also be set at runtime) - srate: 48000, // (req) Sample rate used by all devices in this group - dspFrameCnt: 64 // (req) Size of DSP processing buffers - } - ], - - deviceL: [ - { - // System device name - device: "Scarlett 18i20 USB USB Audio", - //device: "USB Audio CODEC USB Audio", - //device: "HDA Intel PCH CS4208 Analog", - - enableFl: true, // (req) - label: "main", // (req) User label - userId: 0, // (opt) User id (can also be set at runtime) - framesPerCycle: 512, // (req) Samples per audio device cycle - cycleCnt: 3, // (req) Count of device cycle buffers. - inGroup: "main", // (opt) All devices in a group must be 'ready' to source - outGroup: "main", // (opt) or sink data before an audio callback is made for that group - } - ] - }, - - socket: { - - asyncFl: false, - maxSocketCnt: 10, - recvBufByteCnt: 4096, - threadTimeOutMs: 50, - socketL: [], - - } - }, - - - audioDevTest: { - srate: 48000, - bufN: 3, - framesPerCycle: 512, - inDev: "USB Audio CODEC USB Audio", - outDev: "USB Audio CODEC USB Audio", - meterMs: 50, - amHz: 1, - amMaxGain: 0.8 - }, - - audioDevFileTest: { - //inAudioFname: "~/temp/temp_sine_100_hz.wav", - inAudioFname: "~/temp/headphone_temp_0.wav", - outAudioFname: "~/temp/test.wav", - framesPerCycle:1024, - - }, - - b23Tree: - { - }, - midifile: { csv: { midiFn:"~/src/cwtest/src/cwtest/cfg/gutim_full/scriabin/scriabin_etude_op8_2_f_sh_minor.mid", @@ -596,418 +285,124 @@ }, + audioDevTest: { + srate: 48000, + bufN: 3, + framesPerCycle: 512, + inDev: "MBox USB Audio", + outDev: "MBox USB Audio", + meterMs: 50, + amHz: 1, + amMaxGain: 0.8 + }, + + audioDevFileTest: { + //inAudioFname: "~/temp/temp_sine_100_hz.wav", + inAudioFname: "~/temp/piano_0.wav", + outAudioFname: "~/temp/test.wav", + framesPerCycle:1024, + cycleCnt:100, + }, + + audioDevAlsa: {}, + audioDevRpt: {}, // print a list of audio device + audiofile: { - //rpt: { fn:"~/temp/temp_sine.wav", begIdx: 0, frmCnt: 10 } - rpt: { fn:"~/src/currawong/site/web_part_selection/html/static/audio/GUTIM_Part_1_20200711_48k_24bit.wav", begIdx: 0, frmCnt: 10 } + rpt: { fn:"~/src/cwtest/src/cwtest/cfg/main_cfg_data/audio_32_float.wav", begIdx: 0, frmCnt: 10 } }, afop: { - sine: { fn:"~/temp/temp_sine_100_hz.wav", srate: 48000, bits: 0, hz: 100, gain: 0.5, secs: 10.0 }, - }, - - mnist: { - desc: "Print the MNIST images to an SVG/HTML file.", - inDir: "~/src/datasets/mnist", - outHtmlFn: "~/temp/image_svg_0.html" - }, - - - dataset_wtr: { - outFn: "~/temp/temp.ds" - }, - - dataset_rdr: { - inFn: "~/temp/temp.ds", - cacheByteN: 146, - }, - - dataset_adapter: { - inFn: "~/temp/temp.ds", - cacheByteN: 154, - batchN: 3, - }, - - - dataset: { - desc: "Read MNIST native file -> write dataset file -> read datasetf le -> write SVG file", - inDir: "~/src/datasets/mnist", - dsFn: "~/temp/temp_dataset.ds", - outHtmlFn: "~/temp/image_svg.html", - batchN: 3500, - cacheByteN: 2800000 - }, - - dataset0: { - dsLabel: mnist, - batchN: 32, - validPct: 10, - testPct: 10, - dataL:[ - { name: mnist, inDir: "~/src/datasets/mnist" } - ], - - }, - - lazy: {}, - - - svg: { - desc:"Create an SVG/HTML test file.", - notes:"If no CSS file name is given then the style information will be written inline.", - outHtmlFn: "~/temp/test_svg.html", - outCssFn: "~/temp/test_svg.css" - }, - - audio_mix: - { - test_label: audio_mix, + // Generate sine signals + sine: { enable_fl:true, fn:"~/temp/temp_sine_100_hz.wav", srate: 48000, bits: 0, hz: 100, gain: 0.5, secs: 10.0 }, + sine: { enable_fl:true, fn:"~/temp/temp_sine_1000_hz.wav", srate: 48000, bits: 0, hz: 1000, gain: 0.5, secs: 10.0 }, - outFn: "~/temp/temp_mix.wav", - outBits: 0, - srcL: [ - { gain: 0.6, src:"~/temp/temp_sine_100_hz.wav" }, - { gain: 0.4, src:"~/temp/temp_sine_1000_hz.wav" } ] - }, + // Mix audio files + mix: { enable_fl:true, outFn: "~/temp/temp_mix.wav", outBits: 0, + srcL: [ + { gain: 0.6, src:"~/temp/temp_sine_100_hz.wav" }, + { gain: 0.4, src:"~/temp/temp_sine_1000_hz.wav" } + ]} - audio_mix_a: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_a_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_a_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_a_wet.aiff" } ] - }, + // Cut sections of audio files into separate audio files. + select_to_file: { enable_fl:true, + outDir: "~/temp", + markerFn: "~/temp/select_marker.txt" // write an Audacity marker file with beg/end fade in/out times + outBits:32, + fadeInSec: 0.1, + fadeInPreFl: true, // start selection at 'begSec-fadeInSec' else start at 'begSec' + fadeOutSec: 0.1, + fadeOutPostFl: true, // end selection at 'endSec+fadeOutSec' else end end at 'endSec' + srcFn: "~/temp/temp_mix.wav" - audio_mix_b: - { - test_label: audio_mix, + selectL: [ + { begSec: 1.0, endSec: 2.0, dst: "temp_cut0.wav", /* src:"src.wav" */ }, + { begSec: 3.0, endSec: 4.0, dst: "temp_cut1.wav", /* src:"src.wav" */ }, + ]} - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_b_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_b_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_b_wet.aiff" } ] - }, - - audio_mix_c: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_c_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_c_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_c_wet.aiff" } ] - }, - - audio_mix_d: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_d_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_d_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_d_wet.aiff" } ] - }, - - audio_mix_f1: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_f1_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_f1_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_f1_wet.aiff" } ] - }, - - audio_mix_f2: - { - - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_f2_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_f2_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_f2_wet.aiff" } ] - }, - - audio_mix_f3: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_6_4/preset_f3_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.6, src:"~/temp/kc_record/xform_only/dry/preset_f3_dry.aiff" }, - { gain: 0.4, src:"~/temp/kc_record/xform_only/wet/preset_f3_wet.aiff" } ] - }, - - audio_mix_f4: - { - test_label: audio_mix, - - outFn: "~/temp/kc_record/xform_only/mix_7_3/preset_f4_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.7, src:"~/temp/kc_record/xform_only/dry/preset_f4_dry.aiff" }, - { gain: 0.3, src:"~/temp/kc_record/xform_only/wet/preset_f4_wet.aiff" } ] - }, - - audio_mix_g1a: - { - outFn: "~/temp/kc_record/xform_only/mix_7_3/preset_g1a_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.7, src:"~/temp/kc_record/xform_only/dry/preset_g1a_dry.aiff" }, - { gain: 0.3, src:"~/temp/kc_record/xform_only/wet/preset_g1a_wet.aiff" } ] - }, - - audio_mix_g1d: - { - outFn: "~/temp/kc_record/xform_only/mix_7_3/preset_g1d_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.7, src:"~/temp/kc_record/xform_only/dry/preset_g1d_dry.aiff" }, - { gain: 0.3, src:"~/temp/kc_record/xform_only/wet/preset_g1d_wet.aiff" } ] - }, - - audio_mix_ga: - { - outFn: "~/temp/kc_record/xform_only/mix_7_3/preset_ga_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.7, src:"~/temp/kc_record/xform_only/dry/preset_ga_dry.aiff" }, - { gain: 0.3, src:"~/temp/kc_record/xform_only/wet/preset_ga_wet.aiff" } ] - }, - - audio_mix_g: - { - outFn: "~/temp/kc_record/xform_only/mix_7_3/preset_g_mix.wav", - outBits: 24, - srcL: [ - { gain: 0.7, src:"~/temp/kc_record/xform_only/dry/preset_g_dry.aiff" }, - { gain: 0.3, src:"~/temp/kc_record/xform_only/wet/preset_g_wet.aiff" } ] - }, - - select_to_file_0: - { - outDir: "~/temp/kc_record/xform_only/cut", - outBits: 32, - selectL: [ - { begSec: 1743.3, endSec: 1816.44, dst: "dry.wav", src: "~/temp/kc_record/xform_only/dry/a.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "a.wav", src: "~/temp/kc_record/xform_only/wet/a.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "b.wav", src: "~/temp/kc_record/xform_only/wet/b.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "c.wav", src: "~/temp/kc_record/xform_only/wet/c.aiff" }, - - { begSec: 1743.3, endSec: 1816.44, dst: "d.wav", src: "~/temp/kc_record/xform_only/wet/d.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "f1.wav", src: "~/temp/kc_record/xform_only/wet/f1.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "f2.wav", src: "~/temp/kc_record/xform_only/wet/f2.aiff" }, - - { begSec: 1743.3, endSec: 1816.44, dst: "f3.wav", src: "~/temp/kc_record/xform_only/wet/f3.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "f4.wav", src: "~/temp/kc_record/xform_only/wet/f4.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "g.wav", src: "~/temp/kc_record/xform_only/wet/g.aiff" }, - - { begSec: 1743.3, endSec: 1816.44, dst: "ga.wav", src: "~/temp/kc_record/xform_only/wet/ga.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "g1a.wav", src: "~/temp/kc_record/xform_only/wet/g1a.aiff" }, - { begSec: 1743.3, endSec: 1816.44, dst: "g1d.wav", src: "~/temp/kc_record/xform_only/wet/g1d.aiff" }, - - ] - - }, - - - select_to_file_1: - { - - outDir: "~/src/currawong/site/web_part_selection/html/static/audio/sel_score", - markerFn: "~/temp/audacity_scratch/labels.txt", // write a marker file - outBits: 16, - fadeInSec: 0.1, - fadeInPreFl: true, // start selection at 'begSec-fadeInSec' else start at 'begSec' - fadeOutSec: 0.1, - fadeOutPostFl: true, // end selection at 'endSec+fadeOutSec' else end end at 'endSec' - srcFn: "~/src/currawong/site/web_part_selection/html/static/audio/GUTIM_Part_1_20200711_48k_24bit.wav", - - - // Optional selectL[] args: "src" - selectL: [ - - { dst:"1_00_0.wav", begSec:0.0, endSec:23.23 }, - { dst:"1_01_0.wav", begSec:23.23, endSec:46.4 }, - { dst:"1_02_0.wav", begSec:46.4, endSec:65.79 }, - { dst:"1_03_0.wav", begSec:65.79, endSec:84.05 }, - { dst:"1_04_0.wav", begSec:84.05, endSec:111.15 }, - { dst:"1_05_0.wav", begSec:111.15, endSec:125.9 }, - { dst:"1_06_0.wav", begSec:125.9, endSec:164.1 }, - { dst:"1_07_0.wav", begSec:164.1, endSec:185.87 }, - { dst:"1_08_0.wav", begSec:185.87, endSec:220.15 }, - { dst:"1_09_0.wav", begSec:220.15, endSec:237.3 }, - { dst:"1_10_0.wav", begSec:237.3, endSec:275.75 }, - { dst:"1_00_1.wav", begSec:275.75, endSec:314.4 }, - { dst:"1_11_0.wav", begSec:314.4, endSec:348.73 }, - { dst:"1_12_0.wav", begSec:348.73, endSec:369.05 }, - { dst:"1_06_1.wav", begSec:369.05, endSec:385.16 }, - { dst:"1_13_0.wav", begSec:385.16, endSec:406.06 }, - { dst:"1_14_0.wav", begSec:406.06, endSec:421.71 }, - { dst:"1_13_1.wav", begSec:421.71, endSec:433.85 }, - { dst:"1_08_1.wav", begSec:433.85, endSec:452.0 }, - { dst:"1_03_1.wav", begSec:452.0, endSec:476.08 }, - { dst:"1_02_1.wav", begSec:476.08, endSec:489.2 }, - { dst:"1_10_1.wav", begSec:489.2, endSec:504.98 }, - { dst:"1_12_1.wav", begSec:504.98, endSec:535.55 }, - { dst:"1_11_1.wav", begSec:535.55, endSec:549.78 }, - { dst:"1_14_1.wav", begSec:549.78, endSec:569.68 }, - { dst:"1_04_1.wav", begSec:569.68, endSec:588.63 }, - { dst:"1_01_1.wav", begSec:588.63, endSec:615.25 }, - { dst:"1_09_1.wav", begSec:615.25, endSec:647.83 }, - { dst:"1_05_1.wav", begSec:647.83, endSec:678.44 }, - { dst:"1_07_1.wav", begSec:678.44, endSec:740.85 }, - ] - - }, - - - select_to_file: - { - - outDir: "~/src/currawong/site/web_part_selection/html/static/audio/sel_score", - markerFn: "~/temp/audacity_scratch/labels.txt", // write a marker file - outBits: 16, - fadeInSec: 0.1, - fadeInPreFl: true, // start selection at 'begSec-fadeInSec' else start at 'begSec' - fadeOutSec: 0.1, - fadeOutPostFl: true, // end selection at 'endSec+fadeOutSec' else end end at 'endSec' - srcFn: "~/src/currawong/site/web_part_selection/html/static/audio/GUTIM_All_20200711_48k_24bit.wav", - - - // Optional selectL[] args: "src" - selectL: [ - { dst:"2_01_0.wav", begSec:737.13, endSec:764.36 }, - { dst:"2_14_0.wav", begSec:764.36, endSec:782.60 }, - { dst:"2_12_0.wav", begSec:782.60, endSec:792.90 }, - { dst:"2_05_0.wav", begSec:792.90, endSec:818.15 }, - { dst:"2_00_0.wav", begSec:818.15, endSec:831.27 }, - { dst:"2_13_0.wav", begSec:831.27, endSec:851.90 }, - { dst:"2_09_0.wav", begSec:851.90, endSec:868.08 }, - { dst:"2_04_0.wav", begSec:868.08, endSec:899.88 }, - { dst:"2_02_0.wav", begSec:899.88, endSec:934.34 }, - { dst:"2_11_0.wav", begSec:934.34, endSec:952.62 }, - { dst:"2_12_1.wav", begSec:952.62, endSec:970.05 }, - { dst:"2_03_0.wav", begSec:970.05, endSec:1007.70 }, - { dst:"2_01_1.wav", begSec:1007.70, endSec:1035.94 }, - { dst:"2_13_1.wav", begSec:1035.94, endSec:1059.35 }, - { dst:"2_05_1.wav", begSec:1059.35, endSec:1087.29 }, - { dst:"2_07_0.wav", begSec:1087.29, endSec:1106.16 }, - { dst:"2_08_0.wav", begSec:1106.16, endSec:1144.80 }, - { dst:"2_11_1.wav", begSec:1144.80, endSec:1161.65 }, - { dst:"2_14_1.wav", begSec:1161.65, endSec:1187.05 }, - { dst:"2_04_1.wav", begSec:1187.05, endSec:1231.25 }, - { dst:"2_06_0.wav", begSec:1231.25, endSec:1249.20 }, - { dst:"2_02_1.wav", begSec:1249.20, endSec:1299.71 }, - { dst:"2_10_0.wav", begSec:1299.71, endSec:1318.82 }, - { dst:"2_09_1.wav", begSec:1318.82, endSec:1333.50 }, - { dst:"2_06_1.wav", begSec:1333.50, endSec:1359.28 }, - { dst:"2_12_2.wav", begSec:1359.28, endSec:1381.63 }, - { dst:"2_05_2.wav", begSec:1381.63, endSec:1419.31 }, - { dst:"2_07_1.wav", begSec:1419.31, endSec:1430.36 }, - { dst:"2_13_2.wav", begSec:1430.36, endSec:1444.80 }, - { dst:"2_01_2.wav", begSec:1444.80, endSec:1476.36 }, - { dst:"2_10_1.wav", begSec:1476.36, endSec:1505.92 }, - { dst:"2_03_1.wav", begSec:1505.92, endSec:1551.75 }, - { dst:"2_14_2.wav", begSec:1551.75, endSec:1579.75 }, - { dst:"2_08_1.wav", begSec:1579.75, endSec:1599.79 }, - { dst:"2_11_2.wav", begSec:1599.79, endSec:1627.85 }, - { dst:"2_04_2.wav", begSec:1627.85, endSec:1651.23 }, - { dst:"2_00_1.wav", begSec:1651.23, endSec:1680.52 }, - { dst:"2_07_2.wav", begSec:1680.52, endSec:1709.35 }, - { dst:"2_08_2.wav", begSec:1709.35, endSec:1729.75 }, - { dst:"2_03_2.wav", begSec:1729.75, endSec:1744.20 }, - { dst:"2_00_2.wav", begSec:1744.20, endSec:1759.82 }, - { dst:"2_02_2.wav", begSec:1759.82, endSec:1769.92 }, - { dst:"2_09_2.wav", begSec:1769.92, endSec:1779.57 }, - { dst:"2_14_3.wav", begSec:1779.57, endSec:1793.72 }, - { dst:"2_07_3.wav", begSec:1793.72, endSec:1802.88 }, - { dst:"2_03_3.wav", begSec:1802.88, endSec:1819.58 }, - { dst:"2_10_2.wav", begSec:1819.58, endSec:1832.89 }, - { dst:"2_06_2.wav", begSec:1832.89, endSec:1850.93 }, - { dst:"2_04_3.wav", begSec:1850.93, endSec:1867.80 }, - { dst:"2_01_3.wav", begSec:1867.80, endSec:1888.17 }, - { dst:"2_11_3.wav", begSec:1888.17, endSec:1914.85 }, - { dst:"2_13_3.wav", begSec:1914.85, endSec:1934.81 }, - { dst:"2_08_3.wav", begSec:1934.81, endSec:1955.66 }, - { dst:"2_12_3.wav", begSec:1955.66, endSec:1970.00 }, - { dst:"2_00_3.wav", begSec:1970.00, endSec:1982.46 }, - { dst:"2_06_3.wav", begSec:1982.46, endSec:2014.06 }, - { dst:"2_05_3.wav", begSec:2014.06, endSec:2042.40 }, - { dst:"2_09_3.wav", begSec:2042.40, endSec:2078.88 }, - { dst:"2_10_3.wav", begSec:2078.88, endSec:2111.29 }, - { dst:"2_02_3.wav", begSec:2111.29, endSec:2205.00 }, - ] - - }, - - // Extract a section of source audio, apply fade in/out ramps, and mix it into a destination file. - cut_and_mix: - { + // Extract a section of source audio, apply fade in/out ramps, and mix it into a destination file. + cut_and_mix: + { + enable_fl: true, dstFn: "~/temp/test_xfade.wav", - dstBits: 24, + dstBits: 32, srcDir: "~/temp", crossFadeSec: 0.5, argL: [ - { srcBegSec: 1.0, srcEndSec: 2.0, srcFn: "temp_sine_100_hz.wav", dstBegSec:0.0, gain:1.0 }, - { srcBegSec: 3.0, srcEndSec: 4.0, srcFn: "temp_sine_1000_hz.wav", dstBegSec:0.5, gain:1.0 } + // Include "srcBegFadeSec" and "srcEndFadeSec" to set the begin/end cross-fade duration. + { srcBegSec: 1.0, srcEndSec: 2.0, srcFn: "temp_sine_100_hz.wav", dstBegSec:0.0, gain:1.0 }, + { srcBegSec: 3.0, srcEndSec: 4.0, srcFn: "temp_sine_1000_hz.wav", dstBegSec:0.5, gain:1.0 } ] - }, + }, - // Given a set of overlapping source files of identical length solo a given source during a specified time interval. - parallel_mix: - { + // Given a set of overlapping source files of identical length solo a given source during a specified time interval. + parallel_mix: + { + enable_fl: true, dstFn: "~/temp/test_pmix.wav", - dstBits: 24, + dstBits: 32, - srcDir: "~/temp/kc_record/xform_only/cut", + srcDir: "~/temp", argL: [ - { srcBegSec: 0.0, srcEndSec: 4.2, srcFn: "dry_mix.wav", fadeOutSec:0.5, gain:1.0 }, - { srcBegSec: 4.2, srcEndSec: 8.6, srcFn: "d_mix.wav", fadeOutSec:0.5, gain:1.0 } - { srcBegSec: 8.6, srcEndSec: 15.67, srcFn: "ga_mix.wav", fadeOutSec:0.5, gain:1.0 } - { srcBegSec: 15.67, srcEndSec: 17.98, srcFn: "dry_mix.wav", fadeOutSec:0.0, gain:1.0 } + { srcBegSec: 0.0, srcEndSec: 1.0, srcFn: "temp_sine_100_hz.wav", fadeOutSec:0.5, gain:1.0 }, + { srcBegSec: 0.5, srcEndSec: 3.0, srcFn: "temp_sine_1000_hz.wav", fadeOutSec:0.5, gain:1.0 } + { srcBegSec: 2.5, srcEndSec: 5.0, srcFn: "temp_mix.wav", fadeOutSec:0.5, gain:1.0 } ] - }, + }, - convolve_file: - { - dstFn: "~/temp/test_convolve.wav", + // Convolve an audio file with an impulse response + convolve: + { + enable_fl: true, + dstFn: "~/temp/temp_convolve.wav", dstBits: 32, - srcFn: "~/temp/select_to_file/preset_f1.wav", - irFn: "~/sdk/freeverb3/samples/IR/IR_theater.wav", - irScale: 1.0, + srcFn: "~/temp/test_pmix.wav", + irFn: "~/src/cwtest/src/cwtest/cfg/main_cfg_data/freeverb3_IR_theater.wav", + irScale: 0.25, - }, + }, - generate_audio: - { - dstFn: "~/temp/click.wav", - dstBits: 32, - dstSrate: 48000, - dstSecs: 711.0, // file duration in secs - op: "click", + // Synthesize a signal. + generate: + { + enable_fl: true, + dstFn: "~/temp/temp_click.wav", + dstBits: 32, + dstSrate: 48000, + dstSecs: 711.0, // file duration in secs + op: "click", // select the operation - sine: { gain:0.7, hertz:440.0 }, - click: { gain:0.8, decay:0.9, msL:[ 61000,117000,181000,241500,280500,312000,357300,419800,480000,535500,584200,646100,678000,709500 ] } - }, + sine: { gain:0.7, hertz:440.0 }, + click: { gain:0.8, decay:0.9, msL:[ 61000,117000,181000,241500,280500,312000,357300,419800,480000,535500,584200,646100,678000,709500 ] } + }, - transform_app: - { + // This is the interface to the Currawong online transform audition demo. + transform_app: + { srcDir: "~/temp/kc_record/xform_only/cut", // location of 'wet' source files dryFn: "~/temp/kc_record/xform_only/cut/concert.wav", // dry source file @@ -1028,48 +423,17 @@ { srcBegSec: 15.67, srcEndSec: 17.98, srcFn: "d.wav", fadeOutSec:0.0, wetGain:0.3 }, ] + }, + + }, - fft: {}, - ifft: {}, - convolve: {}, - - piano_score:{ - //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" - filename: "/home/kevin/src/currawong/projects/perf_meas_workshop_0/foo.csv" - } - - - gutim_reg: { - dir: "~/temp/cw_reg/reg.csv" - - }, - - // 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: false, 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: false, 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: false, 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: false, 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" }, - { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 120, end_loc: 146, dir: "~/temp/shiau_uen/segment_0" }, - { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 888, end_loc: 929, dir: "~/temp/shiau_uen/segment_1" }, - { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 2287, end_loc: 2454, dir: "~/temp/shiau_uen/segment_2" }, - { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 3765, end_loc: 3883, dir: "~/temp/shiau_uen/segment_3" }, - { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 5407, end_loc: 5462, dir: "~/temp/shiau_uen/segment_4" }, - { enable_fl: true, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 6608, end_loc: 6677, dir: "~/temp/shiau_uen/segment_5" } - ], audio_file_proc: { srcFn: "/home/kevin/src/currawong/audio/GUTIM_All_20200711_96k_float.wav", dstFn: "/home/kevin/temp/audio_out.wav", cfg: "tremelo", - + recordChN: 0, recorder: { enableFl: true, @@ -1156,6 +520,480 @@ } + // Create a server to listen on a known port + sockMgrSrvTest: { + protocol: tcp, // tcp | udp + //nicDev: // optional NIC device + localPort: 5688, + }, + + sockMgrClientTest: { + //nicDev: // optional NIC device + protocol: tcp, + localPort: 5687, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5688, + + } + + + // Interactive send/recv tester + socketUdp: { + localPort: 5687, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5688 + }, + + socketTcpClient: { + localPort: 5687, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5688 + dgramFl: false, + serverFl: false, + timeOutMs: 100 + }, + + socketTcpServer: { + localPort: 5688, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5687, + dgramFl: false, + serverFl: true, + timeOutMs: 100 + }, + + socketSrvUdp: { + localPort: 5688, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5687, + }, + + socketSrvTcp: { + localPort: 5688, + remoteAddr: "127.0.0.1", // localhost + remotePort: 5687, + }, + + socketMdns: {}, + dnssd: {}, + eucon: {}, + + + + dirEntry: { + path: "~/src/cwtest/src/cwtest/cfg/test", + attrL: [ "file","dir","link","hidden","cur_dir","parent_dir","full_path","recurse","recurse_links"] + }, + + io: { + ui: { + enableFl: true, + asyncFl:false, + physRootDir: "/home/kevin/src/cwtest/src/libcw/html/ioTest", + dfltPageFn: "index.html", + port: 5687, + rcvBufByteN: 2048, + xmtBufByteN: 2048, + fmtBufByteN: 4096, + uiCfgFn: "ui.cfg" // default UI resource description + queueBlkCnt: 8, + queueBlkByteCnt: 32768, + idleMsgPeriodMs: 50, // period without messages before an idle message is generated + extraLogsFl: false, + }, + + + serial: { + enableFl: false, + pollPeriodMs: 50, + recvBufByteN: 512, + + array: [ + { + enableFl: true, + asyncFl: false, + label: "port1", // User label + device: "/dev/ttyACM0", // Serial device name + baud: 115200, + bits: 8, + stop: 1, + parity: no + } + ], + }, + + midi: { + enableFl: true, + asyncFl: true, + parseBufByteCnt: 1024, + appNameStr: "cwtest", + fileDevName: "file_dev", + fileDevReadAheadMicros: 3000, + testFileLabel: "file_0", + testFileEnableFl: false + enableBufFl:true, + bufferMsgCnt:4096, + filterRtSenseFl:true + + file_ports: [ + + { "label":"file_0", + //"file": "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1/record_4/midi.mid", + "enable_fl": false }, + ] + + }, + + + audio: { + enableFl: true, + meterMs: 50, // audio meter filter length and meter callback period + threadTimeOutMs: 50, // audio thread cond var time out + + groupL: [ + { + enableFl: true, // (req) + asyncFl: true, + label: "main", // (req) User label + id: 0, // (req) User id (can also be set at runtime) + srate: 48000, // (req) Sample rate used by all devices in this group + dspFrameCnt: 64 // (req) Size of DSP processing buffers + } + ], + + deviceL: [ + { + // System device name + //device: "Scarlett 18i20 USB USB Audio", + //device: "USB Audio CODEC USB Audio", + //device: "HDA Intel PCH CS4208 Analog", + device: "MBox USB Audio" + //device: "sof-hda-dsp" + + activeFl: true, // (req) + meterFl: true, // (opt) + label: "main", // (req) User label + userId: 0, // (opt) User id (can also be set at runtime) + framesPerCycle: 512, // (req) Samples per audio device cycle + cycleCnt: 3, // (req) Count of device cycle buffers. + inGroup: "main", // (opt) All devices in a group must be 'ready' to source + outGroup: "main", // (opt) or sink data before an audio callback is made for that group + } + ] + }, + + socket: { + + enableFl: true, + asyncFl: false, + maxSocketCnt: 10, + recvBufByteCnt: 4096, + threadTimeOutMs: 50, + + socketL: [ + { + enableFl: true, // (req) + asyncFl: false, // (req) + label: "sock0", // (req) + userId: 0, // (opt) + port: 5687, // (req) This sockets port number + timeOutMs: 50, // (req) Timeout used for blocking sockets. + + // Attributes: + // blocking or non-blocking, + // udp or tcp, + // listen, broadcast + // reuse_addr, reuse_port, multi_cast_ttl, multi_cast_loop + // stream + attrL: [ udp, blocking ], + + // Automatically connect to this remote socket. + // remoteAddr: "192.168.0.10", // (opt) + // remotePort: 5687 // (opt) + }, + + { + enableFl: true, // (req) + asyncFl: false, // (req) + label: "sock1", // (req) + userId: 1, // (opt) + port: 5688, // (req) This sockets port number + timeOutMs: 50, // (req) Timeout used for blocking sockets. + + attrL: [ udp, blocking ], + } + ] + + + } + }, + + + io_minimal: { + + }, + + audio_midi: { + record_dir: "/home/kevin/temp/shiau_uen", + //record_dir: "/home/kevin/src/currawong/audio/video_trailer/beck", + //record_dir: "/home/kevin/src/currawong/audio/workshop/beck2", + record_folder: "record", + record_fn_ext: "am", + max_midi_msg_count: 32768, + //midi_timer_period_micro_sec: 15000, + //midi_out_device: "Fastlane", + //midi_out_port: "Fastlane MIDI A", + audio_in_ch_map: [4 5 ], + audio_out_ch_map: [0, 1 ] + + midi_play_record: { + max_midi_msg_count: 32768, + midi_timer_period_micro_sec: 15000, + all_off_delay_ms: 0, // delay after stop time to turn off all notes + log_in_flag: false, + log_out_flag: false, + half_pedal_flag: false, + min_damper_down_time_ms: 0, + + midi_device_list: [ + // piano + { + enableFl: true, + label: "piano", + + //midi_out_device: "MIDIFACE 2x2", + //midi_out_port: "MIDIFACE 2x2 Midi Out 1", + + //midi_out_device: "Scarlett 18i20 USB", + //midi_out_port: "Scarlett 18i20 USB MIDI 1", + + //midi_out_device: "iRig MIDI 2", + //midi_out_port: "iRig MIDI 2 MIDI 1", + + //midi_out_device: "PipeWire-RT-Event", + //midi_out_port: "input", + + midi_out_device: "Fastlane", + midi_out_port: "Fastlane MIDI A", + + force_damper_down_fl: false, + force_damper_down_threshold: 35, + force_damper_down_velocity: 127, + + // do not play damper values that are in this range + damper_dead_band_enable_fl: false, + damper_dead_band_min_value: 1, + damper_dead_band_max_value: 30, + + + // pedal down velocity input/output mapping + //pedal: { + // down_id: 127, + // down_vel: 75, + // half_down_id: 64, + // half_down_vel: 43, + // half_up_id: 63, + // half_up_vel: 43 + // + //}, + + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 + // spirio vel_table: [ 1, 4, 10, 12, 12, 18, 24, 24, 30, 36, 36, 44, 48, 52, 58, 64, 64, 70, 76, 82, 88, 94,100,106,112 ] + + // vel_table: [ 1, 5 10, 16, 21, 26, 32, 37, 42, 48, 53, 58, 64, 69, 74, 80, 85, 90, 96,101,106,112,117,122,127 ] , + + //scale_chord_notes_enable_fl: true, + //scale_chord_notes_factor: 0.5, + + } + //{ midi_out_device: "PipeWire-RT-Event", midi_out_port: "input" }, + ], + } + + + io: { + callbackMutexTimeOutMs: 100, + } + + ui: { + enableFl: true, + asyncFl:false, + physRootDir: "/home/kevin/src/cwtest/src/libcw/html/audio_midi", + dfltPageFn: "index.html", + port: 5687, + rcvBufByteN: 2048, + xmtBufByteN: 2048, + fmtBufByteN: 4096, + websockTimeOutMs: 50, // max time out while blocking for a websock event + idleMsgPeriodMs: 50, // period without messages before an idle message is generated + uiCfgFn: "ui.cfg", // default UI resource description + queueBlkCnt: 8, + queueBlkByteCnt: 32768, + idleMsgPeriodMs: 50, // period without messages before an idle message is generated + extraLogsFl: false, + }, + + + serial: + { + enableFl: false, + pollPeriodMs: 50, + recvBufByteN: 512, + array: [ + { + enableFl: false, + asyncFl: false, + label: "port1", // User label + device: "/dev/ttyACM0", // Serial device name + baud: 38400, + bits: 8, + stop: 1, + parity: no, + } + ] + }, + + + midi: { + enableFl: true, + asyncFl: true, + parseBufByteCnt: 1024, + appNameStr: "cwtest", + fileDevName: "file_dev", + fileDevReadAheadMicros: 3000, + testFileLabel: "file_0", + testFileEnableFl: false + enableBufFl:true, + bufferMsgCnt:4096, + filterRtSenseFl:true + + file_ports: [ + + { "label":"file_0", + //"file": "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1/record_4/midi.mid", + "enable_fl": false }, + ] + + }, + + audio: { + enableFl: true, + meterMs: 50, // audio meter filter length and meter callback period + threadTimeOutMs: 50, // audio thread cond var time out + + groupL: [ + { + enableFl: true, // (req) + asyncFl: true, + label: "main", // (req) User label + id: 0, // (req) User id (can also be set at runtime) + srate: 48000, // (req) Sample rate used by all devices in this group + dspFrameCnt: 64 // (req) Size of DSP processing buffers + } + ], + + deviceL: [ + { + // System device name + //device: "Scarlett 18i20 USB USB Audio", + //device: "USB Audio CODEC USB Audio", + //device: "HDA Intel PCH CS4208 Analog", + //device: "ICUSBAUDIO7D USB Audio", + device: "MBox USB Audio", + + activeFl: true, // (req) + meterFl: true, // (opt) + label: "main", // (req) User label + userId: 0, // (opt) User id (can also be set at runtime) + framesPerCycle: 512, // (req) Samples per audio device cycle + cycleCnt: 3, // (req) Count of device cycle buffers. + inGroup: "main", // (opt) All devices in a group must be 'ready' to source + outGroup: "main", // (opt) or sink data before an audio callback is made for that group + } + ] + }, + + socket: { + enableFl: false, + asyncFl: false, + maxSocketCnt: 10, + recvBufByteCnt: 4096, + threadTimeOutMs: 50, + socketL: [], + + } + } + + + + + b23Tree: + { + }, + + + mnist: { + desc: "Print the MNIST images to an SVG/HTML file.", + inDir: "~/src/datasets/mnist", + outHtmlFn: "~/temp/image_svg_0.html" + }, + + + dataset_wtr: { + outFn: "~/temp/temp.ds" + }, + + dataset_rdr: { + inFn: "~/temp/temp.ds", + cacheByteN: 146, + }, + + dataset_adapter: { + inFn: "~/temp/temp.ds", + cacheByteN: 154, + batchN: 3, + }, + + + dataset: { + desc: "Read MNIST native file -> write dataset file -> read datasetfile -> write SVG file", + inDir: "~/src/datasets/mnist", + dsFn: "~/temp/temp_dataset.ds", + outHtmlFn: "~/temp/image_svg.html", + batchN: 3500, + cacheByteN: 2800000 + }, + + + svg: { + desc:"Create an SVG/HTML test file.", + notes:"If no CSS file name is given then the style information will be written inline.", + outHtmlFn: "~/temp/test_svg.html", + outCssFn: "~/temp/test_svg.css" + }, + + + + + // 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: false, 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: false, 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: false, 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: false, 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" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 120, end_loc: 146, dir: "~/temp/shiau_uen/segment_0" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 888, end_loc: 929, dir: "~/temp/shiau_uen/segment_1" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 2287, end_loc: 2454, dir: "~/temp/shiau_uen/segment_2" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 3765, end_loc: 3883, dir: "~/temp/shiau_uen/segment_3" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 5407, end_loc: 5462, dir: "~/temp/shiau_uen/segment_4" }, + { enable_fl: true, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 6608, end_loc: 6677, dir: "~/temp/shiau_uen/segment_5" } + ], + + flow_proc_dict: { balance: { @@ -1624,7 +1462,6 @@ } - preset_sel: { params: { @@ -2055,7 +1892,23 @@ }, + + + piano_score:{ + //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" + filename: "/home/kevin/src/currawong/projects/perf_meas_workshop_0/foo.csv" + } + + gutim_reg: { + dir: "~/temp/cw_reg/reg.csv" + + }, + + + score_follow: { srate: 48000, diff --git a/src/cwtest/cfg/test/main.cfg b/src/cwtest/cfg/test/main.cfg index b43ad1b..da3dbcf 100644 --- a/src/cwtest/cfg/test/main.cfg +++ b/src/cwtest/cfg/test/main.cfg @@ -51,6 +51,7 @@ filesys:{ test_0:{}}, object:{ basic:{}, to_json:{} }, vop:{ test_0:{} }, + dsp:{ fft:{}, ifft:{}, convolve:{} }, time:{ test_0:{} }, textBuf: { test_0:{} }, audioBuf:{ test_0:{} } diff --git a/src/cwtest/main.cpp b/src/cwtest/main.cpp index 4b3f1d5..925211f 100644 --- a/src/cwtest/main.cpp +++ b/src/cwtest/main.cpp @@ -93,7 +93,6 @@ #include "cwIo.h" #include "cwIoTest.h" #include "cwIoMinTest.h" -#include "cwIoAudioMidi.h" #include "cwIoAudioMidiApp.h" #include "cwIoMidiRecordPlay.h" #endif @@ -315,16 +314,6 @@ cw::rc_t b23TreeTest( const cw::object_t* cfg, const cw::object_t* args cw::rc_t midiFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::file::test(args); } cw::rc_t audioFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audiofile::test(args); } cw::rc_t audioFileOp( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::test(args); } -cw::rc_t audioFileMix( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::mix(args); } -cw::rc_t audioFileSelToFile( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::selectToFile(args); } -cw::rc_t audioFileCutAndMix( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::cutAndMix(args); } -cw::rc_t audioFileParallelMix( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::parallelMix(args); } -cw::rc_t audioFileTransformApp(const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::transformApp(args); } -cw::rc_t audioFileConvolve( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::convolve(args); } -cw::rc_t audioFileGenerate( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::generate(args); } -cw::rc_t fftTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::fft::test(); } -cw::rc_t ifftTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::ifft::test(); } -cw::rc_t convolveTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::convolve::test(); } cw::rc_t pianoScoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::perf_score::test(args); } cw::rc_t gutimRegTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::gutim::reg::test(args); } cw::rc_t amToMidiFile( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi_record_play::am_to_midi_file(args); } @@ -412,15 +401,7 @@ cw::rc_t datasetWtrTest( const cw::object_t* cfg, const cw::object_t* args, cw::rc_t datasetRdrTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dataset::rdr::test(args); } cw::rc_t datasetAdapterTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dataset::adapter::test(args); } -cw::rc_t svgTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) -{ - char* htmlFn = requiredNewFile( args, "outHtmlFn"); - char* cssFn = optionalNewFile( args, "outCssFn"); - cw::rc_t rc = cw::svg::test(htmlFn,cssFn); - cw::mem::release(htmlFn); - cw::mem::release(cssFn); - return rc; -} +cw::rc_t svgTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::svg::test(args); } #endif cw::rc_t dirEntryTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::filesys::dirEntryTest(args); } @@ -520,16 +501,6 @@ int main( int argc, const char* argv[] ) { "midifile", midiFileTest }, { "audiofile", audioFileTest }, { "afop", audioFileOp }, - { "audio_mix", audioFileMix }, - { "select_to_file", audioFileSelToFile }, - { "cut_and_mix", audioFileCutAndMix }, - { "parallel_mix",audioFileParallelMix }, - { "transform_app", audioFileTransformApp }, - { "convolve_file", audioFileConvolve }, - { "generate_audio",audioFileGenerate }, - { "fft", fftTest }, - { "ifft", ifftTest }, - { "convolve", convolveTest }, { "piano_score", pianoScoreTest }, { "gutim_reg", gutimRegTest }, { "am_to_midi_file", amToMidiFile },