Subversion Repositories svn.mios

Compare Revisions

Ignore whitespace Rev 1164 → Rev 1189

/trunk/apps/synthesizers/midibox_sid_v2/src/sid_se.inc
11,6 → 11,7
;
; Copyright 1998-2007 Thorsten Klose (tk@midibox.org)
; Idea for ENV Curve Parameter and OSC synchronization by Jess D. Skov-Nielsen
; SuperSaw detune mode created by Lis0r
; Licensed for personal non-commercial use only.
; All other rights reserved.
;
1570,6 → 1571,74
bz SIDSE_Pitch_NoDetune
SIDSE_Pitch_Detune
movwf IRQ_TMP1
 
;; implement detune modes
SET_BSR SID_PATCH_BUFFER_SHADOW
BRA_IFSET SID_PATCH_BUFFER_SHADOW + SID_Ix_L_OSC_DTM, 0, BANKED, SIDSE_Pitch_SuperNeg
BRA_IFSET SID_PATCH_BUFFER_SHADOW + SID_Ix_L_OSC_DTM, 1, BANKED, SIDSE_Pitch_SuperPos
SET_BSR SID_BASE
rgoto SIDSE_Pitch_NormalDetune
 
;; super-saw like detune modes
;; Created by Lis0r, based on the research from this paper:
;; http://www.nada.kth.se/utbildning/grukth/exjobb/rapportlistor/2010/rapporter10/szabo_adam_10131.pdf
SIDSE_Pitch_SuperNeg
SET_BSR SID_BASE
;; Left OSC1: -detune
BRA_IFSET SID_SE_ELEMENT_NUM, 2, BANKED, SIDSE_Pitch_Super_45
SIDSE_Pitch_SuperNeg_0123
BRA_IFSET SID_SE_ELEMENT_NUM, 1, BANKED, SIDSE_Pitch_Super_23
SIDSE_Pitch_SuperNeg_01
BRA_IFSET SID_SE_ELEMENT_NUM, 0, BANKED, SIDSE_Pitch_Super_1
SIDSE_Pitch_SuperNeg_0 ; SIDL, OSC1
rgoto SIDSE_Pitch_Detune_Sub
 
SIDSE_Pitch_SuperPos
SET_BSR SID_BASE
;; Left OSC1: +detune
BRA_IFSET SID_SE_ELEMENT_NUM, 2, BANKED, SIDSE_Pitch_Super_45
SIDSE_Pitch_SuperPos_0123
BRA_IFSET SID_SE_ELEMENT_NUM, 1, BANKED, SIDSE_Pitch_Super_23
SIDSE_Pitch_SuperPos_01
BRA_IFSET SID_SE_ELEMENT_NUM, 0, BANKED, SIDSE_Pitch_Super_1
SIDSE_Pitch_SuperPos_0 ; SIDL, OSC1
rgoto SIDSE_Pitch_Detune_Add
 
;; Right OSC1: 0
;; Left OSC2: +detune/3
;; Right OSC2: -detune/3
;; Left OSC3: -2*detune/3
;; Right OSC3: +2*detune/3
SIDSE_Pitch_Super_1 ; SIDL, OSC2
rcall SIDSE_Hlp_Div3
rgoto SIDSE_Pitch_Detune_Add
SIDSE_Pitch_Super_23
BRA_IFSET SID_SE_ELEMENT_NUM, 0, BANKED, SIDSE_Pitch_Super_3
SIDSE_Pitch_Super_2 ; SIDL, OSC3
rcall SIDSE_Hlp_Div3
movf IRQ_TMP1, W
addwf IRQ_TMP1, F
rgoto SIDSE_Pitch_Detune_Sub
SIDSE_Pitch_Super_3 ; SIDR, OSC1
rgoto SIDSE_Pitch_NoDetune
SIDSE_Pitch_Super_45
BRA_IFSET SID_SE_ELEMENT_NUM, 0, BANKED, SIDSE_Pitch_Super_5
SIDSE_Pitch_Super_4 ; SIDR, OSC2
rcall SIDSE_Hlp_Div3
rgoto SIDSE_Pitch_Detune_Sub
SIDSE_Pitch_Super_5 ; SIDR, OSC3
rcall SIDSE_Hlp_Div3
movf IRQ_TMP1, W
addwf IRQ_TMP1, F
rgoto SIDSE_Pitch_Detune_Add
 
;; traditional normal detune mode
SIDSE_Pitch_NormalDetune
movf SID_PATCH_BUFFER_SHADOW + SID_Ix_L_OSC_DETUNE, W, BANKED
SET_BSR SID_BASE
bz SIDSE_Pitch_NoDetune
;; additional detuning depending on SID channel and oscillator
;; Left OSC1: +detune/4 (lead only, 0 in bassline mode)
;; Right OSC1: -detune/4 (lead only, 0 in bassline mode)
2797,6 → 2866,34
;; --------------------------------------------------------------------------
 
