<!--
    Roland Alpha Juno 1,2 / HS-10 / HS-80 / MKS-50 synth profile

      Notes:
             - supercedes old AlphaJuno editor
             - patch data only applies to MKS-50 (tone data works with all models)
             - first 23 bytes are patch data, last 46 bytes are tone data
             - synth recognizes all notes off, omni off, omni on, mono on, poly on
             - synth recognizes channel aftertouch, program change, pitchbend
             - (todo) ? 16 chord memory entries (6 bytes each)
                         although: it would be a bit impractical to store this per patch
             - the (pseudo) RPNs are used by Proxy nodes (will be converted to SysEx)

    Changed: 13Apr2013, 14Jul2019, 15Jul2019, 16Jul2019, 10May2020, 25Sep2023
  -->

<MIDISynthProfile
  id="roland_alpha_juno"
  caption="Roland Alpha Juno"
  inherit=0
  syxPatchSize=69
  tsl="syntheditor_generic.tsl"
  dataClass="MIDISynthProfileDataGeneric"
  formClass="EditMIDISynthFormGeneric"
  syxPatchEnc=AlphaJuno
  syxPatchInit="00 0c 6d 2d 00 7f 00 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 01 00 01 00 00 00 00 00 00 00 4e 5d 7f 00 00 1c 00 00 59 00 58 00 09 7f 54 7c 4d 61 17 01 5f 00 08 27 22 2d 3e 3e 3e 3e 3e 3e"
  defRandLockMask="0b11101010010"
  >
