summaryrefslogtreecommitdiff
path: root/README
blob: 06efed4a138675c654ad437156c2245b3b9ec318 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Music sequencer and audio editor


Tech

- kit           - https://guattari.tech/kit.git
- sokol_app     - https://github.com/floooh/sokol.git
- nanovg        - https://github.com/memononen/nanovg.git
- miniaudio     - https://github.com/mackron/miniaudio.git
- portmidi      - https://github.com/PortMidi/portmidi.git


Algorithms

- Cooley-Tukey FFT
- Biquad filter


Primary design


Basic UI

- Bus list
- Bus units
- Track editor
- Sheet editor

+---------+ +-----------------------------------+  +-[ Bus A ]-------+
[+]Bus A  ^ | [ track 1 ====== ]                ^  [+] Arpeggiator   ^
|---------| |                                   |  | [x] **  ***     |
[+]Bus B  | |        [ track 2 ============== ] |  | [ ] <-->  ++    |
|---------| |                                   |  |-----------------|
[+]Master v |                                   v  [+] Synth         |
[+]-------+ +<--------------------------------->+  |  ^   ^   ^  [ ] |
                                                   | / \ / \ /   [x] |
+----[ track 2 ]--------------------------------+  |    V   V    [o] |
|F >                                            ^  |-----------------|
|E >        x   x                 x x       x   |  [+] Reverb        |
|D >    x           x         x x       x       |  | <-----> [x] [u] |
|C >  x   x   x   x   x               x   x     v  |                 v
+--|<------------------------------------------>+  [+]---------------+


Modularity

Music and audio features will be implemented as a separate library with no external dependencies.
UI and audio devices will be distinct modules which can be replaced.


Sheet data

  /---------------------\
  |                     |
  |   Note              |
  |                     |
  |   time      : i64   |
  |   duration  : i64   |
  |   frequency : f64   |
  |   amplitude : f64   |
  |   flavor    : f64   |
  |                     |
  \---------------------/

Unlike MIDI, we will allow to set any floating-point value for the note frequency.
Time is defined as a sample index and therefore is relative to the sample rate.


Processing

A unit is a processing entity.

  for each unit:
    output[channel, time] = eval(inputs, channel, sample_rate, time)

Unlike VST, time for a processing routine is one of explicit parameters.
The processing routine can access any samples of inputs.
This approach allows to evaluate samples non-sequentially, and even do some tricks like time-reverse effects.
Changing the sample rate is also quite simple.


Global matrix

            /---------------------------\
            |         Matrix            |
            |                           |
            | (connections data)        |
            | A.out[0] -> B.in[0]       |-----------------+
            | B.out[0] -> Master.in[0]  |----------------+|
            | B.out[1] -> Master.in[1]  |                ||
            \---------------------------/                ||
               ^           |       ^^                    ||(in[0], in[1])
               |           |       ||                    ||
               |           |       ||(out[0], out[1])    vv
/----------\   |           |   /----------\           /-----------\
| Module A |---+           +-->| Module B |           | Master    |
| (sheet)  | (out[0])  (in[0]) | (synth)  |           | (limiter) |
\----------/                   \----------/           \-----------/

The global matrix manages the information about connections between units.
Each unit can communicate to others through the global matrix.
Each unit can have inputs and outputs for sheet and signal channels.

To get data from a producing unit, the receiving unit will request the data from the global matrix using the input index.
The global matrix will resolve the producing unit by input index, and request data from it.
The evaluation startes from the master and gradually reaches all required units.


Global modifiers

Special units can affect all regular units, filtered by some criteria.
This will allow to do some global changes, e.g. change the musical scale of the entire composition.


Customization

In the matrix mode, any inputs and outputs can be connected.
A custom unit can be created with code editor and JIT-compilation.