Jump to content

A joystick or touchpad for the filter of SID CS?


Jurbo
 Share

Recommended Posts

Has any of you used a joystick or a touchpad to control the filter of MBSID? Where did you get the joystick/touchpad and was it difficult to customize the software? Does it work well?

I know this has been discussed long time ago on this forum, but has anyone been at this lately?

Link to comment
Share on other sites

d2k: So you don't get jitter or display menu jumping to filter parameters randomly? Did you have to filter the output of the joystick pots with capacitors or something?

And where do I hook up the pots? I think I read somewhere, that no AIN module is needed. Is it the analog inputs on the sid chip, or?

Link to comment
Share on other sites

Ok, so, what value caps should I use on the joystick pots?

I have some mono audio cable (1 pole in the middle, ground wire wrapped around it  like a tube ) - this cable should be good enough for connecting the pots without picking up too much intereference, right?

Where on the master core should I connect the pots?

Link to comment
Share on other sites

  • 3 weeks later...

Ok, now I have a cute little joystick, and I have edited the files sid_init.inc and sid_ain.inc as described in the earlier forum thread. So, how do I build this huge lot of small text files into the .hex file that I'll turn into .syx?

I suppose this is the stage where I have to inform the software about the selected SID type and master/slave status, too? How do I get that done?

Thanks again, guys!  :)

Link to comment
Share on other sites

You need to download and install MPLAB and perl.

