summaryrefslogtreecommitdiff
path: root/README.org
blob: 6dc62204133691654f1d0461c92c87adfcca2b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#+TITLE: Rusty Microphone

* Summary

The goal of this project is to create a dashboard for real-time
feedback to musicians while they are practicing. This is a personal
needs project, and so will at least initially focus only on the
trumpet, and problems that I personally face.

The other goal of this project is to give me a platform for learning
Rust, and various other technologies that I do not get to touch in my
day to day work.

NB this is a work in progress, and does not provide any actual value
yet.

* Getting started

This is a Rust project. The latest version of the Rust compiler and
Cargo are available from your system's package manager, or from
https://www.rust-lang.org/.

To compile the project
src_sh{cargo build}

To compile and run
src_sh{cargo run}

To compile and run unit tests. Use this as the CI build command if
setting up a CI server.
src_sh{cargo test}

* Project structure

** File Structure

- Dependencies are declared in ~Cargo.toml~
- The project main function for the project executable is in
  ~src/main.rs~. This should only be an entry point. Any actual
  functionality should be part of the library build.
- The other files to be included in the build are declared in
  ~src/lib.rs~.
- Unit tests are kept in the same files as the units they are testing.
- The main function will launch the GUI in ~src/gui.rs~. From here,
  the GUI can call out to the other parts of the library as required.

** General Architectural Guidelines

- Try to keep functions pure when possible. If not possible, try to
  isolate the impure parts.
- Split functionality into files based on their logical separation of
  concerns. Try to keep mathematical processing separate from
  presentation logic, so that the processing can be reused
  independently.

* Tasks
** Project setup
*** DONE Cargo build process
- This is probably already in place, since it's 'just use Cargo', but
  it needs to be in the docs mentioned below.
*** DONE Getting started docs
- For myself two months later. This doubles as revision exercise on
  how a Rust project can be laid out.
*** DONE CI build
- it's only me on the project, so manually triggered with a script and
  not actually on a CI server is fine. This is probably just 'use
  Cargo test', but again, formalize and in the docs above.
** Audio interfaces
*** DONE Read the list of microphones.
*** DONE Start listening on a selected microphone, and let other plugins process the signal.
*** DONE Function for finding frequency spectrum
*** TODO Function for finding fundamental frequencies, expressed as a note and amount sharp/flat
There is an implementation here that works for sinusoids in test
cases, but really does not work for real signals. This may need a
different method of finding frequencies, such as using correlation
with a time delay.
** GUI
*** DONE Opens a window with a drop down of available microphones
*** TODO Real-time updating graph of frequency spectrum
This is mostly for debugging purposes, but having a component that a
debugging graph can be put into may be useful.

I'm drawing something now at least. It still needs things like axis
labels to be useful.
*** TODO Real-time updating graphical representation of fundamental frequency
We have a label so far, but a label isn't exactly a nice thing to
watch while playing.