Another Noise Generator

Algorithm development and general DSP issues

Moderator: frank

Post Reply
amz-fx
Posts: 32
Joined: Wed Sep 06, 2006 7:06 am
Location: Louisiana, USA
Contact:

Another Noise Generator

Post by amz-fx » Sun Mar 08, 2015 4:36 pm

I have written a 24-bit pseudorandom noise generator for the FV-1. It is a little different than the one that Frank posted and uses fewer instructions.

It should run for over 8.5 minutes without repeating.

Code: Select all

; 24 bit maximal period Galois LFSR
; Example by Jack Orman
; http://www.muzique.com
; March 5, 2015

; REG 0 : LFSR NOISE REGISTER
; REG 1 : OUTPUT BIT
;
EQU LFSR REG0
EQU TEMP REG1
;
; SEED THE LFSR WITH A NON-ZERO VALUE
SKP RUN,START
SOF 0,0.666   	; JUST TO ENSURE IT IS REALLY NON-ZERO
WRAX LFSR,0
;
;
START:
LDAX LFSR  		; GET LFSR REGISTER
AND 0x000001 	 ; GET LSB OF THE NOISE REGISTER
WRAX TEMP,0   	; SAVE BIT
RDAX LFSR,0.5    ; GET LFSR REG AND SHIFT RIGHT 1 PLACE
AND 0x7FFFFF     ; CLEAR MSB
WRAX LFSR,0   	; SAVE RESULT
LDAX TEMP   	  ; GET THE OUTPUT BIT
SKP ZRO,SHFTZRO	; IF 0 THEN JUMP
; IF LSB WAS SET THEN PROCESS
CLR      		  ; CLEAR ACC
LDAX LFSR   	  ; GET THE SAVED LFSR
XOR 0xD80000     ; TOGGLE THE MASK BITS
WRAX LFSR,0   	 ; SAVE IT
;
SHFTZRO:
LDAX LFSR
WRAX DACL,0 
For a REALLY long period before repeats, you could run a pair of these number generators and then combine the outputs in an alternating stop-and-go configuration to make the noise output.

Best regards, Jack

Digital Larry
Posts: 279
Joined: Mon Nov 12, 2012 12:12 pm
Contact:

Post by Digital Larry » Mon Mar 09, 2015 5:27 am

Thanks Jack! I'll see how this works out. It will be interesting to see if it works in my program's simulation mode.

DL

MacroMachines
Posts: 71
Joined: Fri Dec 12, 2014 9:45 pm
Location: Detroit,MI
Contact:

Post by MacroMachines » Sat Aug 06, 2016 12:41 pm

@Digital Larry, it would rock to have a few options for noise generating in spin cad, also the SAH block would be a bit more useful if you could supply any trigger (noise trigger, noise sample, could get some reallllly nice granular chorus going)
http://MacroMachines.net
Digital Control for your Analog Soul.

Digital Larry
Posts: 279
Joined: Mon Nov 12, 2012 12:12 pm
Contact:

Post by Digital Larry » Sun Aug 07, 2016 6:18 am

Wait, I thought you were handling all block development from here on out!

:D

MacroMachines
Posts: 71
Joined: Fri Dec 12, 2014 9:45 pm
Location: Detroit,MI
Contact:

Post by MacroMachines » Sun Aug 14, 2016 8:40 am

Ive been mainly compiling loads of things in asm that I plan to port once I understand how to do the conversion into blocks and update my git. I have a bunch of potential blocks ready but still not sure I understand the process, or what questions to ask for clarification yet.
http://MacroMachines.net
Digital Control for your Analog Soul.

Post Reply