Spincad notes Spincad Builder- Designing own blocks- Adding Frequency knob to Ringmod block

Installed Eclipse to use SpinCad Builder. This will allow me to create new blocks. The major limitation is no main frequency knob on Ring Modulator block, the control on there now control the LFO speed. The main Frequency is locked into the patch. I’ve made some cool patches but the frequency is set usually around 220 for A note.

Original Ring Modulation code made from Frank Thomson, Experimental Noize.
http://www.spinsemi.com/forum/viewtopic.php?t=95

;POT0 : Control frequency
;
equ s reg0
equ c reg1

;Then initialize the oscillator by setting one to xero and the other to -1
;we do this just once, during the first cycle of operation

skp run,endset ;do not execute if already running
wrax s,0 ;set s to 0, (acc should be zero)
sof 0,-1 ;set accum to -1
wrax c,0 ;write to c
endset: ;jump-to label

;Now do the LFO, using pot0 as a control for frequency

rdax s,0.02 ;read the s register, change this value between  0.001 and 1.0
mulx pot0 ;multiply by pot value
rdax c,1 ;read the c register
wrax c,-0.02 ;integrate the c value, this value MUST be the negative of
;what ever you set the value in 'rdax s,X' to above
mulx pot0 ;multiply by pot value
rdax s,1 ;read s reg
wrax s,1 ;integrate the s value

;Either the s or c register will be producing s waveforms (just shifted in
;phase), so either can be used as a modulation source. The maximum
;frequency of this LFO is Fs/2pi, which should be high enough!

mulx adcl

;and output the result

wrax dacl,0  

Copying and editing spincad files here, when saved, generates all the java files for blocks and control panels.

Tremolizer.spincad below. This are what I’ll copy and edit to create new patches, I do have to convert it from spinasm code. Just have to figure the assembly code and all the “@” lines conversions to add a control output. I think the easiest way is going through all the readily available patches and reading the fv-1 manual. The patches have a lot of notes in them especially from spinsemi.

// This control block takes a signal (usually an LFO) that goes from 0.0 to 1.0 and 
// allows you to adjust the width via a control input.
// There is also a control panel setting for maximum depth

@name Tremolizer
@color "0xf2f224"
@controlInput input 'LFO Input'
@controlInput width 'LFO Width'
@controlOutput output 'Control Output'

equ depth 0.75 
equ output reg0

// variable - Name - low - high - multiplier - precision - option 
@sliderLabel depth Depth 0.5 0.999 1.0 100.0 2  

@isPinConnected 'LFO Input'
rdax input, depth

@isPinConnected 'LFO Width'
mulx width
@endif

sof -0.999, 0.999
wrax output, 0.0

@setOutputPin 'Control Output' output
@endif

To Rebuild the .jar file, so you don’t have to keep running eclipse to check your new blocks out. Click Project Folder > Export >Runnable JAR>”SpinCADFrame – SpinCADBuilder”>Finish



Leave a Reply