Code Monkey home page Code Monkey logo

aleph's Introduction

aleph

monome aleph firmware, built against common avr32 library

[ http://www.monome.org/docs/aleph ]

quick start

is there an sdcard in it? there should be... then try:

  • hold mode switch (square, upper right) while powering up to launch the bootloader [*]

  • load an avr32 application from hex, in /hex folder on sdcard

  • the unit should now reset and launch the chosen application.

use usb cable and minicom/kermit to connect to aleph device port and get debug messages.

currently using baudrate 115200 and a device spelled something like /dev/ttyACM0. [**]

hints:

sudo stty -F /dev/ttyACM0 115200
minicom -s

(serial port setup; then 'E' for bps; then 'a' until you see 11500; then 'f' OFF )

[*] for the "green sandwich" proto, mode switch is broken, bootloader toggle is SW4.

[**] for the "green sandwich" proto, the device is called /dev/ttyUSBx on linux, looks like FTDI, and you may need to lower the baudrate.

device description

hardware:

aleph contains two processors:

  1. atmel AVR32 A0512. handles screen, encoders, panel switches, footswitches, USB, I2C, sdcard, and CV input.

  2. analog devices blackfin bf533. handles audio I/O, DSP processing, and CV output.

let's nickname these two processors the "controller" and the "dsp," respectively.

the controller is booted from internal flash memory. it is connected to the dsp by an SPI bus (a fast, 3-wire serial protocol.) to run a given audio program, the controller resets the dsp and sends a bootable binary image (.ldr) over the SPI bus. with the dsp running, the same SPI bus carries parameter changes.

audio programs share a common format and protocol, much like an Audio Unit or VST plugin in software. each has a number of settable parameters, and metadata/descriptors for each.

the controller has a custom bootloader, which runs when a certain key combination is detected at powerup. this bootloader is capable of flashing the internal memory with a new executable binary (.elf)

software:

aleph will ship with a controller application called BEES. this is a relatively large and complex program designed to be as general-purpose as possible. it can arbitrarily and dynamically route and process control rate input, mangage multiple audio modules, store and recall configurations from sdcard.

but for some users and applications, it may make more sense to use or develop a single-purpose application (e.g. a loop pedal, monosynth, or some exotic experiment.) to encourage this kind of work, we will try to provide a relatively high-level API over the layers of software that communicate most directly with hardware on the avr32. the app developer will presented with an array of handlers for handling UI or controller input, and an variety of functions for sending data to the dsp, to the screen, or to attached digital devices (such as monomes, laptops, midi devices, and other alephs.)

the dsp side of the aleph presents another area of extendability. the different audio modules are similarly simple, building on both a hardware-specific firmware layer and a library of abstract fixed-point audio processors.

code directory structure

controller

aleph/avr32_lib/src contains default low-level routines specific to the Aleph hardware. application authors can use these sources, or replace them with their own as desired.

aleph/avr32_lib/asf-x.x.x a copy of the Atmel Software Framework. this contains low-level drivers and utilies provided by Atmel, lightly modified by us.

aleph/apps contains a number of project directories which define actual functionality for the controller. each directory should contain app-specific sources and Makefile.

aleph/apps/bees this is our main control routing/management application.

aleph/common routines that both the dsp and the controller need to agree on. this includes the SPI protocol and fixed-point math routines.

aleph/utils/avr32_boot : avr32 bootloader and hardware test program.

DSP

aleph/bfin_lib/src low-level sources for audio programs. these routines interact with the blackfin hardware directly, and should be changed only with great care to avoid damaging the proces

aleph/modules contains a number of project directories for specific audio modules.

aleph/dsp common audio functions implemented in 32-bit fixed-point, (envelopes, filters, buffers, oscillators, etc); these should be freely added to as needed by new modules. currently there is no rigid class structure to these things, but we could impose one.

aleph/dsp/null a clunky little portaudio-based audio wrapper, suitable for preliminary development of new audio modules.

development setup

clone git repository: git clone https://github.com/tehn/aleph.git

AVR32

for mac: [https://github.com/droparea/avr32-toolchain]

for linux:

get the toolchain and header files from atmel.com.

currently the page is here, (but it could move) [http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx] you will need to sign up / login.

get the 32-bit linux toolchain. ** IMPORTANT: GET 32-BIT REGARDLESS OF YOUR HOST ARCHITECTURE. ** also get the atmel headers: avr32-gnu-toolchain-3.4.2.435-linux.any.x86.tar.gz atmel-headers-6.1.3.1475.zip

(these are the versions we use. feel free to try something newer, paying attention to potential conflicts with ASF and avr32_lib srouces.)

extracting the toolchain archive gives you something like avr32-gnu-toolchain-linux_x86/

move/rename this directory however you like and make sure the binaries are in your $PATH

extracting the headers gives you atmel-headers-6.1.3.1475

move or copy the headers subdirectories avr/ and avr32/ to the avr32/include/ subdirectory of the toolchain location. no, i have no idea why atmel chose to do it this way!

here is an example of the whole process:

cd ~/Downloads

tar -xzf avr32-gnu-toolchain-3.4.2.435-linux.any.x86.tar.gz
unzip atmel-headers-6.1.3.1475.zip

mv avr32-gnu-toolchain-linux_x86 ~/avr32-gnu-toolchain
PATH=$PATH:~/avr32-gnu-toolchain/bin

cd atmel-headers-6.1.3.1475
cp avr/ ~/avr32-gnu-toolchain/avr32/include -R
cp avr32/ ~/avr32-gnu-toolchain/avr32/include/ -R

you should now be able to run 'make' from aleph/apps/bees and produce aleph-bees.hex.

BLACKFIN

general instructions are here: [ http://blackfin.uclinux.org/doku.php?id=toolchain:installing ]

we are only building standalone binaries (no uclinux), so only the bfin-elf-gcc toolchain is needed.

get the most recent stable release for your architecture (2012-RC2 as of this writing), unpack it and add the binaries to your path.

example: visit: [ http://sourceforge.net/projects/adi-toolchain/files/2012R2/2012R2-RC2/i386/blackfin-toolchain-elf-gcc-4.3-2012R2-RC2.i386.tar.bz2/download ]

cd ~/Downloads
su
mv blackfin-toolchain-elf-gcc-4.3-2012R2-RC2.i386.tar.bz2 /
cd /
tar -xjvf blackfin-toolchain-elf-gcc-4.3-2012R2-RC2.i386.tar.bz2
export PATH=$PATH:/opt/uClinux/bfin-elf/bin

the toolchain will be extracted to ./opt/uClinux by default. of course you can use a different location if you like. you probably also want to add the path to your .bashrc or whatever.

you should now be able to run 'make' from aleph/modules/lines or any other module.

On macOS, a Docker image can be used to build using the bfin-elf toolchain. Launch a container with the checked out source repo mounted as a volume

docker run --rm -ti -v ~/src/aleph:/projects/aleph pf0camino/cross-bfin-elf "/bin/bash"

This starts a container with a shell and the aleph source mounted at /projects/aleph. The build instructions are the same as above from here.

aleph's People

Contributors

boqs avatar catfact avatar darrengit avatar dinchak avatar ngwese avatar prgmsoftware avatar ranch-verdin avatar tehn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aleph's Issues

drum synth

make a basic drum synth module.

  • noise sources
  • filters
  • oscillators
  • envelopes

unimplemented bees menu commands

finish implementing bees menu commands.
here is the full list from the guide.

for bugs with implemented commands, search for related issues and/or make new ones.

INPUTS:

  • SW0: STORE: store current value in current preset
  • SW1: INC/EXC: toggle inclusion of this input in current preset management
  • SW2: CLEAR: disconnect everything from this input
  • ALT0: GATHER: go to modal page with only the outputs connected to this input
  • ALT1: SHOW/HIDE: toggle inclusion of this input in play-mode listing
  • ALT2: FILT/ALL: show only play-enabled inputs in this list, or show all (default).
  • ALT + ENC0: select preset for recall + edit
  • ENC2: --- change parameter value, slow
  • ENC3: --- change parameter vlaue, fast

ROUTING:

  • SW0: STORE: store current routing in current preset
  • SW1: INC/EXC: toggle inclusion of this routing in current preset
  • SW2: CLEAR: disconnect
  • ALT0: FOLLOW: select this output's target on inputs page, and go there
  • ALT1: SPLIT: create a SPLIT operator and connect to its first input.
    if operator was already connected,
    connect the split's output to its former target.
    select the other split output.
  • ENC3: --- scroll target input

PRESETS:

  • SW0: STORE: store all nodes at this preset.
  • SW1: RECALL: overwrite all preset-included nodes with preset,
    update inclusion for next recall.
  • SW2: COPY/OK: begin copy / confirm and finish copy.
  • SW3: DEFAULT: store current settings as default

SCENES:

  • SW0: STORE: store current state of network to scene name.
    if the name has been edited, a new file will be created.
  • SW1: RECALL: load scene (halts network processing and may make noise).
  • SW2: COPY/OK: begin copy / confirm and finish copy.
  • ALT0: DEFAULT: store current settings as default
  • ALT2: CLEAR/OK: clear the current scene

OPERATORS:

  • SW0: INPUTS: select this op's inputs on ins page, and go there.
  • SW1: OUTPUTS: select this op's outputs on outs page, and go there.
  • SW2: CREATE: add a new operator of selected type.
  • SW3: PAGE/LIST: toggle op-specific subpage
  • ENC3: --- select operator type for creation.

MODULES:

  • SW0: LOAD: load audio module from sdcard.
  • SW1: DEFAULT: write audio module to internal memory for startup.

i2c

simple functionality

completed cost analysis

quotes remain:
top plate
pcb production
pcb assembly
general assembly
packaging
power supply

video

  1. viola and mic input, echo patch, foot pedals, analog insert path (filter?)
  2. eurorack and gamepad, bees sequencer or something
  3. aleph with usb midi keyboard playing polyphonic synth
  4. monome grid with aleph drum machine

production workflow

have a detailed plan of how production will happen.

how to play factory. every step.

testing suite

avr32 bootloader should include some test facilities.

  • RAM
  • cv loopback
  • audio
  • screen
  • footswitches
  • buttons
  • encoders
  • usb connections (aleph as host)
  • serial connections (aleph as device)

polyphony

need voice-allocation module for polysynth. should probably design monosynth with an eye towards abstraction.

monosynth

finish a working monosynth module. wavetable oscillator access works well but needs working envelopes, filters, waveshape generation
depends on : issue #9

.ldr stability

still seeing occasional unsuccessful blackfin boots. the system can work around them but i fear for the lifespan of the chip if it is booted from garbage. (we have seen that out-of-spec clock division settings will burn out the dsp, for example.)

for starters, we can checksum the .ldr data to see if there is corruption from sdcard.

in extremity, we could store each blackin programs as .hex and checksum each entry as we do with avr32 firmware. the downside is potentially a lot of computation time when loading a new dsp.

it seems unlikely but possible that the corruption is in SPI; checksum mismatch before that would suggest not.

interpolated buffer access

audio buffers need double-precision or float indexing for subsample access. 32.32 indexing is present but broken.

website

photos
text
diagram
video

monome series protocol

this got barfed up at some point since i switched to testing on mext and changed a bunch of stuff

bees remote editing

translate between binary scene files and XML or JSON or whatever the web kids are using.
alternatively, additionally, or relatedly: design a means of transmitting edits (+ performance?) over serial ports.

scene loading stability

loading monome op splatters weird shit into memory.
possible null function pointer.
might be better idea to store manager classes in the network data so their state is saved in scene.

custom copy methods

get your OOP act together and write custom copy methods for preset_t, scene_t, ctlnet_t, and whatever other big data classes are being blindly memcpy'd with impunity all over the dang place.

fix ASR envelopes

ASR is sort of broken. coefficient calculation is slow enough to disrupt audio. might as well use a lowpass filter.

associate scenes with audio modules.

a scene currently stores the name of its module. additionally, we should have default scenes associated with each module and the option to load the default scene from the modules page in bees.

avr32 firmware metadata

need an abstract mechanism to embed some descriptive text in a firmware .hex file, and probably to assign a default audio module.

pages / menu restructure

the source files for pages are a mess and should at least be separated. pages should never be using a big case statement on UI.
see issue #15

CV output

re-test CV output dac drivers. integrate this with the blackfin core. expose aleph parameters for output values.

code style / guide

articulate and document a consistent code formatting/naming style and suggested worklfow (e.g. where and when to branch/merge/push.)

not to mention, applying agreed-upon styles to existing codebase...

clean up events / handlers

the event handling system sucks.
should have separate queues for periodic system events (triggered from timers and handled by OS) and for events that are initiated from UI and handled by application.
should probably use arrays of function pointers that can be dynamically re-assigned by application.

screen / graphics restructure

fonts and glyphs should probably be application-specific.
provide raw access to pixels and some compositing methods.

structures such as menu pages should be able to keep their own graphics buffers, rendering new text only as needed.

programming guide

improve documentation of programming

  • toolchain setup
  • API descriptions
  • annotated examples

avr32 example app

make a simpler app than bees to demonstrate easy use of avr32 OS layer.
loop pedal would be a good candidate.

clean up timers

software timer class is bloated and modularity sucks. avr32 OS and applications should have separate timer lists, and these can be hardcoded.

SPI breakage in param set

setting parameters really fast can result in what seems like breakage of the blackfin SPI state machine.

blackfin control rate

we should be able to drastically improve blackfin performance with a well-considered control rate implementation.
will also let us get away with more in the numerical-precision department when e.g. applying control-rate filters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.