(see http://www.ucapps.de/howto_tools_mplab.html)

Then open the project in the directory you are working on(.mcp). Then re-assemble the main.asm. After that run the convert.bat file in the same directory. This converts the main.hex to main.syx. Then send it to your midi box. As far as the device ids and stuff. You should only need to modify the code for the first(cs) core. The other cores should just get the proper .syx file from the sid directory i.e. 2nd core gets setup_6581_slave1.syx and so forth. Remember that your second core needs to be id 01, then 02, and 03.

Justin

Link to comment
Share on other sites

Hmm... I used the MPLAB and convert.bat, and I got new versions of the .syx files. I first tried uploading the  file "setup_8580_with_cs.syx", then i tried uploading the file "main.syx".

In both cases, when I turned on my MBSID, played the MidiOx keyboard and used my joystick, I didn't get any changes in sound, also the parameters in the filter menu didn't change. Joystick connection should be ok, at least I get changing measurements, is there something I'm missing here? Should the MBSID be set in a certain mode to enable the joystick or something?  ???

Link to comment
Share on other sites

Hey...

Here is my sid_ain.inc:

;
; Enhanced AIN Driver for MIDIbox SID
; which allows you to change Control Surface Parameters via Pots
; Layers are not supported here, instead every menu parameter can be assigned
; to a single pot.
;
; Up to 64 entries can be added to SID_AIN_POT_ASSIGN_TABLE (see below)
;
; 19 entries are predefined here
;
; Open sid_init.inc and configure the AIN driver in the following way:      
;
;      ;; initialize the AIN driver
;      movlw      19                  ; use 19 pots
;      call      MIOS_AIN_NumberSet
;      call      MIOS_AIN_Muxed            ; service the multiplexer interface
;      movlw      0x07
;      movwf      MIOS_AIN_DeadbandSet      ; configure deadband for 7-bit values
;
; ==========================================================================
;
; Copyright (C) 1998-2003  Thorsten Klose (Thorsten.Klose@gmx.de)
;                          http://www.uCApps.de
; 
; ==========================================================================
; 
; This file is part of MIDIbox SID
;
; MIDIbox SID is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; MIDIbox SID is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with MIDIbox SID; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
;
; ==========================================================================

;; --------------------------------------------------------------------------
;;  This function is called by MIOS when a pot has been moved
;;  Input:
;;     o Pot number in WREG and MIOS_PARAMETER1
;;     o LSB value in MIOS_PARAMETER2
;;     o MSB value in MIOS_PARAMETER3
;; --------------------------------------------------------------------------
USER_AIN_NotifyChange
SID_AIN_NotifyChange
      ;; store pot number in TMP1
      movwf      TMP1

      ;; get 7-bit value of pot (number already in WREG)
      call      MIOS_AIN_Pin7bitGet
      ;; store it in MIOS_PARAMETER3
      movwf      MIOS_PARAMETER3

      ;; get offset to SID data base
      call      CS_MENU_MS_GetSIDNumber
      call      CS_MENU_MS_GetSIDBase

      ;; prepare CS parameters depending on pot number
      ;; read it from table for an easy customization
      TABLE_ADDR SID_AIN_POT_ASSIGN_TABLE
      ;; select entry (pot number * 4)
      movf      TMP1, W            ; pot number stored in TMP1
      mullw      4
      movf      PRODL, W
      addwf      TBLPTRL, F
      movf      PRODH, W
      addwfc      TBLPTRH, F

      ;; get function and store it in TMP1
      tblrd*+
      movff      TABLAT, TMP1

      ;; get parameter value and add it to FSR0L
      tblrd*+
      movf      TABLAT, W
      addwf      FSR0L, F

      ;; get menu number and store it in TMP2
      tblrd*+
      movff      TABLAT, TMP2

      ;; get menu offset and pos
      tblrd*+

      ;; store cursor position in MIOS_PARAMETER1
      movf      TABLAT, W
      andlw      0x0f
      movwf      MIOS_PARAMETER1

      ;; store page offset in MIOS_PARAMETER2
      swapf      TABLAT, W
      andlw      0x0f
      movwf      MIOS_PARAMETER2
      
      ;; absolute value already in MIOS_PARAMETER3

      ;; now branch depending on function
      swapf      TMP1, W
      andlw      0x0f
      JUMPTABLE_2BYTES 4 ; entries
      rgoto      SID_AIN_Modify_Sys
      rgoto      SID_AIN_Modify_Osc
      rgoto      SID_AIN_Modify_LFO
      rgoto      SID_AIN_Modify_Env

;; ---      
SID_AIN_Modify_Sys
      ;; just modify current parameter
      movf      TMP2, W            ; load menu number
      rgoto      SID_AIN_ModifyValue

SID_AIN_Modify_Osc
      ;; add voice offset
      call      CS_MENU_Hlp_AddVoiceOffset
      ;; and change parameter
      rgoto      SID_AIN_Modify_Sys

SID_AIN_Modify_LFO
      ;; add LFO offset
      call      CS_MENU_Hlp_AddLFOOffset
      ;; and change parameter
      rgoto      SID_AIN_Modify_Sys

SID_AIN_Modify_Env
      ;; add ENV offset
      call      CS_MENU_Hlp_AddENVOffset
      ;; and change parameter
      rgoto      SID_AIN_Modify_Sys


      ;; the pot assign table
      ;; similar to the table which can be found in cs_menu_enc_table.inc
      ;; (read the comments there)
      ;; NOTE: this version can only be used for changing control surface
      ;; parameter. It doesn't allow you to send CC values or whatever.
      ;; feel free to enhance the code like in cs_menu_enc.inc if you
      ;; want to control also other parameters

CSAIN_ENTRY MACRO function, parameter, menu, page_offset, cursor_pos
      db      function, parameter, menu, ((page_offset&0x0f)<<4) | (cursor_pos&0x0f)
      ENDM

      ;; available functions:
      ;; CSENC_ENTRY parameters:
      ;;    - the ID itself
      ;;    - the variable offset (see app_defines.inc, variables begin with CS_SID_*)
      ;;    - the menu in which the variable is located (see cs_menu_tables.inc)
      ;;    - the page offset (which menu item should be at the left border)
      ;;    - the cursor position of the menu item
#define CS_MENU_AIN_CHANGE_SYS           0x00      ; to change any internal parameter directly
#define CS_MENU_AIN_CHANGE_OSC       0x10      ; to change parameter of currently selected OSC
#define CS_MENU_AIN_CHANGE_LFO       0x20      ; to change parameter of currently selected LFO
#define CS_MENU_AIN_CHANGE_ENV       0x30      ; to change parameter of currently selected ENV

SID_AIN_POT_ASSIGN_TABLE
      ;; every pot has it's own entry
      ;; no layer handling supported here!
      ;; up to 64 entries are allowed for various parameter values
      ;;            Function name            parameter              menu            offset      cursor pos
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_SYS, CS_SID_FILTER_CUTOFF,        CS_MENU_FIL,      0x00,      0x01
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_SYS, CS_SID_FILTER_RESONANCE,  CS_MENU_FIL,      0x00,      0x02
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_DECAY,        CS_MENU_OSC,      0x03,      0x05
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_SUSTAIN,        CS_MENU_OSC,      0x03,      0x06
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_RELEASE,        CS_MENU_OSC,      0x03,      0x07
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_TRANSPOSE,  CS_MENU_OSC,      0x09,      0x09
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_FINETUNE,        CS_MENU_OSC,      0x09,      0x0a
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_PORTAMENTO, CS_MENU_OSC,      0x09,      0x0b
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_ARPEGGIATOR,CS_MENU_OSC,      0x09,      0x0c
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_PULSEWIDTH, CS_MENU_OSC,      0x09,      0x0d
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_LFO, CS_SID_LFOx_RATE,        CS_MENU_LFO,      0x00,      0x02
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_LFO, CS_SID_LFOx_DEPTH,        CS_MENU_LFO,      0x00,      0x03
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_DELAY,        CS_MENU_OSC,      0x03,      0x03
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_OSC, CS_SID_VOICEx_ATTACK,        CS_MENU_OSC,      0x03,      0x04
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_ENV, CS_SID_ENVx_DEPTH,        CS_MENU_ENV,      0x01,      0x01
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_ENV, CS_SID_ENVx_ATTACK,        CS_MENU_ENV,      0x01,      0x02
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_ENV, CS_SID_ENVx_DECAY,        CS_MENU_ENV,      0x01,      0x03
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_ENV, CS_SID_ENVx_SUSTAIN,        CS_MENU_ENV,      0x01,      0x04
      CSAIN_ENTRY      CS_MENU_AIN_CHANGE_ENV, CS_SID_ENVx_RELEASE,        CS_MENU_ENV,      0x01,      0x05


;; --------------------------------------------------------------------------
;;  This function modifies a given parameter which is indexed like shown
;;  here:
;;     ID of CS_MENU in WREG (example: CS_MENU_OSC)
;;     table (cursor) position in MIOS_PARAMETER1 (example: 0x01 for waveform)
;;     page offset in MIOS_PARAMETER2 (example: 0x00 begins at first line)
;;     7-bit value in MIOS_PARAMETER3
;; --------------------------------------------------------------------------
SID_AIN_ModifyValue
      ;; save WREG
      movwf      TMP5

      ;; change to menu
      movwf      CS_MENU
      call      CS_MENU_Page_Init

      ;; set new page offset and cursor pos
      movff      MIOS_PARAMETER1, CS_MENU_CURSOR_POS
      movff      MIOS_PARAMETER2, CS_MENU_PAGE_OFFSET

      ;; select parameter
      call      CS_MENU_EXEC_SelPar

      ;; copy value into the appr. CS register
      
      ;; here we could scale the value over the whole pot range,
      ;; but to keep it simple we just limit it to the max value
      movf      MIOS_PARAMETER3, W
        cpfsgt  CS_MENU_PARAMETER_MAX_L, ACCESS      ; (IFLEQ)
      movf      CS_MENU_PARAMETER_MAX_L, W
      movwf      CS_MENU_PARAMETER_L
      
      call      CS_MENU_ParameterUpdate            ; update parameter
      call      CS_MENU_EXEC_Hlp_ChangeMenu      ; deselect parameter

      ;; force a display update and exit
      bsf      CS_STAT, CS_STAT_DISPLAY_UPDATE_REQ

      return
in sid_init.inc:
      ;; initialize the AIN driver
      movlw      2                  ; use 2 pots
      call      MIOS_AIN_NumberSet
      call      MIOS_AIN_UnMuxed      ; don't service multiplexer interface
      movlw      7
      call      MIOS_AIN_DeadbandSet

After u made those changes -  u build a new .hex file then convert that to .syx - this proceedure has been covered many times and is also on the main ucapps.de site :)

