You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-60Lines changed: 57 additions & 60 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This **library** provides a **synthetizer** for making music from samples (.wav
10
10
11
11
12
12
13
-
The Synthetizer take on one side the samples, and on the other side the Notes to play. Each Wav can be reused for multiple play.
13
+
The Synthetizer takes on one side the samples, and on the other side the Notes to play. Each Wav can be reused for multiple play.
14
14
15
15
16
16
@@ -34,17 +34,19 @@ The API now works on Windows and Linux (Rpi). A conditional compilation, dependi
34
34
35
35
Implementing your own file format reading is possible in populating the **SoundSample** type. Additional contribution can permit to handle more input file format.
36
36
37
-
#### Synthetizer capabilities
37
+
#### Synthetizer capabilities
38
38
39
-
-0.05 ms lattency for the moment, suitable for a lot of applications
39
+
-Real Time Playing and Offline Playing
40
40
- The max number of voice depends on the hardware provided, there is no hardcoded limitations, one can change the **MAX_VOICES** constant, and see whether it match the requierments. (As the number of polyphonie is increased, the processing may be heavier and can lead to increase the jitter and buffer sizes).
41
41
- Parametrized volume for each playing sound.
42
42
- Resampling : currently Nearest neighborhood algorithm (can be improved)
43
+
- Variable Output frequency, permit to adjust CPU consumption
43
44
44
45
#### Current Drivers
45
46
46
47
- Win32 SoundDriver
47
-
- Alsa SoundDriver
48
+
- Alsa SoundDriver (*nix platforms)
49
+
- PCM 16 bit Wav Output, using a cross plateform.
48
50
49
51
50
52
Can be extended outside the library, depending on needs. Theses drivers show how to implement one.
@@ -58,62 +60,58 @@ Below, an example of the use of the synthetizer in 5 mins:
58
60
59
61
60
62
```pascal
61
-
procedure Test_Open_And_Play_A_Sample(T : in out Test_Case'Class) is
62
-
63
-
use Synth.Synthetizer;
64
-
S : Synthetizer_Type;
65
-
D : Synth.Driver.Sound_Driver_Access;
66
-
Sample : Synth.SoundSample;
67
-
Sample2 : Synth.SoundSample;
68
-
V,V1 : Voice;
69
-
begin
70
-
71
-
Put_Line("Load the Sound Driver, from WIN32/Linux driver");
72
-
Synth.Driver.Open (Driver => D);
73
-
74
-
Put_Line("Open the synth");
75
-
Open (D => D, S => S);
76
-
77
-
Put_Line("Load the sample test.wav");
78
-
79
-
Synth.Wav.Load ("test-files/test.wav", Sample);
80
-
Synth.Wav.Load ("test-files/test.wav", Sample2);
81
-
82
-
Sample.Note_Frequency := 440.0; -- the sample is a A, 440 Hz
Frequency => 880.0, -- play the second sample at a +1 Octave
99
-
Channel => 1,
101
+
S => Sample,
102
+
Frequency => MIDICode_To_Frequency(65 + I),
100
103
Opened_Voice => V);
101
-
Put_Line("Stop the Voice :" & Voice'Image(V1));
102
-
103
-
-- stop the 1st sample, given the Opened Voice
104
-
Stop(Synt => S, Opened_Voice => V1);
104
+
delay(0.3);
105
+
Stop(S, V);
106
+
end loop;
105
107
106
-
-- wait to ear the 2nd sample
107
-
delay 2.0;
108
+
delay(3.0);
108
109
110
+
Close(Synt => S);
109
111
110
-
S.Close;
111
112
112
-
exception
113
-
when E : others =>
114
-
Synth.DumpException(E);
113
+
end;
115
114
116
-
end;
117
115
```
118
116
119
117
@@ -122,8 +120,6 @@ Below, an example of the use of the synthetizer in 5 mins:
122
120
123
121
The synthetizer behave nicely, there are no large amount or synchro between components. Playing Midi file is really amazing, and the quality for a first shot is quite interessing, be can be improved.
124
122
125
-
CPU consumption is not large, but on typical computer, process priority has to be upgraded to populate the sound buffer.
126
-
127
123
128
124
129
125
## Next actions
@@ -133,21 +129,22 @@ Version 0.1:
133
129
-~~Fix Memory Leak for Win32 driver~~
134
130
-~~Eval portaudio for output rendering (X Plateform sound toolkit)~~
135
131
-~~Add Alsa Driver for linux plateforms~~
136
-
- Add Wav Driver for debugging purpose or to disk exports
137
-
-Interfaçing with C, Java for consuming the library
132
+
-~~Add Wav Driver for debugging purpose or to disk exports~~
133
+
-Ahead of time playin
138
134
139
135
Version 0.2:
140
136
141
-
- Improving Sound quality, add filters
137
+
- Improving Sound quality, add numeric filters, and additional effects
138
+
- Digital Signal processing : Permit to have Low / High Bandwidth filters, Compressors, Volume regulation, FadeIn / FadeOut
139
+
- Lattency detection, permitting to have both online and offline playin
140
+
141
+
Mid Term Version :
142
142
143
-
Version 0.3:
143
+
- Interfaçing with C, Java for consuming the library
144
144
145
145
- Porting to Spark, remove the task part for embedded usage
146
146
147
-
148
147
149
148
### Areas That can be covered next (if time permit)
150
149
151
-
Digital Signal processing : Permit to have Low / High Bandwidth filters, Compressors, Volume regulation, FadeIn / FadeOut
152
-
153
150
FM generators : The current buffers are filled with Wav samples, but a short abstraction can be done to introduce signal generators and modulators to extends the use to "analog like" synthetizers.
0 commit comments