Showing posts with label mix. Show all posts
Showing posts with label mix. Show all posts

Sunday, February 8, 2026

JP80x0 midi to coefficient mapping tables

Pitch

MidiPitch
01555
11647
21745
31849
41959
52075
62198
72329
82468
92615
102770
112935
123110
133295
143491
153698
163918
174151
184397
194658
204936
215230
225541
235871
246220
256590
266982
277396
287836
298302
308794
319317
329873
3310460
3411082
3511742
3612441
3713181
3813965
3914792
4015672
4116604
4217589
4318635
4419747
4520921
4622164
4723485
4824883
4926362
5027930
5129585
5231345
5333209
5435179
5537270
5639494
5741842
5844329
5946970
6049767
6152725
6255860
6359171
6462691
6566418
6670358
6774541
6878988
6983684
7088659
7193941
7299534
73105450
74111720
75118342
76125382
77132836
78140716
79149082
80157976
81167368
82177318
83187882
84199068
85210900
86223440
87236684
88250764
89265672
90281432
91298164
92315952
93334736
94354636
95375764
96398136
97421800
98446880
99473368
100501528
101531344
102562864
103596328
104631904
105669472
106709272
107751528
108796272
109843600
110893760
111946736
1121003056
1131062688
1141125728
1151192656
1161263808
1171338944
 

Detune:

MidiuC
01
11
22
32
43
53
64
74
85
95
106
116
127
137
148
158
169
179
1810
1910
2011
2111
2212
2312
2413
2513
2614
2714
2815
2915
3016
3116
3217
3317
3418
3518
3619
3719
3820
3920
4021
4121
4222
4322
4423
4523
4624
4724
4825
4925
5026
5126
5227
5327
5428
5528
5629
5729
5830
5930
6031
6131
6232
6332
6433
6534
6635
6736
6837
6938
7039
7140
7241
7342
7443
7544
7645
7746
7847
7948
8049
8151
8253
8355
8457
8559
8661
8763
8865
8967
9069
9171
9273
9375
9477
9579
9681
9783
9885
9987
10089
10191
10293
10395
10497
10599
106101
107103
108105
109107
110109
111111
112113
113115
114117
115119
116121
117123
118125
119127
120129
121137
122145
123153
124169
125193
126225
127321
 

Mix

MidiMix
0102400
1118784
2135168
3151552
4167936
5184320
6200704
7217088
8233472
9249856
10266240
11282624
12299008
13315392
14331776
15348160
16364544
17380928
18397312
19413696
20430080
21446464
22462848
23479232
24495616
25512000
26528384
27544768
28561152
29577536
30593920
31610304
32626688
33643072
34659456
35675840
36692224
37708608
38724992
39741376
40757760
41774144
42790528
43806912
44823296
45839680
46856064
47872448
48888832
49905216
50921600
51937984
52954368
53970752
54987136
551003520
561019904
571036288
581052672
591069056
601085440
611101824
621118208
631134592
641150976
651167360
661183744
671200128
681216512
691232896
701249280
711265664
721282048
731298432
741314816
751331200
761347584
771363968
781380352
791396736
801413120
811429504
821445888
831462272
841478656
851495040
861511424
871527808
881544192
891560576
901576960
911593344
921609728
931626112
941642496
951658880
961675264
971691648
981708032
991724416
1001740800
1011757184
1021773568
1031789952
1041806336
1051822720
1061839104
1071855488
1081871872
1091888256
1101904640
1111921024
1121937408
1131953792
1141970176
1151986560
1162002944
1172019328
1182035712
1192052096
1202068480
1212084864
1222101248
1232117632
1242134016
1252150400
1262166784
1272183168
 

Friday, January 16, 2026

Mix and oscillator amplitudes, more research

I just can't let this one go. The code appears to add a linear amount of the side oscillators to the sum, but Adam Szabo says differently - the center oscillator is attenuated and the outer ones follow a curved gain.

I just had a happy accident. I am trying to find the contribution of each oscillator to the total if one normalize the sum - saying the total should always be 1.

However, I only added one single outer oscillator - but the output was very interesting:

Here it is compared to the graph in the article:

 

Here, the value of oscillator 1 is 1 / (1 + mix), whereas the plot for the others is mix / (1 + mix). The plots are quite similar! It really makes me want to understand this even more!

But - if I assume that ALL 6 outer oscillators should be included in the normalization, everything breaks down, so clearly that's not correct.

Going back to the article, we have this graph (Figure 9):

Note that the amplitudes of 5, 6 and 7 are higher than 1, 2, 3.

In the text, Szabo says that 2, 3, 5, 6 and 7 are removed, leaving 1 and 4, as illustrated in the first graph.

I don't know if he DID measure those too, but there is a chance that they don't follow the exact same curve. We'll see if we can figure that one out.

Also, let's renumber the spikes in the plot to match the order in the detune_table:

[0, 318, -318, 1020, -1029, 1760, -1800], let's call them A-G to keep them separated

That gives us:

A = 4, B = 5, C = 3, D = 6, E = 2, F = 7, G = 1

In case it matters, what is called 1 here is actually the last element added in the summing in the ESP code. 

 

Now, I'm not entirely sure how to interpret Figure 9 in terms of "max wave amplitude". The spectrum has peaks of a certain width, not just a single frequency, and there are no units on the Y axis. If the scale is linear and one assumes that the amplitude of each wave in the result is actually propotional to the max value of the center oscillator, we get the numbers in the table (each pure frequency is a sine wave, so the highest peak would correspond to the root frequency of the saw waves, wouldn't it)?

It looks like that's what Szabo means that they are, so let's accept that.

If so, the sum of all amplitudes is definitely not 1. Could the perceived total "loudness" be equal if one uses dB instead of a linear scale? The total energy or something?  

And in any case, how does one go from the sum += saw[i] * mix to this thing? 

My own measurements

I wanted to confirm my understanding of Szabo's graph, so I fired up JE-8086 and coded a spectrum analyzer in web audio. I fed the audio from JE-8086 back to the input of my mac using the virtual microphone/input "VB-cable".

I used a linear Y-axis and a logarithmic X-axis. Then, with detuning at max, for every line on the mix pot (11 in total) I screenshot'ed the spectrum. Finally, I went through every graph, measuring the height in pixels.

Here is the first and last spectrum plots:



The measurements were of course wildly inaccurate, and the spacing between the mix values not quite even as I couldn't see the slider value in the display (and also, the slider resolution wasn't high enough). 

Here are the values:



And, more importantly, the plot of the values relative to max value of the center oscillator:


 



This is indeed very cool. It does confirm most of what Szabo described - the center oscillator is fairly linear and the others are definitely curved, and the center oscillator ends at an amplitude lower than the outer ones. There are some small differences though:

- I don't get the feeling that the outer oscillators actually go DOWN in amplitude at the end. The 7th oscillator appears to go slightly  down again, but I think it's more likely a measuring error. 

- The higher pitch / right hand oscillators have a higher amplitude than the lower ones. This matches what can be seen in Figure 9 in Szabo. The top oscillator is even higher though, and that does not match. I am still not sure if this is an artifact of the spectrum analyzer or if it is real. It could be an artifact of approximate multiplication or running average or something. 

- Something else to note: Both in mine and Szabo's spectrum analyzers, the minimum amplitudes for the outer oscillators is not zero. If the summing is actually saw[i] * spread, there should be no trace of the oscillator if spread is 0. Very strange. Also - why do they call it spread and not mix?