Debian Codegraph @

src/pt2_chordmaker.c

raw symbols SCIP
1 // for finding memory leaks in debug mode with Visual Studio cxx . . $ `<file>/src/pt2_chordmaker.c`/
2 #if defined _DEBUG && defined _MSC_VER
3 #include <crtdbg.h>
4 #endif
5
6 #include <stdio.h>
7 #include <stdint.h>
8 #include <stdbool.h>
9 #include <string.h>
10 #include <math.h>
11 #include "pt2_config.h"cxx . . $ `<file>/src/pt2_config.h`/
12 #include "pt2_textout.h"cxx . . $ `<file>/src/pt2_textout.h`/
13 #include "pt2_visuals.h"cxx . . $ `<file>/src/pt2_visuals.h`/
14 #include "pt2_helpers.h"cxx . . $ `<file>/src/pt2_helpers.h`/
15 #include "pt2_tables.h"cxx . . $ `<file>/src/pt2_tables.h`/
16 #include "pt2_sampler.h"cxx . . $ `<file>/src/pt2_sampler.h`/
17 #include "pt2_audio.h"cxx . . $ `<file>/src/pt2_audio.h`/
18 #include "pt2_blep.h"cxx . . $ `<file>/src/pt2_blep.h`/
19 #include "pt2_downsample2x.h"cxx . . $ `<file>/src/pt2_downsample2x.h`/
20 #include "pt2_replayer.h"cxx . . $ `<file>/src/pt2_replayer.h`/
21
22 #define MAX_NOTEScxx . . $ `src/pt2_chordmaker.c:22:9`! 4
23
24 typedef struct sampleMixer_tcxx . . $ sampleMixer_t#
25 {
26 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! activecxx . . $ sampleMixer_t#active.;
27 int32_tcxx . . $ int32_t# lengthcxx . . $ sampleMixer_t#length., poscxx . . $ sampleMixer_t#pos.;
28 float fDeltacxx . . $ sampleMixer_t#fDelta., fPhasecxx . . $ sampleMixer_t#fPhase., fBlepPhasecxx . . $ sampleMixer_t#fBlepPhase.;
29 } sampleMixer_tcxx . . $ sampleMixer_t#;
30
31 static void sortNotescxx . . $ sortNotes(49f6e7a06ebc5aa8).(void)
32 {
33 for (int32_tcxx . . $ int32_t# i = 0; i < 3; i++)
34 {
35 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. == 36)
36 {
37 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note3cxx . . $ editor_t#note3.;
38 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note4cxx . . $ editor_t#note4.;
39 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
40 }
41 }
42
43 for (int32_tcxx . . $ int32_t# i = 0; i < 3; i++)
44 {
45 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. == 36)
46 {
47 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note4cxx . . $ editor_t#note4.;
48 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
49 }
50 }
51 }
52
53 static void removeDuplicateNotescxx . . $ removeDuplicateNotes(49f6e7a06ebc5aa8).(void)
54 {
55 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. == editorcxx . . $ editor..note3cxx . . $ editor_t#note3.) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
56 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. == editorcxx . . $ editor..note2cxx . . $ editor_t#note2.) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
57 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. == editorcxx . . $ editor..note2cxx . . $ editor_t#note2.) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = 36;
58 }
59
60 static void setupMixVoicecxx . . $ setupMixVoice(b41b411ea90ed030).(sampleMixer_tcxx . . $ sampleMixer_t# *v, int32_tcxx . . $ int32_t# length, double dDelta)
61 {
62 v->fDeltacxx . . $ sampleMixer_t#fDelta. = v->fBlepPhasecxx . . $ sampleMixer_t#fBlepPhase. = (float)dDelta;
63
64 v->lengthcxx . . $ sampleMixer_t#length. = (int32_tcxx . . $ int32_t#)ceilcxx . . $ ceil(447c67c6676f75c3).(length / dDelta);
65 if (v->lengthcxx . . $ sampleMixer_t#length. > 0)
66 v->activecxx . . $ sampleMixer_t#active. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
67 }
68
69 // this has 2x oversampling for BLEP to function properly with all pitches
70 void mixChordSamplecxx . . $ mixChordSample(49f6e7a06ebc5aa8).(void)
71 {
72 char smpText[22+1];
73 int32_tcxx . . $ int32_t# i;
74 sampleMixer_tcxx . . $ sampleMixer_t# mixCh[MAX_NOTEScxx . . $ `src/pt2_chordmaker.c:22:9`!];
75 blep_tcxx . . $ blep_t# bleps[MAX_NOTEScxx . . $ `src/pt2_chordmaker.c:22:9`!];
76
77 if (editorcxx . . $ editor..sampleZerocxx . . $ editor_t#sampleZero.)
78 {
79 statusNotSampleZerocxx . . $ statusNotSampleZero(49f6e7a06ebc5aa8).();
80 return;
81 }
82
83 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
84 {
85 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
86 return;
87 }
88
89 moduleSample_tcxx . . $ moduleSample_t# *s = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.];
90 if (s->lengthcxx . . $ moduleSample_t#length. == 0)
91 {
92 statusSampleIsEmptycxx . . $ statusSampleIsEmpty(49f6e7a06ebc5aa8).();
93 return;
94 }
95
96 // check if all notes are the same (illegal)
97 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! sameNotes = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
98 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. != 36 && editorcxx . . $ editor..note2cxx . . $ editor_t#note2. != editorcxx . . $ editor..note1cxx . . $ editor_t#note1.) sameNotes = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; else editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = 36;
99 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. != 36 && editorcxx . . $ editor..note3cxx . . $ editor_t#note3. != editorcxx . . $ editor..note1cxx . . $ editor_t#note1.) sameNotes = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; else editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = 36;
100 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. != 36 && editorcxx . . $ editor..note4cxx . . $ editor_t#note4. != editorcxx . . $ editor..note1cxx . . $ editor_t#note1.) sameNotes = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; else editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
101
102 if (sameNotes)
103 {
104 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("ONLY ONE NOTE!");
105 return;
106 }
107
108 sortNotescxx . . $ sortNotes(49f6e7a06ebc5aa8).();
109 removeDuplicateNotescxx . . $ removeDuplicateNotes(49f6e7a06ebc5aa8).();
110
111 uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
112 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
113 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
114 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
115
116 // setup some variables
117 int32_tcxx . . $ int32_t# smpLoopStart = s->loopStartcxx . . $ moduleSample_t#loopStart.;
118 int32_tcxx . . $ int32_t# smpLoopLength = s->loopLengthcxx . . $ moduleSample_t#loopLength.;
119 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! smpLoopFlag = (smpLoopStart + smpLoopLength) > 2;
120 int32_tcxx . . $ int32_t# smpEnd = smpLoopFlag ? (smpLoopStart + smpLoopLength) : s->lengthcxx . . $ moduleSample_t#length.;
121 int8_tcxx . . $ int8_t# *smpData = &songcxx . . $ song.->sampleDatacxx . . $ module_t#sampleData.[s->offsetcxx . . $ moduleSample_t#offset.];
122
123 if (editorcxx . . $ editor..newOldFlagcxx . . $ editor_t#newOldFlag. == 0)
124 {
125 // find a free sample slot for the new sample
126
127 for (i = 0; i < MOD_SAMPLEScxx . . $ `src/pt2_header.h:74:9`!; i++)
128 {
129 if (songcxx . . $ song.->samplescxx . . $ module_t#samples.[i].lengthcxx . . $ moduleSample_t#length. == 0)
130 break;
131 }
132
133 if (i == MOD_SAMPLEScxx . . $ `src/pt2_header.h:74:9`!)
134 {
135 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO EMPTY SAMPLE!");
136 return;
137 }
138
139 uint8_tcxx . . $ uint8_t# smpFinetune = s->fineTunecxx . . $ moduleSample_t#fineTune.;
140 int8_tcxx . . $ int8_t# smpVolume = s->volumecxx . . $ moduleSample_t#volume.;
141 memcpycxx . . $ memcpy(cc817cb175f282d).(smpText, s->textcxx . . $ moduleSample_t#text., sizeof (smpText));
142
143 s = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[i];
144 s->fineTunecxx . . $ moduleSample_t#fineTune. = smpFinetune;
145 s->volumecxx . . $ moduleSample_t#volume. = smpVolume;
146
147 memcpycxx . . $ memcpy(cc817cb175f282d).(s->textcxx . . $ moduleSample_t#text., smpText, sizeof (smpText));
148 editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample. = (int8_tcxx . . $ int8_t#)i;
149 }
150
151 float *fMixData = (float *)calloccxx . . $ calloc(63a7bf2941bfcd7a).(configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.*2, sizeof (float));
152 if (fMixData == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
153 {
154 statusOutOfMemorycxx . . $ statusOutOfMemory(49f6e7a06ebc5aa8).();
155 return;
156 }
157
158 s->lengthcxx . . $ moduleSample_t#length. = smpLoopFlag ? configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. : editorcxx . . $ editor..chordLengthcxx . . $ editor_t#chordLength.; // if sample loops, set max length
159 s->loopLengthcxx . . $ moduleSample_t#loopLength. = 2;
160 s->loopStartcxx . . $ moduleSample_t#loopStart. = 0;
161 s->textcxx . . $ moduleSample_t#text.[21] = '!'; // chord sample indicator
162 s->textcxx . . $ moduleSample_t#text.[22] = '\0';
163
164 // clear mix voices (also clears position and frac etc.)
165 memsetcxx . . $ memset(d1de1e4fb215f1c6).(mixCh, 0, sizeof (mixCh));
166
167 const int32_tcxx . . $ int32_t# outputNote = 24; // C-3 (16574.276Hz)
168 const double dOutputHz = (PAULA_PAL_CLKcxx . . $ `src/pt2_paula.h:14:9`! / (double)periodTablecxx . . $ periodTable.[outputNote]) * 2.0; // *2 for 2x oversampling
169
170 // set voice pitches
171 const double dBaseClk = PAULA_PAL_CLKcxx . . $ `src/pt2_paula.h:14:9`! / dOutputHz;
172 const int16_tcxx . . $ int16_t# *periods = &periodTablecxx . . $ periodTable.[(s->fineTunecxx . . $ moduleSample_t#fineTune. & 0xF) * 37];
173 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. < 36) setupMixVoicecxx . . $ setupMixVoice(b41b411ea90ed030).(&mixCh[0], smpEnd, dBaseClk / periods[editorcxx . . $ editor..note1cxx . . $ editor_t#note1.]);
174 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. < 36) setupMixVoicecxx . . $ setupMixVoice(b41b411ea90ed030).(&mixCh[1], smpEnd, dBaseClk / periods[editorcxx . . $ editor..note2cxx . . $ editor_t#note2.]);
175 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. < 36) setupMixVoicecxx . . $ setupMixVoice(b41b411ea90ed030).(&mixCh[2], smpEnd, dBaseClk / periods[editorcxx . . $ editor..note3cxx . . $ editor_t#note3.]);
176 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. < 36) setupMixVoicecxx . . $ setupMixVoice(b41b411ea90ed030).(&mixCh[3], smpEnd, dBaseClk / periods[editorcxx . . $ editor..note4cxx . . $ editor_t#note4.]);
177
178 // start mixing
179 memsetcxx . . $ memset(d1de1e4fb215f1c6).(bleps, 0, sizeof (bleps));
180 turnOffVoicescxx . . $ turnOffVoices(49f6e7a06ebc5aa8).();
181
182 sampleMixer_tcxx . . $ sampleMixer_t# *v = mixCh;
183 blep_tcxx . . $ blep_t# *bSmp = bleps;
184
185 for (i = 0; i < MAX_NOTEScxx . . $ `src/pt2_chordmaker.c:22:9`!; i++, v++, bSmp++)
186 {
187 if (!v->activecxx . . $ sampleMixer_t#active. || v->fDeltacxx . . $ sampleMixer_t#fDelta. == 0.0f)
188 continue;
189
190 for (int32_tcxx . . $ int32_t# j = 0; j < configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.*2; j++) // *2 for 2x oversampling
191 {
192 float fSmp = smpData[v->poscxx . . $ sampleMixer_t#pos.] * (1.0f / 128.0f);
193
194 if (fSmp != bSmp->fLastValuecxx . . $ blep_t#fLastValue.)
195 {
196 if (v->fDeltacxx . . $ sampleMixer_t#fDelta. > v->fBlepPhasecxx . . $ sampleMixer_t#fBlepPhase.)
197 {
198 const float fBlepOffset = v->fBlepPhasecxx . . $ sampleMixer_t#fBlepPhase. / v->fDeltacxx . . $ sampleMixer_t#fDelta.;
199 blepAddcxx . . $ blepAdd(878c0c6d9184ff8a).(bSmp, fBlepOffset, bSmp->fLastValuecxx . . $ blep_t#fLastValue. - fSmp);
200 }
201
202 bSmp->fLastValuecxx . . $ blep_t#fLastValue. = fSmp;
203 }
204
205 if (bSmp->samplesLeftcxx . . $ blep_t#samplesLeft. > 0)
206 fSmp = blepRuncxx . . $ blepRun(6ddfbab99006406a).(bSmp, fSmp);
207
208 fMixData[j] += fSmp;
209
210 v->fPhasecxx . . $ sampleMixer_t#fPhase. += v->fDeltacxx . . $ sampleMixer_t#fDelta.;
211 if (v->fPhasecxx . . $ sampleMixer_t#fPhase. >= 1.0f)
212 {
213 v->fPhasecxx . . $ sampleMixer_t#fPhase. -= 1.0f;
214 v->fBlepPhasecxx . . $ sampleMixer_t#fBlepPhase. = v->fPhasecxx . . $ sampleMixer_t#fPhase.;
215
216 v->poscxx . . $ sampleMixer_t#pos.++;
217 if (v->poscxx . . $ sampleMixer_t#pos. >= smpEnd)
218 {
219 if (smpLoopFlag)
220 {
221 do
222 {
223 v->poscxx . . $ sampleMixer_t#pos. -= smpLoopLength;
224 }
225 while (v->poscxx . . $ sampleMixer_t#pos. >= smpEnd);
226 }
227 else
228 {
229 break;
230 }
231 }
232 }
233 }
234 }
235
236 // downsample oversampled buffer, normalize and quantize to 8-bit
237
238 downsample2xFloatcxx . . $ downsample2xFloat(ac1d28a1859f2825).(fMixData, s->lengthcxx . . $ moduleSample_t#length. * 2);
239
240 const float fPeak = getFloatPeakcxx . . $ getFloatPeak(5c3cfcb0fda3feba).(fMixData, s->lengthcxx . . $ moduleSample_t#length.);
241
242 float fAmp = 0.0f;
243 if (fPeak > 0.0f)
244 fAmp = INT8_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:110:10`! / fPeak;
245
246 int8_tcxx . . $ int8_t# *smpPtr = &songcxx . . $ song.->sampleDatacxx . . $ module_t#sampleData.[s->offsetcxx . . $ moduleSample_t#offset.];
247 for (i = 0; i < s->lengthcxx . . $ moduleSample_t#length.; i++)
248 {
249 const int32_tcxx . . $ int32_t# smp = (const int32_tcxx . . $ int32_t#)roundf(fMixData[i] * fAmp);
250 ASSERTcxx . . $ `src/pt2_header.h:25:9`!(smp >= -128 && smp <= 127); // shouldn't happen according to fAmp (but just in case)
251 smpPtr[i] = (int8_tcxx . . $ int8_t#)smp;
252 }
253
254 freecxx . . $ free(5d22bdacc48458e8).(fMixData);
255
256 // clear unused sample data (if sample is not full already)
257 if (s->lengthcxx . . $ moduleSample_t#length. < configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.)
258 memsetcxx . . $ memset(d1de1e4fb215f1c6).(&songcxx . . $ song.->sampleDatacxx . . $ module_t#sampleData.[s->offsetcxx . . $ moduleSample_t#offset. + s->lengthcxx . . $ moduleSample_t#length.], 0, configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. - s->lengthcxx . . $ moduleSample_t#length.);
259
260 // we're done
261
262 editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. = 0;
263 fixSampleBeepcxx . . $ fixSampleBeep(60146f4515acbace).(s);
264 updateCurrSamplecxx . . $ updateCurrSample(49f6e7a06ebc5aa8).();
265
266 updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.);
267 }
268
269 static void backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).(void)
270 {
271 editorcxx . . $ editor..oldNote1cxx . . $ editor_t#oldNote1. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1.;
272 editorcxx . . $ editor..oldNote2cxx . . $ editor_t#oldNote2. = editorcxx . . $ editor..note2cxx . . $ editor_t#note2.;
273 editorcxx . . $ editor..oldNote3cxx . . $ editor_t#oldNote3. = editorcxx . . $ editor..note3cxx . . $ editor_t#note3.;
274 editorcxx . . $ editor..oldNote4cxx . . $ editor_t#oldNote4. = editorcxx . . $ editor..note4cxx . . $ editor_t#note4.;
275 }
276
277 void recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).(void)
278 {
279 int32_tcxx . . $ int32_t# note;
280
281 moduleSample_tcxx . . $ moduleSample_t# *s = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.];
282
283 if (editorcxx . . $ editor..chordLengthMincxx . . $ editor_t#chordLengthMin.)
284 {
285 note = MAXcxx . . $ `src/pt2_helpers.h:35:9`!(MAXcxx . . $ `src/pt2_helpers.h:35:9`!((editor.note1 == 36) ? -1 : editor.note1,
286 (editor.note2 == 36) ? -1 : editor.note2),
287 MAXcxx . . $ `src/pt2_helpers.h:35:9`!((editor.note3 == 36) ? -1 : editor.note3,
288 (editor.note4 == 36) ? -1 : editor.note4));
289 }
290 else
291 {
292 note = MINcxx . . $ `src/pt2_helpers.h:34:9`!(MINcxx . . $ `src/pt2_helpers.h:34:9`!(editor.note1, editor.note2), MINcxx . . $ `src/pt2_helpers.h:34:9`!(editor.note3, editor.note4));
293 }
294
295 if (note < 0 || note > 35)
296 {
297 editorcxx . . $ editor..chordLengthcxx . . $ editor_t#chordLength. = 0;
298 }
299 else
300 {
301 int32_tcxx . . $ int32_t# len = (s->lengthcxx . . $ moduleSample_t#length. * periodTablecxx . . $ periodTable.[(37 * s->fineTunecxx . . $ moduleSample_t#fineTune.) + note]) / periodTablecxx . . $ periodTable.[24];
302 if (len > configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.)
303 len = configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.;
304
305 editorcxx . . $ editor..chordLengthcxx . . $ editor_t#chordLength. = len & configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.;
306 }
307
308 if (uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown. && uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3)
309 uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
310 }
311
312 void resetChordcxx . . $ resetChord(49f6e7a06ebc5aa8).(void)
313 {
314 editorcxx . . $ editor..note1cxx . . $ editor_t#note1. = 36;
315 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = 36;
316 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = 36;
317 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
318
319 editorcxx . . $ editor..chordLengthMincxx . . $ editor_t#chordLengthMin. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
320
321 uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
322 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
323 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
324 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
325
326 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
327 }
328
329 void undoChordcxx . . $ undoChord(49f6e7a06ebc5aa8).(void)
330 {
331 editorcxx . . $ editor..note1cxx . . $ editor_t#note1. = editorcxx . . $ editor..oldNote1cxx . . $ editor_t#oldNote1.;
332 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..oldNote2cxx . . $ editor_t#oldNote2.;
333 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..oldNote3cxx . . $ editor_t#oldNote3.;
334 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = editorcxx . . $ editor..oldNote4cxx . . $ editor_t#oldNote4.;
335
336 uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
337 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
338 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
339 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
340
341 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
342 }
343
344 void toggleChordLengthcxx . . $ toggleChordLength(49f6e7a06ebc5aa8).(void)
345 {
346 if (songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].loopLengthcxx . . $ moduleSample_t#loopLength. == 2 && songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].loopStartcxx . . $ moduleSample_t#loopStart. == 0)
347 {
348 editorcxx . . $ editor..chordLengthMincxx . . $ editor_t#chordLengthMin. = mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed. ? truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`! : falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
349 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
350 }
351 }
352
353 void setChordMajorcxx . . $ setChordMajor(49f6e7a06ebc5aa8).(void)
354 {
355 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
356 {
357 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
358 return;
359 }
360
361 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
362
363 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 4;
364 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
365
366 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
367 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
368
369 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
370
371 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
372 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
373 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
374
375 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
376 }
377
378 void setChordMinorcxx . . $ setChordMinor(49f6e7a06ebc5aa8).(void)
379 {
380 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
381 {
382 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
383 return;
384 }
385
386 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
387
388 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 3;
389 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
390
391 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
392 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
393
394 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
395
396 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
397 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
398 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
399
400 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
401 }
402
403 void setChordSus4cxx . . $ setChordSus4(49f6e7a06ebc5aa8).(void)
404 {
405 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
406 {
407 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
408 return;
409 }
410
411 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
412
413 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 5;
414 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
415
416 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
417 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
418
419 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
420
421 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
422 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
423 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
424
425 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
426 }
427
428 void setChordMajor6cxx . . $ setChordMajor6(49f6e7a06ebc5aa8).(void)
429 {
430 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
431 {
432 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
433 return;
434 }
435
436 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
437
438 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 4;
439 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
440 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 9;
441
442 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
443 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
444 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. >= 36) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. -= 12;
445
446 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
447 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
448 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
449
450 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
451 }
452
453 void setChordMinor6cxx . . $ setChordMinor6(49f6e7a06ebc5aa8).(void)
454 {
455 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
456 {
457 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
458 return;
459 }
460
461 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
462
463 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 3;
464 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
465 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 9;
466
467 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
468 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
469 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. >= 36) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. -= 12;
470
471 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
472 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
473 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
474
475 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
476 }
477
478 void setChordMajor7cxx . . $ setChordMajor7(49f6e7a06ebc5aa8).(void)
479 {
480 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
481 {
482 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
483 return;
484 }
485
486 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
487
488 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 4;
489 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
490 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 11;
491
492 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
493 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
494 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. >= 36) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. -= 12;
495
496 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
497 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
498 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
499
500 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
501 }
502
503 void setChordMinor7cxx . . $ setChordMinor7(49f6e7a06ebc5aa8).(void)
504 {
505 if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. == 36)
506 {
507 displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NO BASENOTE!");
508 return;
509 }
510
511 backupChordcxx . . $ backupChord(49f6e7a06ebc5aa8).();
512
513 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 3;
514 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 7;
515 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = editorcxx . . $ editor..note1cxx . . $ editor_t#note1. + 10;
516
517 if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. >= 36) editorcxx . . $ editor..note2cxx . . $ editor_t#note2. -= 12;
518 if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. >= 36) editorcxx . . $ editor..note3cxx . . $ editor_t#note3. -= 12;
519 if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. >= 36) editorcxx . . $ editor..note4cxx . . $ editor_t#note4. -= 12;
520
521 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
522 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
523 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
524
525 recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).();
526 }
527
528 void selectChordNote1cxx . . $ selectChordNote1(49f6e7a06ebc5aa8).(void)
529 {
530 if (mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed.)
531 {
532 editorcxx . . $ editor..note1cxx . . $ editor_t#note1. = 36;
533 }
534 else
535 {
536 uicxx . . $ ui..changingChordNotecxx . . $ ui_t#changingChordNote. = 1;
537 setStatusMessagecxx . . $ setStatusMessage(90ef5b561fbcb8de).("SELECT NOTE", NO_CARRYcxx . . $ NO_CARRY.);
538 pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.);
539 }
540
541 uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
542 }
543
544 void selectChordNote2cxx . . $ selectChordNote2(49f6e7a06ebc5aa8).(void)
545 {
546 if (mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed.)
547 {
548 editorcxx . . $ editor..note2cxx . . $ editor_t#note2. = 36;
549 }
550 else
551 {
552 uicxx . . $ ui..changingChordNotecxx . . $ ui_t#changingChordNote. = 2;
553 setStatusMessagecxx . . $ setStatusMessage(90ef5b561fbcb8de).("SELECT NOTE", NO_CARRYcxx . . $ NO_CARRY.);
554 pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.);
555 }
556
557 uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
558 }
559
560 void selectChordNote3cxx . . $ selectChordNote3(49f6e7a06ebc5aa8).(void)
561 {
562 if (mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed.)
563 {
564 editorcxx . . $ editor..note3cxx . . $ editor_t#note3. = 36;
565 }
566 else
567 {
568 uicxx . . $ ui..changingChordNotecxx . . $ ui_t#changingChordNote. = 3;
569 setStatusMessagecxx . . $ setStatusMessage(90ef5b561fbcb8de).("SELECT NOTE", NO_CARRYcxx . . $ NO_CARRY.);
570 pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.);
571 }
572
573 uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
574 }
575
576 void selectChordNote4cxx . . $ selectChordNote4(49f6e7a06ebc5aa8).(void)
577 {
578 if (mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed.)
579 {
580 editorcxx . . $ editor..note4cxx . . $ editor_t#note4. = 36;
581 }
582 else
583 {
584 uicxx . . $ ui..changingChordNotecxx . . $ ui_t#changingChordNote. = 4;
585 setStatusMessagecxx . . $ setStatusMessage(90ef5b561fbcb8de).("SELECT NOTE", NO_CARRYcxx . . $ NO_CARRY.);
586 pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.);
587 }
588
589 uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
590 }