'**************************************************************** '* Name : Asa_Valves.BAS * '* Author : Godfried-Willem RAES * '* Notice : Copyleft (c) 2015 Logosoft Public Domain * '* Date : 09-06-2013 / 11-12-2015 * '* Version : 1.3 * '* Notes : code for the 18F4620 * '**************************************************************** ' 09.06.2013: Code module modelled after Klar and Fa ' 15.06.2013: Lookup tables calculated in inserted in this code ' Vibrato lookup to be tested. ' 4 lights implemented in code.This is version 1.1 ' 16.06.2013: Version 1.2 installed. ' 11.12.2015: Code revision. Version 1.3 uploaded in PIC Include "18F4620.inc" ' for the Asa-Valves processor (40MHz) ' Mapping defines for midi-events on pin outputs and inputs: ' valves - in order of output on the PC board $define Valve1 PORTA.2 ' #1 $define Valve2 PORTA.1 ' #2 $define Valve3 PORTA.0 ' #3 $define Valve4 PORTA.3 ' #4 $define Valve5 PORTA.4 ' #5 $define Valve6 PORTA.5 ' #6 $define Valve7 PORTE.0 ' #7 $define Valve8 PORTE.1 ' #av1 $define Valve9 PORTE.2 ' #8 $define Valve10 PORTB.4 ' #9 $define Valve11 PORTB.3 ' #10 $define Valve12 PORTB.2 ' #11 $define Valve13 PORTB.1 ' #12 $define Valve14 PORTB.0 ' #av2 $define Valve15 PORTD.7 ' #13 $define Valve16 PORTD.6 ' #14 $define Valve17 PORTD.5 ' #15 $define Valve18 PORTD.4 ' #16 ' alias defines for lites: $define Lite124 PORTC.0 ' steered by Lites.0 $define Lite125 PORTC.1 ' Lites.1 $define Lite126 PORTC.2 $define Lite127 PORTC.3 'red LED for debug: $define Debug_Led PORTB.5 ' for testing - red led - watchdog Declare All_Digital = True ' makes all analog pins, digital for I/O Clear SSPCON1.5 ' make sure RC3 is free for use. ' configure the input and output pins: TRISA = %11000000 'bits set to 0 are output, 1 = input - bits 6 and 7 are the clock! TRISB = %11100000 'bits 6 and 7 are for the ICP, bit 5 is the red LED TRISC = %11000000 'RC6 en RC7 zijn USART I/O and must be set to input TRISD = %00000000 'all bits can be used TRISE = %11101000 'low nibble only, bit3 (RE3) is MCLR ' bit 4 must be cleared for port D to work normally!!! 'constant definitions: 'initialisations for the midi input parser: Symbol Midichannel = 3 ' Asa_Channel Symbol NoteOff_Status = 128 + Midichannel ' 2 bytes follow Symbol NoteOn_Status = 144 + Midichannel Symbol Keypres_Status = 160 + Midichannel Symbol Control_Status = 176 + Midichannel Symbol ProgChange_Status = 192 + Midichannel ' 1 byte message Symbol Aftertouch_Status = 208 + Midichannel ' 1 byte follows Symbol Pitchbend_Status = 224 + Midichannel ' lsb msb follow ' Setup the USART Declare Hserial_Baud = 31250 ' Set baud rate for the USART to MIDI specs. Declare Hserial_TXSTA = 0x24 ' instead of the normal 0x20 - ?? 0x24 ' Declare Hserial_Clear = On ' should clear on errors. Bytes get lost of course... This must be 31250 for MIDI ' Create variables: Dim Cnt As Dword System '32 bit counter Dim CntHw As Cnt.Word1 'used in the timer0 interrupt, where it is incremented Dim CntLw As TMR0L.Word 'this is the trick to read both TMR0L and TMR0H 'it makes Cntlw the low word of cnt, when we use cnt.word0=CntLw Dim Tim1 As TMR1L.Word ' Dim Tim2 As TMR2 ' not used here Dim Cnt3 As Dword System Dim Cnt3Hw As Cnt3.Word1 Dim Tim3 As TMR3L.Word ' same trick for timer3 ' Dim Sr as TMR0L.7 '512 S/s ' As TMR0H.1 would be 128 S/s ' As TMR0H.2 would be 64 S/s ' As TMR0H.3 would be 32 S/s ' As TMR0H.4 would be 16 S/s Dim Bytein As Byte System ' midi byte read from buffer Dim StBit As Bytein.7 ' highest bit of ByteIn Dim i As Byte System ' general purpose counter ' midi variables Dim statusbyte As Byte System Dim noteUit As Byte System ' note off + release value Dim release As Byte System Dim noteAan As Byte System ' note on + release value Dim velo As Byte System Dim notePres As Byte System ' note pressure + pressure value Dim pres As Byte System Dim Ctrl As Byte System ' continuous controller + value Dim value As Byte System Dim prog As Byte System ' program change + program-byte Dim aft As Byte System ' channel aftertouch ' Dim pblsb As Byte System ' pitch bend lsb ' Dim pbmsb As Byte System ' pitch bend msb ' Dim veltim As Dword System ' 32 bit velo Dim veltim0 As Dword System ' faster, replaces the arrays ' Dim veltim1 As Dword System Dim VelFlags0 As Byte System ' so we can have only 8 tasks Dim CC66 As Byte System ' global on/off switch Dim PowerOn As CC66.0 Dim st As Byte System Dim b1 As Byte System Dim b2 As Byte System Dim Idx As Byte System Dim Playingnote As Byte System Dim CC30 As Byte System ' valve hold down time, midi value Dim ReleaseTime As Word System ' calculated from CC30 Dim VibratoPeriod As Word System ' was: Task_rsi[1] Dim VibratoValve As Byte System ' calculated from CC31 Dim CC31 As Byte System ' vibrato controller, midi value Dim FingersA[54] As Byte ' 0 to 53 Dim FingersB[54] As Byte 'Dim FingersC[64] As Byte Dim FingersD[54] As Byte Dim FingersE[54] As Byte Dim Vib[54] As Byte ' valve to use for fingered vibrato, this runs from 49 to 102 in notes Dim Lites As Byte ' reflecting the state of the lights in the 4 lowest bits of PortC '----------------------------------------------------------------------------------------- ' Load the USART Interrupt handler and buffer read subroutines into memory Include "Asa_Valves_Midi_Irq.inc" ' our own version for UART,Timer0, Timer3 Interrupt '----------------------------------------------------------------------------------------- ' Main program starts here MAIN: High Debug_Led DelayMS 10 ' wait for stability Low Debug_Led GoSub PowerDown GoSub Valve_Table ' read the fingerings lookup table Clear CC66 CC30 = 120 ' default ReleaseTime = CC30 <<9 Clear CC31 Init_Usart_Interrupt ' Initiate the USART serial buffer interrupt ' this procedure is in the include file Clear_Serial_Buffer ' Clear the serial buffer and reset its pointers ' in the include as well ' following only required for pulse outputs: ' Note that we can only use timer0 since the other timers ' are used by the PWM subsystem ' Configure Timer0 for: ' Clear TMR0L and TMR0H registers ' Interrupt on Timer0 overflow ' 16-bit operation ' Internal clock source 40MHz ' 1:256 Prescaler : thus 40MHz / 256 = 156.250kHz ' 6.4 us per clock-tick ' Opentimer0 (Timer_INT_On & T0_16BIT & T0_SOURCE_INT & T0_PS_1_256) ' replacing above macro with in-line coding: Clear T1CON Clear IntConBits_T0IF ' clear interrupt flag Set INTCONBITS_T0IE ' enable interrupt on overflow T0CON = %10000111 ' bit 7 = enable/disable ' bit 6 = 1=8 bot, 0=16 bit ' bit 5 = 1 pin input, 0= Internal Clk0 ' bit 4 = HL or LH transition when bit5 =1 ' bit 3 = 1= bypass prescaler, 0= input from prescaler ' bit 2-0 = prescaler select: 111= 1:256 ' Setup the High priorities for the interrupts ' TIMER1: if enabled, all midi-in is blocked, so it must interfere with the UART ' Configure Timer1 for: ' Clear TMR1L and TMR1H registers ' Interrupt on Timer1 overflow ' 16-bit read/write mode ' Internal clock source ' 1:8 Prescaler ' ' OpenTimer1(TIMER_INT_ON & T1_16BIT_RW & T1_SOURCE_INT & T1_PS_1_8) ' dit kompileert o.k. ' TIMER2: if enabled, the UART stops working... ' Opentimer2 (Timer_Int_On & T2_POST_1_16 & T2_PS_1_16) ' dit lukt... maar de timer is nodig voor de UART... ' TIMER3: ' Configure Timer3 for: ' ' Interrupt on Timer3 overflow ' 16-bit read/write mode ' Internal clock source ' 1:8 Prescaler ' Don’t sync external clock input ' T3_OSC1En_On () ' macro ' OpenTimer3(TIMER_INT_ON & T3_16BIT_RW & T3_SOURCE_INT & T3_PS_1_8 & T3_SYNC_EXT_OFF) ' fout, but == voorbeeld??? ' Opentimer3 (Timer_Int_On & T3_16BIT_RW & T3_SOURCE_INT & T3_PS_1_8 & T3_SYNC_EXT_OFF & T3_SOURCE_CCP) ' fout ' OpenTimer3 (Timer_INT_ON & T3_16BIT_RW & T3_PS_1_8 & T3_SYNC_EXT_OFF) ' fout ' OpenTimer3 (0xFFFF & Timer_INT_On & T3_16BIT_RW) ' OpenTimer3(T3_8BIT_RW & T3_SOURCE_EXT & T3_PS_1_1 & T3_SYNC_EXT_OFF) ' copied from manual, fout!!! ' OpenTimer3(TIMER_INT_OFF & T3_16BIT_RW & T3_SOURCE_INT & T3_PS_1_8) ' doing it this way seems to work: Clear T3CON Clear PIR2BITS_TMR3IF ' clear IRQ flag Set PIE2BITS_TMR3IE ' irq on 'T3_OSC1En_On () ' macro - sets T3CON Clear Tim3 ' Clear TMR3L And TMR3H registers Set RCONbits_IPEN ' Enable priority interrupts Clear IPR2bits_TMR3IP ' Set Timer3 as a low priority interrupt source ' we can also set T3Con in one instruction as: T3CON = %10110001 ' oef, now it works... ' bit 7 = 16 bit mode ' bit 6,3 = 0, 0 ' bit 5,4 = 1:8 prescale ' bit 2 = 0 ' bit 1 = 0 Internal clock = Fosc/4 ' bit 0 : 1= enable timer 3, 0= disable ' maximum count = 52.42ms, 1 tick =0.8uS, freq.=19Hz ' Set up priority interrupts. ' IPR1bits_TMR1IP = 0 ' Set Timer1 as a low priority interrupt source ' INTCONbits_PEIE = 1 ' Enable peripheral interrupts ' INTCONbits_GIE = 1 ' Enable global interrupts ' Open the ADC: ' not used on this board. ' Fosc/32 ' Right justified for 10-bit operation ' Tad value of 0 ' Vref+ at Vcc : Vref- at Gnd ' Make AN0 an analogue input ' ' OpenADC(ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_0_TAD, ADC_REF_VDD_VSS, ADC_1ANA) ' start the main program loop: LOOP: ' Create an infinite loop Bytein = HRSIn ' Read data from the serial buffer, with no timeout ' Start the midi parser. Midi_Parse: If Bytein > Aftertouch_Status Then ' was: > Control_Status Then ' here higher statusses are not implemented. If Bytein > 253 Then '254 = midiclock, 255= reset 'midiclock can interrupt all other msg's... '255 had to be intercepted since thats what we 'get when no new byte flows in (?) GoTo Check_Timers 'throw away... Else Clear statusbyte 'reset the status byte GoTo Check_Timers 'throw away End If EndIf If StBit =1 Then 'should be faster than If Bytein > 127 Then 'status byte received, bit 7 is set Clear statusbyte 'if on another channel, the statusbyte needs a reset Select Bytein 'eqv to Select case ByteIn Case NoteOff_Status statusbyte = Bytein Set noteUit 'reset value. Cannot be 0 !!! Set release '0 is a valid midi note! Case NoteOn_Status statusbyte = Bytein Set noteAan '= 255 Set velo '= 255 Case Keypres_Status 'not used for fingered vibrato here statusbyte = Bytein notePres = 255 pres = 255 Case Control_Status ' for fingerings statusbyte = Bytein Set Ctrl Set value Case ProgChange_Status ' could be used for different lookup tables statusbyte = Bytein prog = 255 Case Aftertouch_Status ' for fingered vibrato statusbyte = Bytein Set aft ' Case Pitchbend_Status ' statusbyte = Bytein ' pblsb = 255 ' pbmsb = 255 End Select Else 'midi byte is 7 bits Select statusbyte Case 0 'not a message for this channel GoTo Check_Timers 'disregard Case NoteOff_Status If noteUit = 255 Then noteUit = Bytein Else release = Bytein 'message complete, so we can do the action... Select noteUit Case 49 To 102 ' here we should start a timer. ' when the timer runs out, we release the valves. Set VelFlags0.0 'set the timer Clear T3CONBITS_TMR3ON 'stop timer 3 Clear Playingnote 'no note anymore Clear VelFlags0.1 'no fingered vibrato Cnt.Word0 = CntLw 'read counter veltim0 = Cnt + ReleaseTime 'add the period duration (CC30) Case 124 Clear Lites.0 Clear Lite124 Case 125 Clear Lites.1 Clear Lite125 Case 126 Clear Lites.2 Clear Lite126 Case 127 Clear Lites.3 Clear Lite127 End Select Set noteUit '= 255 'reset EndIf 'GoTo Check_Timers Case NoteOn_Status If noteAan = 255 Then noteAan = Bytein Else velo = Bytein If velo = 0 Then Select noteAan Case 49 To 102 ' equivalent to noteoff ' so we start a timer for valve releases. Set VelFlags0.0 'set the timer Clear T3CONBITS_TMR3ON ' stop timer 3 Clear VelFlags0.1 ' vibrato off Clear Playingnote Cnt.Word0 = CntLw veltim0 = Cnt + ReleaseTime 'add the timeout duration Case 124 Clear Lites.0 Clear Lite124 Case 125 Clear Lites.1 Clear Lite125 Case 126 Clear Lites.2 Clear Lite126 Case 127 Clear Lites.3 Clear Lite127 End Select Else Select noteAan Case 49 To 102 Idx = noteAan - 49 Clear VelFlags0.0 ' start release timer only after note-off PORTA = FingersA[Idx] '| %11000000 'PORTB = FingersB[Idx] ' interferes with Portb.5, red LED !!! ' hence we do this trick: i = FingersB[Idx] i.5 = PORTB.5 ' read the red_led port PORTB = i '| %11000000 ' in case we use C.0 to C.3 for lights we can use this construction: ' i = PORTC & %11001111 ' so we preserve the low nibble bits ' i = i | FingersC[Idx] ' or-ing will set the valve related bits C.4 and C.5 only ' PORTC = i 'PORTC = FingersC[Idx] '| %11000000 used only for lights PORTD = FingersD[Idx] 'PORTD = FingersD[Idx] ' i = FingersE[Idx] ' i.3 = PORTE.3 ' mask MCLR ' PORTE = i ' FingersE[Idx] '| %11111000 ' PortE.0 seems to be blocking timers PORTE= FingersE[Idx] Playingnote = noteAan If CC31 > 0 Then VibratoValve = Vib[Idx] Set VelFlags0.1 Set T3CONBITS_TMR3ON ' start timer End If Case 124 Set Lites.0 Set Lite124 Case 125 Set Lites.1 Set Lite125 Case 126 Set Lites.2 Set Lite126 Case 127 Set Lites.3 Set Lite127 End Select Set noteAan '= 255 'reset !!! EndIf EndIf 'GoTo Check_Timers ' Case Keypres_Status 'used for lite flashing on Fa-Hub ' 'in used by PIC2 for fingerings !!! ' 'here we could use it for fingered vibrato ' If notePres = 255 Then ' notePres = Bytein ' Else ' pres = Bytein ' 'GoSub KeyPres ' EndIf ' GoTo Check_Timers Case Control_Status 'this is where the action takes place for controllers If Ctrl = 255 Then Ctrl = Bytein Else value = Bytein GoSub Controller ' fingerings implemented here EndIf 'GoTo Check_Timers ' Case ProgChange_Status ' could be used to select alternative fingering lookups ' If prog = 255 Then 'single byte message ' prog = Bytein 'weak coding... ' GoSub ProgChange ' EndIf Case Aftertouch_Status If aft = 255 Then aft = Bytein GoSub Aftertouch EndIf ' GoTo Check_Timers End Select EndIf Check_Timers: ' here we check the Task counters and compare them with the 32 bit cnt value ' using the Velflags dword variable: 'If VelFlags0 > 0 Then 'if any bit is set here, there is a timer running ' to speed up things, we could first check for the smallest of the veltim's ' and only compare that one with the counter. If VelFlags0.0 = 1 Then ' on this board we use this timer for release Cnt.Word0 = CntLw ' read counter If Cnt >= veltim0 Then GoSub Valves_Down Clear VelFlags0.0 ' one shot EndIf EndIf GoTo LOOP ' end of the main loop 'KeyPres: ' ' not implemented on this board for ' notePres = 255 'Return 'ProgChange: ' prog = 255 'this is not realy required 'Return 'Pitchbend: ' 'only implemented on dsPIC based robots, irrelevant here ' set pblsb '= 255 'Return Aftertouch: ' 'this is the channel aftertouch, affecting any playing note ' 'used for fingered vibrato ' 'the value of aft is used to set the vibrato speed. Minimum freq=19Hz/2 = 9.54Hz ' coding using timer3: If aft > 0 Then Clear T3CONBITS_TMR3ON ' stop timer CC31 = aft VibratoPeriod = CC31 << 9 '* CC31 Tim3 = VibratoPeriod Set T3CONBITS_TMR3ON ' restart timer Else Clear CC31 Clear VibratoPeriod Clear T3CONBITS_TMR3ON ' stop timer EndIf Set aft ' reset Return Controller: ' here we implement 4 controllers for alternate fingering 4 x 7 = 28 Select Ctrl Case 30 ' valve release time controller CC30 = value If CC30 = 0 Then Clear VelFlags0.0 Else ReleaseTime = CC30 << 9 ' shift to the high word End If Case 31 ' alternative for channel aftertouch If value <> CC31 Then If value > 0 Then Clear T3CONBITS_TMR3ON ' stop timer CC31 = value ' used as vibrato switch for debugging VibratoPeriod = CC31 << 9 '* CC31 ' same as aftertouch Tim3 = VibratoPeriod Set T3CONBITS_TMR3ON ' start timer Else Clear T3CONBITS_TMR3ON Clear CC31 Clear VibratoPeriod EndIf EndIf Case 66 'on/off for the robot If value = 0 Then Clear PowerOn 'CC66.0 =0 GoSub PowerDown Else Set PowerOn 'CC66.0 =1 ' here we should also reset all controllers to their cold boot value EndIf Case 100 Valve1 = value.0 Valve2 = value.1 Valve3 = value.2 Valve4 = value.3 Valve5 = value.4 Valve6 = value.5 Valve7 = value.6 Case 101 Valve8 = value.0 Valve9 = value.1 Valve10 = value.2 Valve11 = value.3 Valve12 = value.4 Valve13 = value.5 Valve14 = value.6 Case 102 Valve15 = value.0 Valve16 = value.1 Valve17 = value.2 Valve18 = value.3 'Valve19 = value.4 'Valve20 = value.5 'Valve21 = value.6 ' Case 103 ' these are not used for valves. ' Valve22 = value.0 ' not connected to any valve ' Valve23 = value.1 ' Valve24 = value.2 ' Valve25 = value.3 ' Valve26 = value.4 ' Valve27 = value.5 ' Valve28 = value.6 Case 123 GoSub PowerDown End Select Set Ctrl 'mandatory reset Return PowerDown: 'should switch off all valves activated Clear VelFlags0 'stop all running timers Clear CntHw ' reset timer ' Low Valvex is no good, as it affects the TRIS settings Clear Valve1 Clear Valve2 ' = 0 Clear Valve3 ' = 0 Clear Valve4 ' = 0 Clear Valve5 ' = 0 Clear Valve6 ' = 0 Clear Valve7 ' = 0 Clear Valve8 ' = 0 Clear Valve9 ' = 0 Clear Valve10 ' = 0 Clear Valve11 ' = 0 Clear Valve12 ' = 0 Clear Valve13 ' = 0 Clear Valve14 ' = 0 Clear Valve15 ' = 0 Clear Valve16 ' = 0 Clear Valve17 ' = 0 Clear Valve18 ' = 0 Clear Lite124 Clear Lite125 Clear Lite126 Clear Lite127 Clear Lites ' reset controllers: CC30 = 120 ReleaseTime = CC30 <<9 Clear CC31 Return Valves_Down: ' only bits really connected to valves Clear Valve1 Clear Valve2 Clear Valve3 Clear Valve4 Clear Valve5 Clear Valve6 Clear Valve7 Clear Valve8 Clear Valve9 Clear Valve10 Clear Valve11 Clear Valve12 Clear Valve13 Clear Valve14 Clear Valve15 Clear Valve16 Clear Valve17 Clear Valve18 Return Valve_Table: ' index = midinoot - 49 ( voor ) ' lookup updated 15.06.2013 gwr FingersA[0] = %00110101 ' portA 49 FingersB[0] = %0 ' portB FingersD[0] = %0 ' portD FingersE[0] = %0001 ' portE - low nibble only FingersA[1] = %00110001 ' 50, port A FingersB[1] = %0 FingersD[1] = %0 FingersE[1] = %001 FingersA[2] = %00110011 ' 51 FingersB[2] = %0 FingersD[2] = %0 FingersE[2] = %0001 FingersA[3] = %00111000 ' 52 FingersB[3] = %0 FingersD[3] = %0 FingersE[3] = %0001 FingersA[4] = %00110000 ' 53 FingersB[4] = %0 FingersD[4] = %0 FingersE[4] = %0001 FingersA[5] = %00101000 ' 54 FingersB[5] = %0 FingersD[5] = %0 FingersE[5] = %0001 FingersA[6] = %00100000 ' 55 FingersB[6] = %0 FingersD[6] = %0 FingersE[6] = %0001 FingersA[7] = %0 ' 56 FingersB[7] = %0 FingersD[7] = %0 FingersE[7] = %00000001 FingersA[8] = %00100000 ' 57 FingersB[8] = %0 FingersD[8] = %0 FingersE[8] = %0 FingersA[9] = %0 ' 58 FingersB[9] = %0 FingersD[9] = %0 FingersE[9] = %00000010 FingersA[10] = %00000000 ' 59 FingersB[10] = %00000000 FingersD[10] = %0 FingersE[10] = %00000110 FingersA[11] = %00000000 ' 60 FingersB[11] = %00010000 FingersD[11] = %0 FingersE[11] = %00000010 FingersA[12] = %00000000 ' 61 FingersB[12] = %00011000 FingersD[12] = %0 FingersE[12] = %00000000 FingersA[13] = %00000000 ' 62 FingersB[13] = %00010100 FingersD[13] = %00000000 FingersE[13] = %00000010 FingersA[14] = %00000000 ' 63 FingersB[14] = %00010010 FingersD[14] = %00000000 FingersE[14] = %00000010 FingersA[15] = %00000000 ' 64 FingersB[15] = %00010111 FingersD[15] = %00000000 FingersE[15] = %00000010 FingersA[16] = %00110000 ' 65 FingersB[16] = %00000000 FingersD[16] = %00000000 FingersE[16] = %00000001 FingersA[17] = %00111000 ' 66 FingersB[17] = %00000000 FingersD[17] = %00000000 FingersE[17] = %00000001 FingersA[18] = %00100000 ' 67 FingersB[18] = %00000000 FingersD[18] = %00000000 FingersE[18] = %00000001 FingersA[19] = %0 ' 68 FingersB[19] = %0 FingersD[19] = %0 FingersE[19] = %00000001 FingersA[20] = %00100000 ' 69 FingersB[20] = %0 FingersD[20] = %0 FingersE[20] = %0 FingersA[21] = %0 ' 70 FingersB[21] = %0 FingersD[21] = %0 FingersE[21] = %00000010 FingersA[22] = %0 ' 71 FingersB[22] = %0 FingersD[22] = %0 FingersE[22] = %00000110 FingersA[23] = %0 ' 72 FingersB[23] = %00010000 FingersD[23] = %0 FingersE[23] = %00000010 FingersA[24] = %00000000 ' 73 FingersB[24] = %00011000 FingersD[24] = %00000000 FingersE[24] = %00000010 FingersA[25] = %0 ' 74 FingersB[25] = %00010100 FingersD[25] = %0 FingersE[25] = %00000010 FingersA[26] = %00000000 ' 75 FingersB[26] = %00010010 FingersD[26] = %00000000 FingersE[26] = %00000010 FingersA[27] = %00000000 ' 76 FingersB[27] = %00010111 FingersD[27] = %00000000 FingersE[27] = %00000010 FingersA[28] = %00000000 ' 77 FingersB[28] = %00010111 FingersD[28] = %10000000 FingersE[28] = %00000010 FingersA[29] = %00000000 ' 78 FingersB[29] = %00010111 FingersD[29] = %11000000 FingersE[29] = %00000010 FingersA[30] = %00000000 ' 79 FingersB[30] = %00010111 FingersD[30] = %11100000 FingersE[30] = %00000010 FingersA[31] = %00000000 ' 80 FingersB[31] = %00010111 FingersD[31] = %11110000 FingersE[31] = %00000010 FingersA[32] = %00000000 ' 81 FingersB[32] = %00010010 FingersD[32] = %00110000 FingersE[32] = %00000010 FingersA[33] = %00010000 ' 82 FingersB[33] = %00000100 FingersD[33] = %00000000 FingersE[33] = %00000010 FingersA[34] = %00000000 ' 83 FingersB[34] = %00000100 FingersD[34] = %00000000 FingersE[34] = %00000010 FingersA[35] = %00000000 ' 84 FingersB[35] = %00000010 FingersD[35] = %00000000 FingersE[35] = %00000010 FingersA[36] = %00000000 ' 85 FingersB[36] = %00001110 FingersD[36] = %00000000 FingersE[36] = %00000010 FingersA[37] = %00000000 ' 86 FingersB[37] = %00010111 FingersD[37] = %01000000 FingersE[37] = %00000010 FingersA[38] = %00000000 ' 87 FingersB[38] = %00010111 FingersD[38] = %11000000 FingersE[38] = %00000010 FingersA[39] = %00000000 ' 88 FingersB[39] = %00010111 FingersD[39] = %11100000 FingersE[39] = %00000010 FingersA[40] = %00000000 ' 89 FingersB[40] = %00010100 FingersD[40] = %10000000 FingersE[40] = %00000010 FingersA[41] = %00010000 ' 90 FingersB[41] = %00010010 FingersD[41] = %00000000 FingersE[41] = %00000001 FingersA[42] = %00100000 ' 91 FingersB[42] = %00010010 ' FingersD[42] = %00000000 FingersE[42] = %00000001 FingersA[43] = %00010000 ' 92 FingersB[43] = %00010010 FingersD[43] = %00000000 FingersE[43] = %00000001 FingersA[44] = %00100000 ' 93 FingersB[44] = %00010111 FingersD[44] = %11000000 FingersE[44] = %00000001 FingersA[45] = %00100000 ' 94 FingersB[45] = %00010010 FingersD[45] = %01000000 FingersE[45] = %00000001 FingersA[46] = %00100000 ' 95 FingersB[46] = %00010010 FingersD[46] = %00000000 FingersE[46] = %00000000 FingersA[47] = %00000000 ' 96 FingersB[47] = %00010111 FingersD[47] = %00101000 FingersE[47] = %00000010 FingersA[48] = %0 ' 97 FingersB[48] = %00011111 FingersD[48] = %0 FingersE[48] = %00000010 FingersA[49] = %00110000 ' 98 FingersB[49] = %00001010 FingersD[49] = %11110000 FingersE[49] = %00000000 FingersA[50] = %00110000 ' 99 FingersB[50] = %00000010 FingersD[50] = %11000000 FingersE[50] = %00000000 FingersA[51] = %00110000 ' 100 FingersB[51] = %00000010 FingersD[51] = %11000000 FingersE[51] = %00000000 FingersA[52] = %00110000 ' 101 FingersB[52] = %00000010 FingersD[52] = %11000000 FingersE[52] = %00000000 FingersA[53] = %00100000 ' 102 FingersB[53] = %00010010 FingersD[53] = %0 FingersE[53] = %0 ' array with assignment of valve numbers to use for vibrato ' this list has to be empirically verified. ' extended such that we can use all valves for vibrato ' This is the first try out mapping list for !!! ' to be worked out for Asa, if fingered vibrato makes any sense here at all... Vib[0] = 11 ' 49 in fact not possible on an pure acoustic saxophone Vib[1] = 13 Vib[2] = 14 ' av2 Vib[3] = 14 Vib[4] = 15 Vib[5] = 16 ' 54 Vib[6] = 17 Vib[7] = 18 Vib[8] = 1 Vib[9] = 2 '58 Vib[10] = 3 Vib[11] = 4 '60 Vib[12] = 11 '61 Vib[13] = 13 Vib[14] = 14 Vib[15] = 14 '64 Vib[16] = 15 Vib[17] = 16 ' 66 Vib[18] = 17 ' 67 Vib[19] = 18 '68 Vib[20] = 1 Vib[21] = 2 Vib[22] = 3 Vib[23] = 4 '72 Vib[24] = 1 ' 73 Vib[25] = 2 ' 74 Vib[26] = 3 '75 Vib[27] = 4 '76 Vib[28] = 15 ' 77 Vib[29] = 16 Vib[30] = 17 Vib[31] = 18 '80 Vib[32] = 2 Vib[33] = 3 Vib[34] = 4 '83 Vib[35] = 5 '84 Vib[36] = 1 '85 Vib[37] = 2 '86 Vib[38] = 3 '87 Vib[39] = 4 '88 Vib[40] = 5 '89 Vib[41] = 6 '90 Vib[42] = 1 '91 Vib[43] = 2 '92 Vib[44] = 3 '93 Vib[45] = 4 '94 Vib[46] = 5 ' 95 Vib[47] = 1 '96 Vib[48] = 2 '97 Vib[49] = 1 '98 Vib[50] = 2 '99 Vib[51] = 1 '100 Vib[52] = 2 '101 Vib[53] = 3 '102 Return '[EOF]