<!--  defRandLockMask="0b10000000001"
-->
  <cc id=modwheel_msb
      nr=1
      caption="Mod Wheel"
      class=value
      />

  <cc id=portatime
      nr=5
      caption="Portamento Time"
      class=value
      />

  <cc id=cc_volume_msb
      nr=7
      caption="Volume"
      class=value
      />

  <cc id=cc_hold1sw
      nr=64
      caption="Hold 1 SW (Sustain)"
      class=value
      celRange=BINARY_127
      celStyle=HI_NIBL
      />

  <cc id=cc_portamentosw
      nr=65
      caption="Portamento SW"
      class=value
      celRange=BINARY_127
      celStyle=HI_NIBL
      />

  <rpn id=bendrange
       nr=0
       caption="Bend Range" min=0 max=24
       />


  <!-- First 23 params -->
  <editgroup caption="Patch"/>

  <rpn id=d_patch_number
       nr=100
       syxOff=0
       caption="Patch Number"
       min=0
       max=127
       class=value
       celRange=0_127
       />

  <rpn id=d_patch_keyrange_lo
       nr=101
       syxOff=1
       caption="KeyRange Lo"
       min=12
       max=108
       class=value
       celRange=0_127
       />

  <rpn id=d_patch_keyrange_hi
       nr=102
       syxOff=2
       caption="KeyRange Hi"
       min=13
       max=109
       class=value
       celRange=0_127
       />

  <rpn id=d_patch_porta_time
       nr=103
       syxOff=3
       caption="Porta Time"
       min=0
       max=127
       class=value
       celRange=0_127
       />

  <rpn id=d_patch_porta_sw
       nr=104
       syxOff=4
       caption="Porta Sw"
       min=0
       max=1
       class=value
       celRange=0_127
       />

  <rpn id=d_patch_mod_sens
       nr=105
       syxOff=5
       caption="Mod Sens"
       min=0
       max=127
       class=value
       celRange=0_127
       />

  <!-- -12..12 => 116..12 -->
  <!-- bias is subtracted/added when converting from/to sysex -->
  <rpn id=d_patch_keyshift
       nr=106
       syxOff=6
       caption="Key Shift"
       min=0
       max=127
       bias=64
       class=value
       celRange=M64_P63
       />
  
  <rpn id=d_patch_volume
       nr=107
       syxOff=7
       caption="Volume"
       min=0
       max=127
       class=value
       celRange=0_127
       />

  <!-- -63..63 => -25..25 cents => 65(-63)..63(+63) -->
  <!-- bias is subtracted/added when converting from/to sysex -->
  <rpn id=d_patch_detune
       nr=108
       syxOff=8
       caption="Detune"
       min=0
       max=127
       bias=64
       class=value
       celRange=M64_P63
       />

  <rpn id=d_patch_midiflt_cat
       nr=109
       syxOff=9
       syxBitOff=6
       syxBitNum=1
       caption="Flt Ch.At"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_midiflt_pb
       nr=110
       syxOff=9
       syxBitOff=5
       syxBitNum=1
       caption="Flt Pitchbend"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_midiflt_sysex
       nr=111
       syxOff=9
       syxBitOff=4
       syxBitNum=1
       caption="Flt SysEx"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_midiflt_sustain
       nr=112
       syxOff=9
       syxBitOff=3
       syxBitNum=1
       caption="Flt Sustain"
       min=0
       max=1
       class=value
       />

  <rpn id=d_patch_midiflt_mw
       nr=113
       syxOff=9
       syxBitOff=2
       syxBitNum=1
       caption="Flt ModWheel"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_midiflt_vol
       nr=114
       syxOff=9
       syxBitOff=1
       syxBitNum=1
       caption="Flt Volume"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_midiflt_porta
       nr=115
       syxOff=9
       syxBitOff=0
       syxBitNum=1
       caption="Flt Portamento"
       min=0
       max=1
       class=value
       />
  
  <rpn id=d_patch_monobender
       nr=116
       syxOff=10
       caption="Mono Bender"
       min=0
       max=12
       class=value
       celRange=0_127
       />
  
  <rpn id=d_patch_chordmemory
       nr=117
       syxOff=11
       caption="Chord Memory"
       min=0
       max=11
       class=value
       celRange=0_127
       />
  
  <!-- 0=Poly, 64=Chord, 96=Mono (bits 4..0 are reserved/0) -->
  <rpn id=d_patch_keyassign
       nr=118
       syxOff=12
       syxBitOff=5
       syxBitNum=2
       caption="Key Assign"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="Poly;-;Chord;Mono"
       />
  
  <!-- (note) bytes 13..22: PATCH_NAME_0 .. PATCH_NAME_9 -->

  <!-- Last 46 params -->
  <editgroup caption="Tone"/>


  <editsubgroup caption="DCO"/>

  <rpn id=d_tone_dco_env_mode
       nr=119
       syxOff=23
       caption="DCO Env Mode"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="Normal;Inv;Dyn;Inv Dyn"
       randLockBit=5
       />

  <rpn id=d_tone_dco_pulse_wave
       nr=122
       syxOff=26
       caption="DCO Pulse Wave"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="Off;1 (50%);2 (75%);3 (pwm)"
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_saw_wave
       nr=123
       syxOff=27
       caption="DCO Saw Wave"
       min=0
       max=5
       class=value
       celRange=0_127
       editOptions="Off;1 (ramp);2;3 (pwm);4;5"
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_sub_wave
       nr=124
       syxOff=28
       caption="DCO Sub Wave"
       min=0
       max=5
       class=value
       celRange=0_127
       editOptions="0 (pulse 50%);1 (pulse 75%);2;3;4 (pulse 50% low);5 (pulse 75% low)"
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_range
       nr=125
       syxOff=29
       caption="DCO Range"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="4';8';16';32'"
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_sub_level
       nr=126
       syxOff=30
       caption="DCO Sub Level"
       min=0
       max=3
       class=value
       celRange=0_127
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_noise_level
       nr=127
       syxOff=31
       caption="DCO Noise Level"
       min=0
       max=3
       class=value
       celRange=0_127
       randLockBit=1
       />
  
  <rpn id=d_tone_dco_lfo_depth
       nr=130
       syxOff=34
       caption="DCO LFO Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=10
       />
  
  <rpn id=d_tone_dco_env_depth
       nr=131
       syxOff=35
       caption="DCO Env Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=10
       />
  
  <rpn id=d_tone_dco_cat_depth
       nr=132
       syxOff=36
       caption="DCO Ch.At Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       />

  <rpn id=d_tone_dco_pwm_depth
       nr=133
       syxOff=37
       caption="DCO PWM Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=4
       />

  <rpn id=d_tone_dco_pwm_rate
       nr=134
       syxOff=38
       caption="DCO PWM Rate"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=4
       />
  

  <editsubgroup caption="VCF"/>

  <rpn id=d_tone_vcf_env_mode
       nr=120
       syxOff=24
       caption="VCF Env Mode"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="Normal;Inv;Dyn;Inv Dyn"
       randLockBit=5
       />
  
  <rpn id=d_tone_vcf_cutoff
       nr=135
       syxOff=39
       caption="VCF CutOff"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=6
       />

  <rpn id=d_tone_vcf_res
       nr=136
       syxOff=40
       caption="VCF Resonance"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=6
       />

  <rpn id=d_tone_vcf_lfo_depth
       nr=137
       syxOff=41
       caption="VCF LFO Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=2
       />

  <rpn id=d_tone_vcf_env_depth
       nr=138
       syxOff=42
       caption="VCF Env Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=3
       />

  <rpn id=d_tone_vcf_key_follow
       nr=139
       syxOff=43
       caption="VCF Key Follow"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=6
       />
  
  <rpn id=d_tone_vcf_cat_depth
       nr=140
       syxOff=44
       caption="VCF Ch.At Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       />
  
  <rpn id=d_tone_hpf_cutoff
       nr=128
       syxOff=32
       caption="HPF CutOff"
       min=0
       max=3
       class=value
       celRange=0_127
       randLockBit=6
       />
  

  <editsubgroup caption="VCA + LFO + Chorus"/>

  <rpn id=d_tone_vca_level
       nr=141
       syxOff=45
       caption="VCA Level"
       min=0
       max=127
       class=value
       celRange=0_127
       />
  
  <rpn id=d_tone_vca_cat_depth
       nr=142
       syxOff=46
       caption="VCA Ch.At Depth"
       min=0
       max=127
       class=value
       celRange=0_127
       />
  
  <rpn id=d_tone_vca_env_mode
       nr=121
       syxOff=25
       caption="VCA Env Mode"
       min=0
       max=3
       class=value
       celRange=0_127
       editOptions="Env;Gate;Env.Dyn;Gate Dyn"
       randLockBit=5
       />


  <!--<editsubgroup caption="LFO"/>-->

  <rpn id=d_tone_lfo_rate
       nr=143
       syxOff=47
       caption="LFO Rate"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=2
       />
  
  <rpn id=d_tone_lfo_delay
       nr=144
       syxOff=48
       caption="LFO Delay"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=2
       />
  
  <!--<editsubgroup caption="Chorus"/>-->

  <rpn id=d_tone_chorus_sw
       nr=129
       syxOff=33
       caption="Chorus Sw"
       min=0
       max=1
       class=value
       celRange=0_127
       randLockBit=7
       />
  
  <rpn id=d_tone_chorus_rate
       nr=153
       syxOff=57
       caption="Chorus Rate"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=7
       />
  
  <rpn id=d_tone_bender_range
       nr=154
       syxOff=58
       caption="Bender Range"
       min=0
       max=12
       class=value
       celRange=0_127
       />
  

  <editsubgroup caption="Envelope"/>

  <rpn id=d_tone_env_t1
       nr=145
       syxOff=49
       caption="Env T1"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=8
       />
  
  <rpn id=d_tone_env_l1
       nr=146
       syxOff=50
       caption="Env L1"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=9
       />
  
  <rpn id=d_tone_env_t2
       nr=147
       syxOff=51
       caption="Env T2"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=8
       />

  <rpn id=d_tone_env_l2
       nr=148
       syxOff=52
       caption="Env L2"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=9
       />
  
  <rpn id=d_tone_env_t3
       nr=149
       syxOff=53
       caption="Env T3"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=8
       />
  
  <rpn id=d_tone_env_l3
       nr=150
       syxOff=54
       caption="Env L3"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=9
       />
  
  <rpn id=d_tone_env_t4
       nr=151
       syxOff=55
       caption="Env T4"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=8
       />
  
  <rpn id=d_tone_env_key_follow
       nr=152
       syxOff=56
       caption="Env Key Follow"
       min=0
       max=127
       class=value
       celRange=0_127
       randLockBit=8
       />


  <!-- (note) bytes 36..45: tone name 0..9 -->
  <!-- (note)  0..25=A..Z, 26..51=a..z, 52..61=0..9, 62=space, 63=- -->

</MIDISynthProfile>
