Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1.         struct YRW801_WAVE_DATA
  2.  
  3. tone                     ds 2       ;                      uint16_t
  4. pitch_offset             ds 2       ;                      int16_t
  5. key_scaling              ds 1       ;                      uint8_t
  6. panpot                   ds 1       ;                      int8_t  
  7. vibrato                  ds 1       ;                      uint8_t
  8. tone_attenuate           ds 1       ;                      uint8_t
  9. volume_factor            ds 1       ;                      uint8_t
  10. reg_lfo_vibrato          ds 1       ;                     uint8_t
  11. reg_attack_decay1        ds 1       ;                     uint8_t
  12. reg_level_decay2         ds 1       ;                     uint8_t
  13. reg_release_correction   ds 1       ;                     uint8_t
  14. reg_tremolo              ds 1       ;                     uint8_t
  15.         ends
  16.  
  17.         struct MIDI_CHANNEL_DATA
  18. notes_status                    ds 128                      
  19. instrument                      ds 1 ;   uint8_t instrument;
  20. vibrato                         ds 1 ;   uint8_t vibrato;    
  21. pitch_bend                      ds 2 ;   int16_t    pitch bend signed       midi_pitchbend
  22. gm_rpn_coarse_tuning            ds 2  ; int16_t signed
  23. gm_rpn_fine_tuning              ds 2  ; int16_t signed
  24. _MIDI_CTL_REGIST_PARM_NUM_MSB   ds 1 ;
  25. _MIDI_CTL_REGIST_PARM_NUM_LSB   ds 1 ;                                                
  26. _MIDI_CTL_MSB_DATA_ENTRY        ds 1 ;
  27. _MIDI_CTL_LSB_DATA_ENTRY        ds 1 ;
  28. gm_sustain                      ds 1
  29. panpot                          ds 1 ;   uint8_t panpot;    
  30. gm_rpn_pitch_bend_range         ds 2  ; int16_t signed
  31. param_type                      ds 1 ; /* RPN/NRPN */
  32. gm_volume                       ds 1
  33. gm_expression                   ds 1
  34.  
  35. drum_channel                    ds 1 ;   bool    drum_channel;
  36.                ends
  37.  
  38.  
  39.  
  40.         struct VOICE_DATA
  41. number          ds 1  ;
  42. is_active       ds 1  ;
  43. activated       ds 4,0;
  44. midi_channel    ds 2,0  ;pointer to midi chanel data
  45. wave_data       ds 2,0  ;pointer to yrw801
  46. note            ds 1
  47. velocity        ds 1
  48. level_direct    ds 1
  49. reg_f_number    ds 1
  50. reg_misc        ds 1
  51. reg_lfo_vibrato ds 1
  52.         ends
  53.  
  54.  
  55.         struct TRACK_DATA
  56.  
  57. waiting_for_t   ds 4
  58. waiting_for     ds 4
  59. streamoffset     ds 4,0
  60. currentoffset   ds 4,0
  61. track_finished  ds 1,0
  62. last_command    ds 1
  63.         ends
  64.  
  65.         struct MIDI_HEADER
  66.  
  67. file_format             ds 1       ;uint8_t  
  68. number_of_tracks        ds 1       ;uint8_t  
  69. ticks_per_qnote         ds 2 ;uint16_t
  70. ticksperqnoteXupdatelen ds 4 ;uint32_t
  71.  
  72. midi_mode               ds 1;   /* MIDI operating mode */
  73. gs_master_volume        ds 1;   /* SYSEX master volume: 0-127 */
  74. gs_chorus_mode          ds 1;
  75. gs_reverb_mode          ds 1;
  76.  
  77. g_track_data            ds TRACK_DATA*MAX_NR_OF_TRACKS
  78. g_midi_channel_data     ds MIDI_CHANNEL_DATA*NR_OF_MIDI_CHANNELS
  79. g_voice_data            ds VOICE_DATA * NR_OF_WAVE_CHANNELS
  80.         ends
  81.  
  82.  
  83.  
  84.  
  85. /*MIDI Controllers*/
  86. MIDI_CTL_MSB_BANK               = 0x00  /**< Bank selection */
  87. MIDI_CTL_MSB_MODWHEEL           = 0x01  /**< Modulation */
  88. MIDI_CTL_MSB_BREATH             = 0x02  /**< Breath */
  89. MIDI_CTL_MSB_FOOT               = 0x04  /**< Foot */
  90. MIDI_CTL_MSB_PORTAMENTO_TIME    = 0x05  /**< Portamento time */
  91. MIDI_CTL_MSB_DATA_ENTRY         = 0x06  /**< Data entry */
  92. MIDI_CTL_MSB_MAIN_VOLUME        = 0x07  /**< Main volume */
  93. MIDI_CTL_MSB_BALANCE            = 0x08  /**< Balance */
  94. MIDI_CTL_MSB_PAN                = 0x0a  /**< Panpot */
  95. MIDI_CTL_MSB_EXPRESSION         = 0x0b  /**< Expression */
  96. MIDI_CTL_MSB_EFFECT1            = 0x0c  /**< Effect1 */
  97. MIDI_CTL_MSB_EFFECT2            = 0x0d  /**< Effect2 */
  98. MIDI_CTL_MSB_GENERAL_PURPOSE1   = 0x10  /**< General purpose 1 */
  99. MIDI_CTL_MSB_GENERAL_PURPOSE2   = 0x11  /**< General purpose 2 */
  100. MIDI_CTL_MSB_GENERAL_PURPOSE3   = 0x12  /**< General purpose 3 */
  101. MIDI_CTL_MSB_GENERAL_PURPOSE4   = 0x13  /**< General purpose 4 */
  102. MIDI_CTL_LSB_BANK               = 0x20  /**< Bank selection */
  103. MIDI_CTL_LSB_MODWHEEL           = 0x21  /**< Modulation */
  104. MIDI_CTL_LSB_BREATH             = 0x22  /**< Breath */
  105. MIDI_CTL_LSB_FOOT               = 0x24  /**< Foot */
  106. MIDI_CTL_LSB_PORTAMENTO_TIME    = 0x25  /**< Portamento time */
  107. MIDI_CTL_LSB_DATA_ENTRY         = 0x26  /**< Data entry */
  108. MIDI_CTL_LSB_MAIN_VOLUME        = 0x27  /**< Main volume */
  109. MIDI_CTL_LSB_BALANCE            = 0x28  /**< Balance */
  110. MIDI_CTL_LSB_PAN                = 0x2a  /**< Panpot */
  111. MIDI_CTL_LSB_EXPRESSION         = 0x2b  /**< Expression */
  112. MIDI_CTL_LSB_EFFECT1            = 0x2c  /**< Effect1 */
  113. MIDI_CTL_LSB_EFFECT2            = 0x2d  /**< Effect2 */
  114. MIDI_CTL_LSB_GENERAL_PURPOSE1   = 0x30  /**< General purpose 1 */
  115. MIDI_CTL_LSB_GENERAL_PURPOSE2   = 0x31  /**< General purpose 2 */
  116. MIDI_CTL_LSB_GENERAL_PURPOSE3   = 0x32  /**< General purpose 3 */
  117. MIDI_CTL_LSB_GENERAL_PURPOSE4   = 0x33  /**< General purpose 4 */
  118. MIDI_CTL_SUSTAIN                = 0x40  /**< Sustain pedal */
  119. MIDI_CTL_PORTAMENTO             = 0x41  /**< Portamento */
  120. MIDI_CTL_SOSTENUTO              = 0x42  /**< Sostenuto */
  121. MIDI_CTL_SUSTENUTO              = 0x42  /**< Sostenuto (a typo in the older version) */
  122. MIDI_CTL_SOFT_PEDAL             = 0x43  /**< Soft pedal */
  123. MIDI_CTL_LEGATO_FOOTSWITCH      = 0x44  /**< Legato foot switch */
  124. MIDI_CTL_HOLD2                  = 0x45  /**< Hold2 */
  125. MIDI_CTL_SC1_SOUND_VARIATION    = 0x46  /**< SC1 Sound Variation */
  126. MIDI_CTL_SC2_TIMBRE             = 0x47  /**< SC2 Timbre */
  127. MIDI_CTL_SC3_RELEASE_TIME       = 0x48  /**< SC3 Release Time */
  128. MIDI_CTL_SC4_ATTACK_TIME        = 0x49  /**< SC4 Attack Time */
  129. MIDI_CTL_SC5_BRIGHTNESS         = 0x4a  /**< SC5 Brightness */
  130. MIDI_CTL_SC6                    = 0x4b  /**< SC6 */
  131. MIDI_CTL_SC7                    = 0x4c  /**< SC7 */
  132. MIDI_CTL_SC8                    = 0x4d  /**< SC8 */
  133. MIDI_CTL_SC9                    = 0x4e  /**< SC9 */
  134. MIDI_CTL_SC10                   = 0x4f  /**< SC10 */
  135. MIDI_CTL_GENERAL_PURPOSE5       = 0x50  /**< General purpose 5 */
  136. MIDI_CTL_GENERAL_PURPOSE6       = 0x51  /**< General purpose 6 */
  137. MIDI_CTL_GENERAL_PURPOSE7       = 0x52  /**< General purpose 7 */
  138. MIDI_CTL_GENERAL_PURPOSE8       = 0x53  /**< General purpose 8 */
  139. MIDI_CTL_PORTAMENTO_CONTROL     = 0x54  /**< Portamento control */
  140. MIDI_CTL_E1_REVERB_DEPTH        = 0x5b  /**< E1 Reverb Depth */
  141. MIDI_CTL_E2_TREMOLO_DEPTH       = 0x5c  /**< E2 Tremolo Depth */
  142. MIDI_CTL_E3_CHORUS_DEPTH        = 0x5d  /**< E3 Chorus Depth */
  143. MIDI_CTL_E4_DETUNE_DEPTH        = 0x5e  /**< E4 Detune Depth */
  144. MIDI_CTL_E5_PHASER_DEPTH        = 0x5f  /**< E5 Phaser Depth */
  145. MIDI_CTL_DATA_INCREMENT         = 0x60  /**< Data Increment */
  146. MIDI_CTL_DATA_DECREMENT         = 0x61  /**< Data Decrement */
  147. MIDI_CTL_NONREG_PARM_NUM_LSB    = 0x62  /**< Non-registered parameter number */
  148. MIDI_CTL_NONREG_PARM_NUM_MSB    = 0x63  /**< Non-registered parameter number */
  149. MIDI_CTL_REGIST_PARM_NUM_LSB    = 0x64  /**< Registered parameter number */
  150. MIDI_CTL_REGIST_PARM_NUM_MSB    = 0x65  /**< Registered parameter number */
  151. MIDI_CTL_ALL_SOUNDS_OFF         = 0x78  /**< All sounds off */
  152. MIDI_CTL_RESET_CONTROLLERS      = 0x79  /**< Reset Controllers */
  153. MIDI_CTL_LOCAL_CONTROL_SWITCH   = 0x7a  /**< Local control switch */
  154. MIDI_CTL_ALL_NOTES_OFF          = 0x7b  /**< All notes off */
  155. MIDI_CTL_OMNI_OFF               = 0x7c  /**< Omni off */
  156. MIDI_CTL_OMNI_ON                = 0x7d  /**< Omni on */
  157. MIDI_CTL_MONO1                  = 0x7e  /**< Mono1 */
  158. MIDI_CTL_MONO2                  = 0x7f  /**< Mono2 */
  159.  
  160.  
  161. /* MIDI mode */
  162. SNDRV_MIDI_MODE_NONE    =  0;   /* Generic midi */
  163. SNDRV_MIDI_MODE_GM      =  1
  164. SNDRV_MIDI_MODE_GS      =  2
  165. SNDRV_MIDI_MODE_XG      =  3
  166. SNDRV_MIDI_MODE_MT32    =  4
  167.  
  168. /* MIDI note state */
  169. SNDRV_MIDI_NOTE_OFF             =   0x00
  170. SNDRV_MIDI_NOTE_ON              =   0x01
  171. SNDRV_MIDI_NOTE_RELEASED        =   0x02
  172. SNDRV_MIDI_NOTE_SOSTENUTO       =   0x04
  173. SNDRV_MIDI_NOTE_SOSTENUTO_NEG   =   0xfb