Link to comment
Share on other sites

So the joystick controlled filter should be effective right away after applying power to the MBSID? No need to push any buttons (or connecting pins, in my case so far...)?

the joystick will effect whatever params u assign to it (not just filter/cutoff like shown in the code) after power on yes...just put whatever u want to control in the 2 (joystick=2 pots) top most entries in 'SID_AIN_POT_ASSIGN_TABLE'

Link to comment
Share on other sites

Ok, maybe I don't understand the compiler...

I open the .mcp file, and then press F10.

I get a lot of error messages (?), first one is:

"Make: The target "C:\XXMyfolderXX\main.o" is out of date."

Then there come dozens of messages, like:

"Warning[203] C:\XXMyfolderXX\SID_INIT.INC 68 : Found opcode in column 1. (movlw)"

What is the problem here? Any ideas?

Link to comment
Share on other sites

Thanks Marcel, but my folder is in the c:/ directory and it has a short name. So that can't be it...

But, even if I got a load of strange messages, the new main.syx file did the trick, and my joystick controlled filter now works!  ;D

Now I just have to figure out how to make the thing behave so that it doesn't jump to the filter menu when I wiggle the stick...  ;)

Link to comment
Share on other sites

How do I change the default patch, so that my default patch will boot up with filter enabled?

I want to test my joystick filter with my 6581 sid/core combo which doesn't have a lcd for navigation, so I need to change the default patch so that the filter is on as default.

Is it this line in the file sid_presets.inc:

EEPROM_FILTER_CHANNELS      de 0, 0x01      ;; 0x18

and how should I change it?

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...