-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eps.js
705 lines (675 loc) · 25.8 KB
/
eps.js
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
class EPS16 {
inputs = []
outputs = []
constructor(setUpCallback, errorCallback, successCallback){
this.inputs = []
this.outputs = []
this.instNum = 0
this.layerNum = 0
this.wsBytes = [0x00, 0x01]
this.midiInput = NaN
this.midiOutput = NaN
this.midiMessages = []
this.setUpCallback = setUpCallback
this.errorCallback = errorCallback
this.successCallback = successCallback
navigator.requestMIDIAccess({sysex: true}).then( (midiAccess) => {
for(let input of midiAccess.inputs.values()){
this.inputs.push(input)
}
for(let output of midiAccess.outputs.values()){
this.outputs.push(output)
}
this.setUpCallback(this.inputs, this.outputs)
}, this.onMIDIFailure);
}
/***
* EPS Sysex Commands
*/
async getWavesampleParams(){
let cmd = this.createMIDIMessage(0x05)
await this.sendData(cmd);
let messages = await this.readMessages()
for(let msg of messages){
if(await this.isAck(msg)){
await this.sendAck()
let responses = await this.readMessages()
for(let resp of responses){
return this.convertFrom16BitMidi(resp, true)
}
}
}
this.errorCallback("Error: Unable to get WaveSample Parameters")
return []
}
async deleteInstrument(){
const msg = this.createMIDIMessage(0x1C)
await this.sendData(msg)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Deleted instrument")
}else{
this.errorCallback("Error: Unable to delete instrument")
}
}
async sendAck(){
const data = [
0x01,
0x00,
0x00
]
await this.sendData(data)
}
async createInstrument(){
let message = this.createMIDIMessage(0x15)
await this.sendData(message)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Created instrument")
return true
}else{
this.errorCallback("Error: Unable to create instrument")
return false
}
}
async createLayer(){
let message = this.createMIDIMessage(0x16)
await this.sendData(message)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Created layer")
return true
}else{
this.errorCallback("Error: Unable to create layer")
return false
}
}
async createSqrWave(){
let message = this.createMIDIMessage(0x19)
await this.sendData(message)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Created SQR")
return true
}else{
this.errorCallback("Error: Unable to create SQR wavesample")
return false;
}
}
async clearWavesample(){
let params = await this.getWavesampleParams()
if(params.length == 0) return false
let length = this.getEndOffset(params)
let offsets = this.convertTo12BitMidi([length])
let data = [
0x00, // start offset
0x00, // start offset
0x00, // start offset
0x00, // start offset
]
data.concat(offsets)
let cmd = this.createMIDIMessage(0x1f, data)
await this.sendData(cmd)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Cleared wavesample")
return true
}else{
this.errorCallback("Error: Ubnable to clear wavesample")
return false
}
}
async truncateWavesample(){
let cmd = this.createMIDIMessage(0x1E)
await this.sendData(cmd)
let messages = await this.readMessages()
if(await this.isAck(messages[0])){
this.successCallback("Success: Truncated wavesample")
return true
}else{
this.errorCallback("Error: Unable to Truncate wavesample")
return false
}
}
async getWavesampleDataChunked(chunkSize, plotCallback){
let wavedata = []
const params = await this.getWavesampleParams()
if(params.length == 0 ) return []
const offset = this.getEndOffset(params)
const iter = Math.floor(offset/chunkSize)
for(let i=0; i<=iter; i++){
let start = chunkSize * i
let end = (chunkSize *i) + chunkSize
let wavePart = await this.getWavesampleData(start, end)
wavedata = wavedata.concat(wavePart)
console.log("WAVE", wavedata.length)
plotCallback(wavedata, Math.round((wavedata.length / offset) * 100)/100)
}
if(wavedata.length < offset){
let start = wavedata.length
let end = offset
let wavePart = await this.getWavesampleData(start,end)
wavedata = wavedata.concat(wavePart)
console.log("WAVE Last", wavedata.length)
plotCallback(wavedata, Math.round((wavedata.length / offset) * 100)/100)
}
return wavedata
}
async getWavesampleData(start, end){
let startOffset = this.convertTo12BitMidi([start],4)
let endOffset = this.convertTo12BitMidi([end],4)
let sampleOffsets = startOffset.concat(endOffset)
let cmd = this.createMIDIMessage(0x06, sampleOffsets)
await this.sendData(cmd)
let responses = await this.readMessages()
console.log("#####################Responses", responses)
for(let resp of responses){
if(await this.isAck(resp)){
await this.sleep(1000)
await this.sendAck()
let messages = await this.readMessages()
console.log("#####################", messages)
for(let msg of messages){
if(msg.length > 4){
let waveData = this.convertFrom16BitMidi(msg)
for(let i=0; i<waveData.length; i++){
waveData[i] = this.convertToSignedInt(waveData[i])
}
this.successCallback("Success: Getting wavesample data from EPS")
return waveData
}
}
}
}
this.errorCallback("Error: Unable to get wavesample data from EPS")
return []
}
async setParameter(paramGroup, paramByte, paramValue){
console.log(`Setting Value ${paramValue.toString(16)}, ${paramValue} for group ${paramGroup.toString(16)}, ${paramByte.toString(16)}`)
let header = [paramGroup, paramByte]
let midiValue = this.convertTo12BitMidi([paramValue],4)
console.log(`Converted 12 bit midi value is ${midiValue.map(val => val.toString(16))}`)
let msg = header.concat(midiValue)
let cmd = this.createMIDIMessage(0x11,msg)
console.log("Set Parameter", cmd)
await this.sendData(cmd)
}
async putWavesampleDataInChunks(audio, chunkSize, numWaves=1, waveIndex=0, progressCallback=()=>{}){
console.log("Total Size: ", audio.length)
let chunks = []
for (let i = 0; i < audio.length; i += chunkSize) {
const chunk = audio.slice(i, i + chunkSize);
/*if(chunk.length < chunkSize){
while(chunk.length < chunkSize){
chunk.push(0)
}
}*/
chunks.push(chunk)
}
console.log(chunks)
let start = 0;
for(let chunk of chunks){
if(!await this.putWavesampleData(chunk, start)){
//try again
if(!await this.putWavesampleData(chunk, start)){
this.errorCallback("Error: Unable to upload a portion of the wavesample")
return false
}
await this.sleep(2000)
}
console.log( "Percent Complete:", ((start+chunk.length)/audio.length) * 100)
progressCallback(
`${ Math.round(
(waveIndex + ((start+chunk.length)/audio.length))/numWaves*100)
}`)
start+=chunkSize
}
await this.sendAck()
let messages = await this.readMessages()
await this.sendAck()
await this.sleep(1000)
await this.setParameter(0x20, 0x18, audio.length)
return true
}
async putWavesampleData(audio, start=0){
console.log("OFFSETS", start, audio.length, audio.length + start)
let midiData = this.convertTo16BitMidi(audio)
let startOffset = this.convertTo12BitMidi([start], 4)
let endOffset = this.convertTo12BitMidi([audio.length + start], 4)
let sampleOffsets = startOffset.concat(endOffset)
let cmd = this.createMIDIMessage(0x0f,sampleOffsets)
//send offset command
await this.sendData(cmd)
let messages = await this.readMessages()
if(messages.length == 0){
this.errorCallback("Error: Unable to initiate pushing a wavesample to the the EPS")
return false
}
for(let msg of messages){
if(await this.isAck(msg)){
//send midi data
//await this.sendAck()
await this.sendData(midiData)
let responses = await this.readMessages()
if(responses.length == 0 ){
this.successCallback("Success: Wavesample data successfully sent")
return true
}
for(let resp of responses){
if(await this.isAck(resp)){
this.successCallback("Success: Wavesample data successfully sent")
return true
}
}
}
}
this.errorCallback("Error: Unable to send wavesample data to EPS")
return false
}
async uploadWavToEPS(audio, numWaves=1, waveIndex=0, progressCallback=()=>{}){
await this.setParameter(0x20, 0x00, 2) // set loop forward
await this.setParameter(0x20, 0x19, 0) // set loop pos
await this.setParameter(0x20, 0x17, 0) // set loop start
//await this.setParameter(0x20, 0x18, 1) // set loop end
await this.setParameter(0x20, 0x15, 0) // set sample start
await this.setParameter(0x20, 0x16, 1) // set sample end
if(await this.truncateWavesample() && await this.putWavesampleDataInChunks(audio,5000, numWaves, waveIndex, progressCallback)){
//this.sendAck()
return true
}else{
return false
}
}
/**
* Utility Commands for midi data coversions
*/
convertToSignedInt(data){
if(data > 32767) {data = data - 65536;}
return data
}
saveFile(samples, sampleRate=44100){
// Stolen from Recorder.js
// https://github.com/mattdiamond/Recorderjs
let buffer = new ArrayBuffer(44 + samples.length * 2);
let view = new DataView(buffer);
/* RIFF identifier */
this.writeString(view, 0, 'RIFF');
/* RIFF chunk length */
view.setUint32(4, 36 + samples.length * 2, true);
/* RIFF type */
this.writeString(view, 8, 'WAVE');
/* format chunk identifier */
this.writeString(view, 12, 'fmt ');
/* format chunk length */
view.setUint32(16, 16, true);
/* sample format (raw) */
view.setUint16(20, 1, true);
/* channel count */
view.setUint16(22, 1, true);
/* sample rate */
view.setUint32(24, sampleRate, true);
/* byte rate (sample rate * block align) */
view.setUint32(28, sampleRate * 4, true);
/* block align (channel count * bytes per sample) */
view.setUint16(32, 1 * 2, true);
/* bits per sample */
view.setUint16(34, 16, true);
/* data chunk identifier */
this.writeString(view, 36, 'data');
/* data chunk length */
view.setUint32(40, samples.length * 2, true);
let offset = 44
for(let i=0; i<samples.length; i++, offset +=2){
view.setInt16(offset, samples[i], true)
}
let audioBlob = new Blob([view], {type: 'audio/x-wav'});
let url = (window.URL || window.webkitURL).createObjectURL(audioBlob);
let link = window.document.createElement('a');
link.href = url;
link.download = 'output.wav';
link.innerHTML="Download"
link.click();
}
parseWavFile(buffer){
let view = new DataView(buffer)
let length = (view.getUint32(4,true) - 36)/2
if(view.getUint16(34, true) != 16){
alert("Only 16 bit files allowed")
return;
}
if(view.getUint16(22, true) != 1){
alert("Only Mono Files allowed")
return;
}
if(length > 512900){
alert("file too big")
return
}
let audio = []
let offset=44
for(let i=0; i<length; i++, offset +=2){
audio.push(view.getInt16(offset, true))
}
return audio
}
writeString(view, offset, string) {
for (let i = 0; i < string.length; i++) {
view.setUint8(offset + i, string.charCodeAt(i));
}
}
async isAck(message){
if(typeof message != 'undefined' && message.length >0 && message[0] == 1 && message[message.length-1] == 1){ /// Wait message
this.sleep(30000) /// manual sais wait up to 30 seconds
let messages = await this.readMessages()
return messages.reduce( (acc, msg) => acc || this.isAck(msg), false)
}else if(typeof message != 'undefined' && message.length >0 && message[0] == 1 && message[message.length-1] == 0){ /// ACK message
return true
}else{
return false
}
}
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async readMessages(){
let readMessages = []
const startTime = Date.now()
let timeout=0;
while(this.midiMessages.length == 0 && timeout < 5000){
timeout = Date.now() - startTime;
await this.sleep(500)
}
while(this.midiMessages.length > 0){
const msg = this.midiMessages.pop()
const striped = this.stripSysexHeader(msg)
readMessages.push(striped)
}
return readMessages
}
onMIDIFailure() {
alert('Could not access your MIDI devices.');
}
stripSysexHeader(message){
let sliced = message.slice(4,message.length -1)
return sliced
}
setInput(value){
this.input = value
this.midiInput = this.inputs.find((input) => input.name == this.input)
this.midiInput.onmidimessage = (midiMessage) => {
console.log("Received <-", midiMessage.data)
if(midiMessage.data[0] == 0xF0){ //Sysex Data
this.midiMessages.push(midiMessage.data)
}
if(midiMessage.data[4] == 0x1){
let message = this.getResponseMessage(this.stripSysexHeader(midiMessage.data))
if(message.indexOf("Error") != -1){
this.errorCallback(message)
}
console.log(message)
}
}
}
setOutput(value){
this.output = value
this.midiOutput = this.outputs.find((output) => output.name == this.output)
}
async sendData(message){
let packet = [
0xF0,
0x0F,
0x03,
0x00
]
packet = packet.concat(message)
packet.push(0xf7)
console.log("Send ->", packet)
await this.midiOutput.send(packet)
await this.sleep(700)
}
createMIDIMessage(command, data=[]){
let header = [
command,
0x00,
this.instNum,
0x00,
this.layerNum,
].concat(this.wsBytes)
let msg = header.concat(data)
return msg
}
getResponseMessage(message){
const code = message[2]
switch(code){
case 0x00: return "SUCCESS: ACK"
case 0x01: return "INFO: WAIT"
case 0x02: return "Error: Insert System Disk"
case 0x03: return "Error: Invalid Param Number"
case 0x04: return "Error: Invalid Param Value"
case 0x05: return "Error: Invalid Instrument"
case 0x06: return "Error: Invalid Layer"
case 0x07: return "Error: Layer In Use"
case 0x08: return "Error: Invalid Wavesample"
case 0x09: return "Error: Wavesample in Use"
case 0x0a: return "Error: Invalid Wavesammple data range"
case 0x0b: return "Error: File Not Found"
case 0x0c: return "Error: Memory Full"
case 0x0d: return "Error: Instrument in Use"
case 0x0e: return "Error: No More Layers"
case 0x0f: return "Error: No More Samples"
case 0x10: return "Error: reserved"
case 0x11: return "Error: Wavesample is a copy"
case 0x12: return "Error: Zone Too Big"
case 0x13: return "Error: Sequencer Must Be Stopped"
case 0x14: return "Error: Disk Access in Progress"
case 0x15: return "Error: Disk Full"
case 0x16: return "Error: Loop is too long"
case 0x17: return "Error: NAK"
case 0x18: return "Error: No Layer To Edit"
case 0x19: return "Error: No More Pitch Tables"
case 0x1a: return "Error: Cross Fade length is zero"
case 0x1b: return "Error: Cross Fade Length is greater than 50%"
case 0x1c: return "Error: Loop Start is to close to sample start"
case 0x1d: return "Error: Loop End is to close to sample end"
case 0x1e: return "Error: Quiet Layer"
default: return "Unknown!"
}
}
convertTo12BitMidi(data, minSize=2){
let binString = ''
for( let byte of data){
binString += byte.toString(2).padStart(16,0)
}
let stop = binString.length/6
let midiArray = []
for(let i=0; i<stop; i++){
let last6Bits = binString.substring(binString.length - 6, binString.length)
if(binString.length < 6 && parseInt(last6Bits,2) == 0){
continue
}else{
binString = binString.substring(0, binString.length -6)
midiArray.push(parseInt(last6Bits,2))
}
}
while(midiArray.length < minSize){
midiArray.push(0)
}
midiArray.reverse()
return midiArray
}
convertTo16BitMidi(data){
for(let i=0; i<data.length;i++){
data[i] = data[i] +2**16
}
let midiArray=[]
for(let byte of data){
let byte3 = byte & 0x003F
let byte2 = (byte & 0x00C0) >> 6
byte2 = (byte & 0x0F00) >> 6 | byte2
let byte1 = (byte & 0xF000) >> 12
midiArray.push(byte1)
midiArray.push(byte2)
midiArray.push(byte3)
}
return midiArray
}
convertFrom16BitMidi(data){
let midiArray=[]
for(let i=0; i< data.length; i=i+3){
const word = (data[i]&0x0F) << 12 | (data[i+1]&0x3F) << 6 | data[i+2] &0x3F
midiArray.push(word)
}
return midiArray
}
getEndOffset(bit16Params){
let word1 = bit16Params[119] << 16
let word2 = bit16Params[120] << 8
let word3 = bit16Params[121]
let word4 = bit16Params[122] >> 8
let offset = (word1 | word2 | word3 | word4) >> 9
console.log("OFFSET", offset)
return offset
}
setInstrumentNumber(num){
this.instNum = num
}
setLayerNumber(num){
this.layerNum = num
}
setWavesampleNumber(num){
this.wsBytes = this.convertTo12BitMidi([num],2)
return true
}
getCrossFadeBreakPoints(length, step){
const sectionLength = Math.floor( 128 / ((length -1)*2) )
const halfSectionLength = Math.floor(sectionLength/2)
let breakPoints = { pointA:0, pointB:0, pointC:127, pointD:127}
if(step == 0){
breakPoints.pointC = halfSectionLength
breakPoints.pointD = halfSectionLength + sectionLength
}else if(step == (length-1)){
let prev = this.getCrossFadeBreakPoints(length, step -1)
breakPoints.pointA = prev.pointC
breakPoints.pointB = prev.pointD
}
else{
let prev = this.getCrossFadeBreakPoints(length, step -1)
breakPoints.pointA = prev.pointC
breakPoints.pointB = prev.pointD
breakPoints.pointC = breakPoints.pointB + sectionLength
breakPoints.pointD = breakPoints.pointC + sectionLength
}
return breakPoints
}
/***
* Macros
*/
async uploadAsTranswave(arrayOfWaveTables, progressCallback){
this.setLayerNumber(0)
this.setWavesampleNumber(1)
let isSuccess = false
for(let i=this.instNum; i<8; i++){
if(await this.createInstrument() && await this.createLayer() &&await this.createSqrWave()){
isSuccess = true
break;
}else{
this.setInstrumentNumber(i)
}
}
if(!isSuccess) {
this.errorCallback("Error: Could not create an instrument for the transwave")
return
}
let transwave = []
for(let wave of arrayOfWaveTables){
transwave = transwave.concat(wave)
}
isSuccess = await this.uploadWavToEPS(transwave, 1,0,progressCallback)
if(!isSuccess){
this.errorCallback("Error: Unable to upload transwave to EPS16")
return
}
//set loop end
await this.sleep(1000)
await this.setParameter(0x20,0x18,arrayOfWaveTables[0].length)
//set modulation to transwave
await this.setParameter(0x20,0x06,0x07)
//set modulation source to wheel
await this.setParameter(0x20,0x07,0x0A)
//set modulation ammount
await this.setParameter(0x20,0x08,arrayOfWaveTables.length+1)
let messages = await this.readMessages()
if(messages.length = 0){
this.successCallback("Complete: Uploaded Transwave")
}else{
this.errorCallback("Error: Error occured when uploading the transwave")
}
}
async uploadToDifferentInstruments(arrayOfWaveTables, progressCallback){
this.setLayerNumber(0)
this.setWavesampleNumber(1)
let index =0
for(let wave of arrayOfWaveTables){
//find an empty instrument
for(let i=this.instNum; i<8; i++){
if(await this.createInstrument() && await this.createLayer() && await this.createSqrWave()){
await this.uploadWavToEPS(wave, arrayOfWaveTables.length, index, progressCallback)
this.successCallback("Success: Adding new instrument")
index++
await this.sleep(500)
break;
}else{
this.setInstrumentNumber(i)
}
}
}
this.successCallback("Complete: Uploading samples")
}
async createMorphingWaveTable(arrayOfWaveTables, progressCallback){
//enable all patche
let isSuccess = false
for(let i=this.instNum; i<8; i++){
if(await this.createInstrument()){
isSuccess = true
break;
}else{
this.setInstrumentNumber(i)
}
}
if(!isSuccess){
this.errorCallback("Error: Unable to create instrument for morphing wave forms")
return false
}
this.setLayerNumber(0)
this.setWavesampleNumber(1)
await this.setParameter(0x28, 0x00, 0xFF) // enable all patches
for(let i=0; i< arrayOfWaveTables.length; i++){
if(i==8) break
const bp = this.getCrossFadeBreakPoints(arrayOfWaveTables.length,i)
let wave = arrayOfWaveTables[i]
this.setLayerNumber(i)
//this.setWavesampleNumber(1)
if( !(await this.createLayer() && await this.createSqrWave() && this.setWavesampleNumber(i+1) && await this.uploadWavToEPS(wave, arrayOfWaveTables.length, i, progressCallback))){
this.errorCallback("Error: Unable to update instrument parameters")
return false
}
await this.sleep(500)
await this.setParameter(0x18,0x05, 1) // crossfade to linier
await this.setParameter(0x18,0x03, bp.pointA)
await this.setParameter(0x18,0x0B, bp.pointB)
await this.setParameter(0x18,0x04, bp.pointC)
await this.setParameter(0x18,0x0C, bp.pointD)
await this.setParameter(0x18,0x07, 0) // modulation source to LFO
await this.setParameter(0x18,0x0A, 127) // modulation amount
await this.setParameter(0x1C,0x02, 15) // LFO speed
await this.setParameter(0x1C,0x03, 127) // LFO depth
await this.setParameter(0x1C,0x04, 0) // LFO Delay
await this.setParameter(0x1C,0x05, 1) // LFO Reset
await this.setParameter(0x1C,0x08, 0x0F) // LFO Modulation source
await this.setParameter(0x1C,0x07, 0x0F) // LFO Modulation source
this.setWavesampleNumber(1)
await this.sleep(1000)
}
this.successCallback("Complete: Uploading samples")
}
}