;; --------------------------------------------------------------------------
;; Help Function: Divide by 3 by evaluating series x/2 - x/4 + x/8 - x/16...
;; based on http://www.piclist.com/techref/microchip/math/div/8byconst3-aw.htm
;; IN: 8 bit value in IRQ_TMP1
;; OUT: result in IRQ_TMP1
;; USES: WREG
;; --------------------------------------------------------------------------
SIDSE_Hlp_Div3
movff IRQ_TMP1, IRQ_TMP2
clrf IRQ_TMP1
 
SIDSE_Hlp_Div3_Loop ;; while IRQ_TMP2 != 0
bcf STATUS, C
rrf IRQ_TMP2, F ;; IRQ_TMP2 /= 2 (i.e. "x/2" in Series)
movf IRQ_TMP2, W
btfsc STATUS, Z ;; ==0?
return ;; Yes, done
 
addwf IRQ_TMP1, F ;; IRQ_TMP1 += IRQ_TMP2
rrf IRQ_TMP2, F ;; IRQ_TMP2 /= 2 (i.e. "x/4" in Series)
movf IRQ_TMP2, W
btfsc STATUS, Z ;; ==0?
return ;; Yes, done
 
subwf IRQ_TMP1, f ;; IRQ_TMP1 -= IRQ_TMP2
goto SIDSE_Hlp_Div3_Loop
 
;; --------------------------------------------------------------------------
;; Help Function: Scale Depth (7bit signed value scales 15bit signed value)
;; IN: 8bit signed depth value (+0x80) in WREG
;; 15bit signed value in MUL_A_[LH]
/trunk/apps/synthesizers/midibox_sid_v2/src/cs_menu_print.inc
164,13 → 164,15
PRINT_ENSx_SPV EQU 0x7a
PRINT_ENSx_EXTINV EQU 0x7b
 
PRINT_DTM EQU 0x7c
 
 
; ==========================================================================
; The PRINT handler
;; IN: PRINT_xxx ID in WREG
; ==========================================================================
CS_MENU_PRINT_Handler
JUMPTABLE_2BYTES (0x7b+1) ; entries
JUMPTABLE_2BYTES (0x7c+1) ; entries
rgoto CS_MENU_PRINT_NOP
 
rgoto CS_MENU_PRINT_DEC8
315,6 → 317,8
rgoto CS_MENU_PRINT_ENSx_DOR
rgoto CS_MENU_PRINT_ENSx_SPV
rgoto CS_MENU_PRINT_ENSx_EXTINV
rgoto CS_MENU_PRINT_DTM
 
 
; ==========================================================================
1509,8 → 1513,13
movwf FSR0L
movf CS_MENU_PARAMETER_IX, W
rgoto CS_MENU_PRINT_OnOff_INDF0
 
; --------------------------------------------------------------------------
CS_MENU_PRINT_DTM
TABLE_ADDR CS_MENU_PRINT_DTM_Tab
movf INDF0, W
rgoto CS_MENU_PRINT_StringFromTable
 
; ==========================================================================
; ==========================================================================
; Help Functions
2134,6 → 2143,11
dw "Rnd "
dw "r.7 " ; reserved
 
CS_MENU_PRINT_DTM_Tab
dw "Nor "
dw "Su- "
dw "Su+ "
 
CS_MENU_PRINT_LFOx_WAV_Tab
dw "off "
dw "Sin "
/trunk/apps/synthesizers/midibox_sid_v2/src/sid_rnd.inc
236,6 → 236,10
movlw 0x1f
andwf SID_EDIT_BUFFER + SID_Ix_L_OSC_DETUNE, BANKED
 
;; detune mode always 0
SET_BSR SID_EDIT_BUFFER
clrf SID_EDIT_BUFFER + SID_Ix_L_OSC_DTM, BANKED
 
;; loop through left channel voices
SET_BSR SID_BASE
lfsr FSR1, SID_EDIT_BUFFER + SID_Ix_L_S1V1_BASE
/trunk/apps/synthesizers/midibox_sid_v2/src/cs_menu_tables.inc
398,6 → 398,7
CS_MENU_ENTRY SID_Ix_Vx_FLAGS1, "PMd", 0x002, PRINT_Vx_PMD, EXEC_TOGPAR, R2PP2R_Vx_PMD
CS_MENU_ENTRY SID_Ix_Vx_FLAGS1, "GSA", 0x001, PRINT_Vx_GSA, EXEC_TOGPAR, R2PP2R_Vx_GSA
CS_MENU_ENTRY SID_Ix_L_OSC_DETUNE, "Det", 0x0ff, PRINT_DEC8, EXEC_SELPAR, R2PP2R_PAR8
CS_MENU_ENTRY SID_Ix_L_OSC_DTM, "DtM", 0x002, PRINT_DTM, EXEC_TOGPAR, R2PP2R_PAR8
#if DEFAULT_ENABLE_SWINSID
CS_MENU_ENTRY SID_Ix_Vx_SWINSID_MODE, "SwM", 0x0ff, PRINT_Vx_HEX8, EXEC_SELPAR, R2PP2R_Vx
CS_MENU_ENTRY SID_Ix_Vx_SWINSID_PHASE, "SwP", 0x0ff, PRINT_Vx_HEX8, EXEC_SELPAR, R2PP2R_Vx
505,6 → 506,7
CS_MENU_ENTRY SID_Ix_B_V3_STATIC_NOTE, "Nt3", 0x07f, PRINT_Vx_NOTE, EXEC_SELPAR, R2PP2R_Vx
CS_MENU_ENTRY SID_Ix_B_OSC_PHASE, "Phs", 0x0ff, PRINT_DEC8, EXEC_SELPAR, R2PP2R_PAR8
CS_MENU_ENTRY SID_Ix_B_OSC_DETUNE, "Det", 0x0ff, PRINT_DEC8, EXEC_SELPAR, R2PP2R_PAR8
CS_MENU_ENTRY SID_Ix_L_OSC_DTM, "DtM", 0x002, PRINT_DTM, EXEC_TOGPAR, R2PP2R_PAR8
CS_MENU_TABLE_B_O23_End
 
