Started following some tutorial on att85 usi. Downloaded example code from make avr book.
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Project-specific Details ##########
|
||||
########## Check these every time you start a new project ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
MCU = atmega168p
|
||||
F_CPU = 8000000UL
|
||||
BAUD = 9600UL
|
||||
## Also try BAUD = 19200 or 38400 if you're feeling lucky.
|
||||
|
||||
## A directory for common include files and the simple USART library.
|
||||
## If you move either the current folder or the Library folder, you'll
|
||||
## need to change this path to match.
|
||||
LIBDIR = ../../AVR-Programming-Library
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Programmer Defaults ##########
|
||||
########## Set up once, then forget about it ##########
|
||||
########## (Can override. See bottom of file.) ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
PROGRAMMER_TYPE = usbtiny
|
||||
# extra arguments to avrdude: baud rate, chip type, -F flag, etc.
|
||||
PROGRAMMER_ARGS =
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Program Locations ##########
|
||||
########## Won't need to change if they're in your PATH ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
AVRSIZE = avr-size
|
||||
AVRDUDE = avrdude
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Makefile Magic! ##########
|
||||
########## Summary: ##########
|
||||
########## We want a .hex file ##########
|
||||
########## Compile source files into .elf ##########
|
||||
########## Convert .elf file into .hex ##########
|
||||
########## You shouldn't need to edit below. ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
## The name of your project (without the .c)
|
||||
# TARGET = blinkLED
|
||||
## Or name it automatically after the enclosing directory
|
||||
TARGET = $(lastword $(subst /, ,$(CURDIR)))
|
||||
|
||||
# Object files: will find all .c/.h files in current directory
|
||||
# and in LIBDIR. If you have any other (sub-)directories with code,
|
||||
# you can add them in to SOURCES below in the wildcard statement.
|
||||
SOURCES=$(wildcard *.c $(LIBDIR)/*.c)
|
||||
OBJECTS=$(SOURCES:.c=.o)
|
||||
HEADERS=$(SOURCES:.c=.h)
|
||||
|
||||
## Compilation options, type man avr-gcc if you're curious.
|
||||
CPPFLAGS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -I. -I$(LIBDIR)
|
||||
CFLAGS = -Os -g -std=gnu99 -Wall
|
||||
## Use short (8-bit) data types
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
## Splits up object files per function
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
LDFLAGS = -Wl,-Map,$(TARGET).map
|
||||
## Optional, but often ends up with smaller code
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
## Relax shrinks code even more, but makes disassembly messy
|
||||
## LDFLAGS += -Wl,--relax
|
||||
## LDFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm ## for floating-point printf
|
||||
## LDFLAGS += -Wl,-u,vfprintf -lprintf_min ## for smaller printf
|
||||
TARGET_ARCH = -mmcu=$(MCU)
|
||||
|
||||
## Explicit pattern rules:
|
||||
## To make .o files from .c files
|
||||
%.o: %.c $(HEADERS) Makefile
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<;
|
||||
|
||||
$(TARGET).elf: $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
|
||||
|
||||
%.hex: %.elf
|
||||
$(OBJCOPY) -j .text -j .data -O ihex $< $@
|
||||
|
||||
%.eeprom: %.elf
|
||||
$(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
|
||||
|
||||
%.lst: %.elf
|
||||
$(OBJDUMP) -S $< > $@
|
||||
|
||||
## These targets don't have files named after them
|
||||
.PHONY: all disassemble disasm eeprom size clean squeaky_clean flash fuses
|
||||
|
||||
all: $(TARGET).hex
|
||||
|
||||
debug:
|
||||
@echo
|
||||
@echo "Source files:" $(SOURCES)
|
||||
@echo "MCU, F_CPU, BAUD:" $(MCU), $(F_CPU), $(BAUD)
|
||||
@echo
|
||||
|
||||
# Optionally create listing file from .elf
|
||||
# This creates approximate assembly-language equivalent of your code.
|
||||
# Useful for debugging time-sensitive bits,
|
||||
# or making sure the compiler does what you want.
|
||||
disassemble: $(TARGET).lst
|
||||
|
||||
disasm: disassemble
|
||||
|
||||
# Optionally show how big the resulting program is
|
||||
size: $(TARGET).elf
|
||||
$(AVRSIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).obj \
|
||||
$(TARGET).o $(TARGET).d $(TARGET).eep $(TARGET).lst \
|
||||
$(TARGET).lss $(TARGET).sym $(TARGET).map $(TARGET)~ \
|
||||
$(TARGET).eeprom
|
||||
|
||||
squeaky_clean:
|
||||
rm -f *.elf *.hex *.obj *.o *.d *.eep *.lst *.lss *.sym *.map *~ *.eeprom
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Programmer-specific details ##########
|
||||
########## Flashing code to AVR using avrdude ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
flash: $(TARGET).hex
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -U flash:w:$<
|
||||
|
||||
## An alias
|
||||
program: flash
|
||||
|
||||
flash_eeprom: $(TARGET).eeprom
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -U eeprom:w:$<
|
||||
|
||||
avrdude_terminal:
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -nt
|
||||
|
||||
## If you've got multiple programmers that you use,
|
||||
## you can define them here so that it's easy to switch.
|
||||
## To invoke, use something like `make flash_arduinoISP`
|
||||
flash_usbtiny: PROGRAMMER_TYPE = usbtiny
|
||||
flash_usbtiny: PROGRAMMER_ARGS = # USBTiny works with no further arguments
|
||||
flash_usbtiny: flash
|
||||
|
||||
flash_usbasp: PROGRAMMER_TYPE = usbasp
|
||||
flash_usbasp: PROGRAMMER_ARGS = # USBasp works with no further arguments
|
||||
flash_usbasp: flash
|
||||
|
||||
flash_arduinoISP: PROGRAMMER_TYPE = avrisp
|
||||
flash_arduinoISP: PROGRAMMER_ARGS = -b 19200 -P /dev/ttyACM0
|
||||
## (for windows) flash_arduinoISP: PROGRAMMER_ARGS = -b 19200 -P com5
|
||||
flash_arduinoISP: flash
|
||||
|
||||
flash_109: PROGRAMMER_TYPE = avr109
|
||||
flash_109: PROGRAMMER_ARGS = -b 9600 -P /dev/ttyUSB0
|
||||
flash_109: flash
|
||||
|
||||
##########------------------------------------------------------##########
|
||||
########## Fuse settings and suitable defaults ##########
|
||||
##########------------------------------------------------------##########
|
||||
|
||||
## Mega 48, 88, 168, 328 default values
|
||||
LFUSE = 0x62
|
||||
HFUSE = 0xdf
|
||||
EFUSE = 0x00
|
||||
|
||||
## Generic
|
||||
FUSE_STRING = -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m -U efuse:w:$(EFUSE):m
|
||||
|
||||
fuses:
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) \
|
||||
$(PROGRAMMER_ARGS) $(FUSE_STRING)
|
||||
show_fuses:
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -nv
|
||||
|
||||
## Called with no extra definitions, sets to defaults
|
||||
set_default_fuses: FUSE_STRING = -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m -U efuse:w:$(EFUSE):m
|
||||
set_default_fuses: fuses
|
||||
|
||||
## Set the fuse byte for full-speed mode
|
||||
## Note: can also be set in firmware for modern chips
|
||||
set_fast_fuse: LFUSE = 0xE2
|
||||
set_fast_fuse: FUSE_STRING = -U lfuse:w:$(LFUSE):m
|
||||
set_fast_fuse: fuses
|
||||
|
||||
## Set the EESAVE fuse byte to preserve EEPROM across flashes
|
||||
set_eeprom_save_fuse: HFUSE = 0xD7
|
||||
set_eeprom_save_fuse: FUSE_STRING = -U hfuse:w:$(HFUSE):m
|
||||
set_eeprom_save_fuse: fuses
|
||||
|
||||
## Clear the EESAVE fuse byte
|
||||
clear_eeprom_save_fuse: FUSE_STRING = -U hfuse:w:$(HFUSE):m
|
||||
clear_eeprom_save_fuse: fuses
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* "Algorithmic Symphonies"
|
||||
* When you combine modula arithmetic with a counter variable,
|
||||
* you can get sequences that sound like 4-bit chiptunes.
|
||||
* Note that we're just outputting numerical values
|
||||
* directly as a voltage.
|
||||
* Play around with these formulas defined here, or see others
|
||||
* in the attached file "music_formula_collection.txt".
|
||||
* */
|
||||
|
||||
// ------- Preamble -------- //
|
||||
#include <avr/io.h> /* Defines pins, ports, etc */
|
||||
#include <util/delay.h> /* Functions to waste time */
|
||||
#include <avr/power.h>
|
||||
#include "pinDefines.h"
|
||||
#include "macros.h"
|
||||
|
||||
static inline void initTimer0(void){
|
||||
|
||||
set_bit(TCCR0A, COM0A1); /* PWM output on OCR0A */
|
||||
set_bit(SPEAKER_DDR, SPEAKER); /* enable output on pin */
|
||||
set_bit(TCCR0A, WGM00); /* Fast PWM mode */
|
||||
set_bit(TCCR0A, WGM01); /* Fast PWM mode, pt.2 */
|
||||
set_bit(TCCR0B, CS00); /* Clock with /1 prescaler */
|
||||
}
|
||||
|
||||
static inline void pollButton(void){
|
||||
if (bit_is_clear(BUTTON_PIN, BUTTON)) {
|
||||
set_bit(SPEAKER_DDR, SPEAKER); /* enable output on pin */
|
||||
clear_bit(LED_PORT, LED0);
|
||||
}
|
||||
else {
|
||||
clear_bit(SPEAKER_DDR, SPEAKER); /* disable output on pin */
|
||||
set_bit(LED_PORT, LED0);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void){
|
||||
uint16_t t=0;
|
||||
|
||||
// -------- Inits --------- //
|
||||
clock_prescale_set(clock_div_1); /* CPU clock 8 MHz */
|
||||
initTimer0();
|
||||
|
||||
set_bit(BUTTON_PORT, BUTTON); /* pullup on button */
|
||||
|
||||
set_bit(LED_DDR, LED0); /* LED on for diagnostics */
|
||||
set_bit(LED_PORT, LED0);
|
||||
_delay_ms(100);
|
||||
clear_bit(LED_PORT, LED0);
|
||||
|
||||
set_bit(SPEAKER_DDR, SPEAKER);
|
||||
OCR0A = 210;
|
||||
// ------ Event loop ------ //
|
||||
while(1){
|
||||
|
||||
t++;
|
||||
OCR0A = (uint8_t) ((t<<1)^((t<<1)+(t>>7)&t>>12))|t>>(4-(1^7&(t>>19)))|t>>7; /* "crowd" */
|
||||
// OCR0A = (uint8_t) t; /* sawtooth */
|
||||
// OCR0A = (uint8_t) t * (t >> 8); /* rising pitch + aliases all over */
|
||||
// OCR0A = (uint8_t) t & (t >> 8); /* arpeggios */
|
||||
// OCR0A = (uint8_t) t*( 42 & t >> 10 );
|
||||
// OCR0A = (uint8_t) t*(t>>((t>>9)|(t>>8))&(63&(t>>4))); /* space invaders vs pong */
|
||||
// OCR0A = (uint8_t) t*(t>>8*((t>>15)|(t>>8))&(20|(t>>19)*5>>t|(t>>3)));
|
||||
// OCR0A = (uint8_t) (t*5&t>>7)|(t*3&t>>10);
|
||||
// OCR0A = (uint8_t) (t*9 & t>>4 | t* 5 & t>> 7 | t * 3 & t/1024)-1;
|
||||
// OCR0A = (uint8_t) (t>>5)|(t>>4)|((t%42)*(t>>4)|(0x15483113)-(t>>4))/(t>>16)^(t|(t>>4));
|
||||
// OCR0A = (uint8_t) t*(( (t>>12) | (t>>8)) & (63 & (t>>4)) ); /* glitchy */
|
||||
pollButton();
|
||||
_delay_us(124); /* Aiming for 8kHz sample rate */
|
||||
|
||||
} /* End event loop */
|
||||
return 0; /* This line is never reached */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
Collection of oneliner music formulas. Version 2011-10-18
|
||||
|
||||
I've tried to collect all the formulas in the related threads etc.
|
||||
(excluding those that clearly sound like random first experiments or total
|
||||
crap; when several variants are available, i've chosen the shortest one)
|
||||
|
||||
If you think I've missed something that should be here, please let me know.
|
||||
|
||||
====== 1ST ITERATION ======
|
||||
|
||||
// viznut 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>12)|(t>>8))&(63&(t>>4)))
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
(t*(t>>5|t>>8))>>(t>>16)
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>9)|(t>>13))&(25&(t>>6)))
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>11)&(t>>8))&(123&(t>>3)))
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(t>>8*((t>>15)|(t>>8))&(20|(t>>19)*5>>t|(t>>3)))
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
(-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14))
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg "Space Invaders vs Pong"
|
||||
t*(t>>((t>>9)|(t>>8))&(63&(t>>4)))
|
||||
|
||||
====== 2ND ITERATION ======
|
||||
|
||||
// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
(t>>6|t|t>>(t>>16))*10+((t>>11)&7)
|
||||
|
||||
// pyryp 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
v=(v>>1)+(v>>4)+t*(((t>>16)|(t>>6))&(69&(t>>9)))
|
||||
|
||||
// red- 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
(t|(t>>9|t>>7))*t&(t>>11|t>>9)
|
||||
|
||||
// miiro 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
t*5&(t>>7)|t*3&(t*4>>10)
|
||||
|
||||
// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y (xpansive+varjohukka)
|
||||
(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)
|
||||
|
||||
// skurk+raer 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t))
|
||||
|
||||
// xpansive 2011-09-29 http://pouet.net/topic.php?which=8357&page=2 "Lost in Space"
|
||||
((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)
|
||||
|
||||
====== 3RD ITERATION ======
|
||||
|
||||
// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(t*5&t>>7)|(t*3&t>>10)
|
||||
|
||||
// bst 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(int)(t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t
|
||||
|
||||
// kb 2011-10-04 http://pouet.net/topic.php?which=8357&page=8 44kHz
|
||||
((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)
|
||||
|
||||
// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(t&t%255)-(t*3&t>>13&t>>6)
|
||||
|
||||
// droid 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
t>>4|t&((t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15)))
|
||||
|
||||
// ryg 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o 44.1 kHz
|
||||
((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)
|
||||
|
||||
// stephth 2011-10-03 http://news.ycombinator.com/item?id=3063359
|
||||
(t*9&t>>4|t*5&t>>7|t*3&t/1024)-1
|
||||
|
||||
// viznut+oasiz 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Dante's Inferno" short version
|
||||
((t*(t>>12)&(201*t/100)&(199*t/100))&(t*(t>>14)&(t*301/100)&(t*399/100)))+((t*(t>>16)&(t*202/100)&(t*198/100))-(t*(t>>17)&(t*302/100)&(t*298/100)))
|
||||
|
||||
// viznut+oasiz 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Dante's Inferno" long version
|
||||
((t*(t>>12)&(201*t/100)&(199*t/100))&(t*(t>>14)&(t*301/100)&(t*399/100)))+((t*(t>>16)&(t*202/100)&(t*198/100))-(t*(t>>18)&(t*302/100)&(t*298/100)))
|
||||
|
||||
// mu6k 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Long-line Theory", Chaos Theory cover, optimized by ryg, p01 et al., JS-only
|
||||
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s
|
||||
|
||||
// 216 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
t*(t^t+(t>>15|1)^(t-1280^t)>>10)
|
||||
|
||||
// mu6k http://www.youtube.com/watch?v=tCRPUv8V22o 32.0 kHz
|
||||
(3e3/(y=t&16383)&1)*35 +(x=t*"6689"[t>>16&3]/24&127)*y/4e4 +((t>>8^t>>10|t>>14|x)&63)
|
||||
|
||||
====== 0XA VIDEOS ======
|
||||
|
||||
// harism 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
((t>>1%128)+20)*3*t>>14*t>>18
|
||||
|
||||
// tangent128 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))
|
||||
|
||||
// ultrageranium 2011-10-12 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
(t*t/256)&(t>>((t/1024)%16))^t%64*(0xC0D3DE4D69>>(t>>9&30)&t%32)*t>>18
|
||||
|
||||
====== ALL COLLECTED FORMULAS (length order) ======
|
||||
|
||||
// trivial minimum: plain sawtooth
|
||||
t
|
||||
|
||||
// minimal sierpinski harmony
|
||||
t&t>>8
|
||||
|
||||
// "the 42 melody", separately discovered by several people on irc etc
|
||||
t*(42&t>>10)
|
||||
|
||||
// danharaj 2011-10-03 http://www.reddit.com/r/programming/comments/kyj77/algorithmic_symphonies_from_one_line_of_code_how/ "fractal trees", 216's version
|
||||
t|t%255|t%257
|
||||
|
||||
// droid 2011-10-05 http://pouet.net/topic.php?which=8357&page=10
|
||||
t>>6&1?t>>5:-t>>4
|
||||
|
||||
// Niklas_Roy 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
t*(t>>9|t>>13)&16
|
||||
|
||||
// krcko 2011-10-04 http://rafforum.rs/index.php/topic,123.0.html
|
||||
(t&t>>12)*(t>>4|t>>8)
|
||||
|
||||
// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(t*5&t>>7)|(t*3&t>>10)
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
(t*(t>>5|t>>8))>>(t>>16)
|
||||
|
||||
// miiro 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
t*5&(t>>7)|t*3&(t*4>>10)
|
||||
|
||||
// robert 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
(t>>13|t%24)&(t>>7|t%19)
|
||||
|
||||
// Niklas_Roy 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
(t*((t>>9|t>>13)&15))&129
|
||||
|
||||
// viznut 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(t&t%255)-(t*3&t>>13&t>>6)
|
||||
|
||||
// krcko 2011-10-04 http://rafforum.rs/index.php/topic,123.0.html
|
||||
(t&t>>12)*(t>>4|t>>8)^t>>6
|
||||
|
||||
// blueberry 2011-10-05 http://pouet.net/topic.php?which=8357&page=12 11kHz
|
||||
t*(((t>>9)^((t>>9)-1)^1)%13)
|
||||
|
||||
// rrola 2011-10-04 http://pouet.net/topic.php?which=8357&page=9 optimized by ryg
|
||||
t*(0xCA98>>(t>>9&14)&15)|t>>8
|
||||
|
||||
// tonic 2011-10-01 http://pouet.net/topic.php?which=8357&page=5 "mr. arpeggiator playing a solo"
|
||||
(t/8)>>(t>>9)*t/((t>>14&3)+4)
|
||||
|
||||
// FreeFull 2011-10-12 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
(~t/100|(t*3))^(t*3&(t>>5))&t
|
||||
|
||||
// red- 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
(t|(t>>9|t>>7))*t&(t>>11|t>>9)
|
||||
|
||||
// harism 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
((t>>1%128)+20)*3*t>>14*t>>18
|
||||
|
||||
// droid 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
|
||||
t&(sin(t&t&3)*t>>5)/(t>>3&t>>6)
|
||||
|
||||
// viznut 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>12)|(t>>8))&(63&(t>>4)))
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>9)|(t>>13))&(25&(t>>6)))
|
||||
|
||||
// 216 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
t*(t^t+(t>>15|1)^(t-1280^t)>>10)
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(((t>>11)&(t>>8))&(123&(t>>3)))
|
||||
|
||||
// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y (xpansive+varjohukka)
|
||||
(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)
|
||||
|
||||
// stephth 2011-10-03 http://news.ycombinator.com/item?id=3063359
|
||||
(t*9&t>>4|t*5&t>>7|t*3&t/1024)-1
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg "Space Invaders vs Pong"
|
||||
t*(t>>((t>>9)|(t>>8))&(63&(t>>4)))
|
||||
|
||||
// viznut 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
(t>>6|t|t>>(t>>16))*10+((t>>11)&7)
|
||||
|
||||
// yumeji 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
|
||||
(t>>1)*(0xbad2dea1>>(t>>13)&3)|t>>5
|
||||
|
||||
// ryg 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
|
||||
(t>>4)*(13&(0x8898a989>>(t>>11&30)))
|
||||
|
||||
// marmakoide 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
|
||||
(t>>(t&7))|(t<<(t&42))|(t>>7)|(t<<5)
|
||||
|
||||
// robert 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
(t>>7|t%45)&(t>>8|t%35)&(t>>11|t%20)
|
||||
|
||||
// lucasvb 2011-10-03 http://www.reddit.com/r/programming/comments/kyj77/algorithmic_symphonies_from_one_line_of_code_how/
|
||||
(t>>6|t<<1)+(t>>5|t<<3|t>>3)|t>>2|t<<1
|
||||
|
||||
// bear @ celephais
|
||||
t+(t&t^t>>6)-t*((t>>9)&(t%16?2:6)&t>>9)
|
||||
|
||||
// xpansive 2011-09-29 http://pouet.net/topic.php?which=8357&page=2 "Lost in Space"
|
||||
((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)
|
||||
|
||||
// rez 2011-10-05 http://pouet.net/topic.php?which=8357&page=11 js-only optimized by ryg
|
||||
t*(1+"4451"[t>>13&3]/10)&t>>9+(t*0.003&3)
|
||||
|
||||
// marmakoide 2011-10-03 http://pouet.net/topic.php?which=8357&page=7 "Lemmings March"
|
||||
(t>>5)|(t<<4)|((t&1023)^1981)|((t-67)>>4)
|
||||
|
||||
// droid 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
|
||||
t>>4|t&(t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15))
|
||||
|
||||
// rez 2011-10-03 http://pouet.net/topic.php?which=8357&page=7
|
||||
t*(t/256)-t*(t/255)+t*(t>>5|t>>6|t<<2&t>>1)
|
||||
|
||||
// viznut 2011-10-06 #countercomplex "moon scanner generalization", based on jaffa's formula
|
||||
((t>>5&t)-(t>>5)+(t>>5&t))+(t*((t>>14)&14))
|
||||
|
||||
// viznut 2011-10-04 http://pouet.net/topic.php?which=8357&page=9
|
||||
(t*((3+(1^t>>10&5))*(5+(3&t>>14))))>>(t>>8&3)
|
||||
|
||||
// droid 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
t>>4|t&DIV((t>>5),(t>>7-(t>>15)&-t>>7-(t>>15)))
|
||||
|
||||
// pyryp 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
v=(v>>1)+(v>>4)+t*(((t>>16)|(t>>6))&(69&(t>>9)))
|
||||
|
||||
// bst 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o
|
||||
(int)(t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t
|
||||
|
||||
// tangent128 2011-10-09 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))
|
||||
|
||||
// tejeez 2011-10-05 #countercomplex
|
||||
(~t>>2)*((127&t*(7&t>>10))<(245&t*(2+(5&t>>14))))
|
||||
|
||||
// lokori 2011-10-04 #suomiscene
|
||||
(t+(t>>2)|(t>>5))+(t>>3)|((t>>13)|(t>>7)|(t>>11))
|
||||
|
||||
// visy 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
t*(t>>8*((t>>15)|(t>>8))&(20|(t>>19)*5>>t|(t>>3)))
|
||||
|
||||
// Aaron_Krister_Johnson 2011-10-14 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
(t>>4)|(t%10)|(((t%101)|(t>>14))&((t>>7)|(t*t%17)))
|
||||
|
||||
// jounim 2011-10-04 #suomiscene
|
||||
((t&((t>>5)))+(t|((t>>7))))&(t>>6)|(t>>5)&(t*(t>>7))
|
||||
|
||||
// spikey 2011-10-04 #suomiscene based on jounim's formula
|
||||
((t&((t>>23)))+(t|(t>>2)))&(t>>3)|(t>>5)&(t*(t>>7))
|
||||
|
||||
// akx 2011-10-05 http://twitter.com/#!/akx
|
||||
(((((t*((t>>9|t>>13)&15))&255/15)*9)%(1<<7))<<2)%6<<4
|
||||
|
||||
// bst 2011-10-05 http://pouet.net/topic.php?which=8357&page=10
|
||||
((t%42)*(t>>4)|(0x15483113)-(t>>4))/(t>>16)^(t|(t>>4))
|
||||
|
||||
// skurk 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
|
||||
t*(t>>((t&4096)?((t*t)/4096):(t/4096)))|(t<<(t/256))|(t>>4)
|
||||
|
||||
// skurk+raer 2011-09-30 http://www.youtube.com/watch?v=qlrs2Vorw2Y
|
||||
((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t))
|
||||
|
||||
// yumeji 2011-10-06 http://pouet.net/topic.php?which=8357&page=12 "badbeats & safe"
|
||||
t*((0xbadbea75>>((t>>12)&30)&3)*0.25*(0x5afe5>>((t>>16)&28)&3))
|
||||
|
||||
// bst 2011-10-11 http://pouet.net/topic.php?which=8357&page=18
|
||||
t>>16|((t>>4)%16)|((t>>4)%192)|(t*t%64)|(t*t%96)|(t>>16)*(t|t>>5)
|
||||
|
||||
// bear @ celephais
|
||||
t>>6^t&37|t+(t^t>>11)-t*((t%24?2:6)&t>>11)^t<<1&(t&598?t>>4:t>>10)
|
||||
|
||||
// kb 2011-10-04 http://pouet.net/topic.php?which=8357&page=8 44kHz
|
||||
((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)
|
||||
|
||||
// bst 2011-10-05 http://pouet.net/topic.php?which=8357&page=12
|
||||
(t>>5)|(t>>4)|((t%42)*(t>>4)|(0x15483113)-(t>>4))/(t>>16)^(t|(t>>4))
|
||||
|
||||
// tejeez 2011-09-18 http://www.youtube.com/watch?v=GtQdIYUtAHg
|
||||
(-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14))
|
||||
|
||||
// ultrageranium 2011-10-12 http://0xa.kuri.mu/2011/10/09/bitop-videos/
|
||||
(t*t/256)&(t>>((t/1024)%16))^t%64*(0xC0D3DE4D69>>(t>>9&30)&t%32)*t>>18
|
||||
|
||||
// visy 2011-10-06 http://pouet.net/topic.php?which=8357&page=13
|
||||
(t%25-(t>>2|t*15|t%227)-t>>3)|((t>>5)&(t<<5)*1663|(t>>3)%1544)/(t%17|t%2048)
|
||||
|
||||
// ryg 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o 44.1 kHz
|
||||
((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)
|
||||
|
||||
// mu6k http://www.youtube.com/watch?v=tCRPUv8V22o 32.0 kHz
|
||||
(3e3/(y=t&16383)&1)*35 +(x=t*"6689"[t>>16&3]/24&127)*y/4e4 +((t>>8^t>>10|t>>14|x)&63)
|
||||
|
||||
// Ola 2011-10-11 http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
|
||||
((1-(((t+10)>>((t>>9)&((t>>14))))&(t>>4&-2)))*2)*(((t>>10)^((t+((t>>6)&127))>>10))&1)*32+128
|
||||
|
||||
// raer 2011-10-07 http://pouet.net/topic.php?which=8357&page=16 stereo 11kHz
|
||||
L: ((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t)) R: t*(((t>>9)^((t>>9)-1)^1)%13)
|
||||
|
||||
// ryg 2011-10-04 http://pouet.net/topic.php?which=8357&page=8
|
||||
((t>>4)*(13&(0x8898a989>>(t>>11&30)))&255)+((((t>>9|(t>>2)|t>>8)*10+4*((t>>2)&t>>15|t>>8))&255)>>1)
|
||||
|
||||
// gasman 2011-10-05 http://pouet.net/topic.php?which=8357&page=12 js-only
|
||||
(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]
|
||||
|
||||
// a1k0n http://news.ycombinator.com/item?id=3063359 js-only
|
||||
SS=function(s,o,r,p){var c=s.charCodeAt((t>>r)%p);return c==32?0:31&t*Math.pow(2,c/12-o)},SS("0 0 7 7 037:<<",6,10,32) + (t&4096?SS("037",4,8,3)*(4096-(t&4095))>>12 : 0)
|
||||
|
||||
// mu6k 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Long-line Theory", Chaos Theory cover, optimized by ryg, p01 et al., JS-only
|
||||
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s
|
||||
Reference in New Issue
Block a user