Compare commits

..

10 Commits

13 changed files with 813 additions and 795 deletions

198
README.md
View File

@ -33,18 +33,21 @@ The goal of `cwtest` is to be able to easily exercise `libcw`
functions, or build simple utilities based on them, with a flexible
sets of parameters. The primary parameter file is `src/cwtest/cfg/main.cfg`.
----
# MIDI - MIDI Device Manager
# MIDI - MIDI devices and files.
CLI Label | Source File | Function
Label | Source File | Function
----------------------|----------------------|--------------
__midiDeviceReport__ | cwMidiDeviceTest.cpp | testReport()
List The current set of MIDI hardware devices
Label | Source File | Function
------------------|----------------------|--------------
midiDeviceReport | cwMidiDeviceTest.cpp | testReport()
List The current set of MIID hardware devices and their ports.
CLI Label | Source File | Function
------------------|----------------------|--------------
midiDevice | cwMidiDeviceTest.cpp | test()
__midiDevice__ | cwMidiDeviceTest.cpp | test()
Interactive testing of the MIDI input file device
start/pause/unpause/stop functions. This function also validates the
@ -52,35 +55,34 @@ 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.
CLI Label | Source File | Function
Label | Source File | Function
------------------|----------------------|--------------
midifile | cwMidiFile.cpp | test()
__midifile__ | cwMidiFile.cpp | test()
MIDI file utility parameters:
Convert a MIDI file to a CSV file.
- Convert a MIDI file to a CSV file.
```
csv: { midiFn:<filename> csvFn:<filename> }
```
Print the first <msgCnt> MIDI messages from a file.
- Print the first <msgCnt> MIDI messages from a file.
```
rpt_beg_end: { midi_fname:<filenae>, msgCnt:<int>, note_on_only_fl:<true|false> }
```
Print the entire contents of the MIDI file.
- Print the entire contents of the MIDI file.
```
rpt : { midiFn:<filename> }
```
Convert all the MIDI files in the folder: `<path>/<folder>/take/'record_%i'` to CSV files
- Convert all the MIDI files in the folder: `<path>/<folder>/take/'record_%i'` to CSV files
```
batch_convert: { io_dir:<path>, session_dir:<folder>, take_begin:<int>, take_end:<int> print_warnings_flag:<true|false> }
```
----
## Serial - Serial Port Manager
@ -93,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
@ -103,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
@ -113,39 +119,140 @@ 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
------------------|----------------------|---------------------
audioDevRpt | cwAudioDevice.cpp | report
audioDevRpt | cwAudioDevice.cpp | report()
Generate a list of devices and device attributes from libcw. This will include audio file based devices.
CLI Label | Source File | Function
------------------|----------------------|---------------------
audiofile | cwAudioFile.cpp | test()
Report the audio file format and a selected set of sample values.
# Operations on Audio Files
CLI Label | Source File | Function
------------------|----------------------|---------------------
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 - 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
CLI Label | Source File | Function
---------------------|----------------------|---------------------
socketMgrSrvTest | cwSocket | mainTest()
socketMgrClientTest | cwSocket | mainTest()
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
@ -153,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:

View File

@ -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,

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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:{} }

View File

@ -0,0 +1,7 @@
: out : : 1.000000 : 0.500000 : 0.250000 : 0.100000 :
: ola : : 0.050000 : 0.000000 : 0.000000 : -0.000000 :
: out : : 1.050000 : 0.500000 : 0.250000 : 0.100000 :
: ola : : 0.050000 : 0.000000 : 0.000000 : -0.000000 :
: out : : 1.050000 : 0.500000 : 0.250000 : 0.100000 :
: ola : : 0.050000 : 0.000000 : 0.000000 : -0.000000 :
: yV : : 1.00 : 0.50 : 0.25 : 0.10 : 1.05 : 0.50 : 0.25 : 0.10 : 1.05 : 0.50 : 0.25 : 0.10 : 0.05 : 0.00 : 0.00 : 0.00 : 0.00 : 0.00 : 0.00 : 0.00 :

View File

@ -0,0 +1,3 @@
: sin : : 0.000000 : 0.382683 : 0.707107 : 0.923880 : 1.000000 : 0.923880 : 0.707107 : 0.382683 : -0.000000 : -0.382683 : -0.707107 : -0.923880 : -1.000000 : -0.923879 : -0.707107 : -0.382683 :
: mag : : 0.000000 : 1.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 :
: phs : : 0.000000 : -1.570796 : -2.546503 : 0.000000 : -1.872442 : -0.749834 : 1.800163 : 3.141593 : 3.141593 :

View File

@ -0,0 +1,4 @@
: sin : : 0.000000 : 0.382683 : 0.707107 : 0.923880 : 1.000000 : 0.923880 : 0.707107 : 0.382683 : 0.000000 : -0.382683 : -0.707107 : -0.923880 : -1.000000 : -0.923880 : -0.707107 : -0.382683 :
: mag : : 0.000000 : 1.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 :
: phs : : 3.141593 : -1.570796 : -2.128818 : -1.399942 : -1.133610 : -0.858986 : -0.562898 : 0.000000 : 0.000000 :
: sig : : 0.000000 : 0.382683 : 0.707107 : 0.923880 : 1.000000 : 0.923880 : 0.707107 : 0.382683 : 0.000000 : -0.382683 : -0.707107 : -0.923880 : -1.000000 : -0.923880 : -0.707107 : -0.382683 :

View File

@ -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 },