; ==========================================================================
/trunk/apps/synthesizers/midibox_sid_v2/src/sid_par_table.inc
70,6 → 70,7
P_S_MODEL EQU 0x34
P_S_GATELENGTH EQU 0x35
P_S_PAR3 EQU 0x36
P_S_DTM EQU 0x37
 
;; read from sid_lcd.inc
SID_PAR_S_TABLE_WIDTH EQU 8
129,8 → 130,9
db "D.Model "
db "GateLn. "
db "Param.3 "
db "Det.Mode"
 
 
;; --------------------------------------------------------------------------
;; Parameter Number String Definitions
;; --------------------------------------------------------------------------
372,7 → 374,9
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC123, P_M_OSC123_PB, SIDL_V1_BASE
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC123, P_M_OSC123_PB, SIDL_V2_BASE
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC123, P_M_OSC123_PB, SIDL_V3_BASE
;; --[ 0x54-0x5f ]-----------------------------------------------------------------------------
;; --[ 0x54-0x54 ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_DTM, P_N_OSC, P_M_8, SID_Ix_L_OSC_DTM
;; --[ 0x55-0x5f ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
384,7 → 388,6
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
;; --[ 0x60-0x67 ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_DEPTH, P_N_MOD, P_M_MOD_PM8, SID_Ix_L_MOD1_BASE+SID_Ix_MODx_DEPTH
PAR_ENTRY P_S_DEPTH, P_N_MOD, P_M_MOD_PM8, SID_Ix_L_MOD2_BASE+SID_Ix_MODx_DEPTH
971,7 → 974,9
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC_BL, P_M_OSC_BL_PB, SIDL_V1_BASE
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC_BL, P_M_OSC_BL_PB, SIDL_V2_BASE
PAR_ENTRY P_S_PITCHBENDER,P_N_OSC_BL, P_M_OSC_BL_PB, SIDL_V3_BASE
;; --[ 0x54-0x5f ]-----------------------------------------------------------------------------
;; --[ 0x54-0x54 ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_DTM, P_N_OSC, P_M_8, SID_Ix_L_OSC_DTM
;; --[ 0x55-0x5f ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
983,7 → 988,6
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
PAR_ENTRY P_S_NOP, P_N_NOP, P_M_NOP, 0
;; --[ 0x60-0x63 ]-----------------------------------------------------------------------------
PAR_ENTRY P_S_CUTOFF, P_N_OSC_BL, P_M_OSC_BL_FIL12,SID_Ix_L_S1F_BASE+SID_Ix_L_Fx_CUTOFF_L
PAR_ENTRY P_S_CUTOFF, P_N_OSC_BL, P_M_OSC_BL_FIL12,SID_Ix_L_S1F_BASE+SID_Ix_L_Fx_CUTOFF_L
/trunk/apps/synthesizers/midibox_sid_v2/src/app_defines.h
881,7 → 881,9
SID_Ix_L_LFO5_BASE EQU 0x0d4;..0x0d8 LFO5
SID_Ix_L_LFO6_BASE EQU 0x0d9;..0x0dd LFO6
 
;; free: 0xde and 0xdf
;; Detune mode
SID_Ix_L_OSC_DTM EQU 0x0de;..0x0de DTM
;; free: 0xdf
 
;; ENV sections (uses SID_Ix_ENVx_* offsets)
SID_Ix_L_ENV1_BASE EQU 0x0e0;..0x0ef ENV1
1115,6 → 1117,7
SID_Ix_B_V3_STATIC_NOTE EQU 0x4c ; [6:0] if >0, play static note instead of transposed note
;; free offsets: 0x4d..0x4f
 
 
SID_Ix_B_SEQUENCES EQU 0x100;..0x1ff
;; structure: 2 bytes for each step (selected with address bit #7)
;; lower byte: note/octave/glide/gate flags