SYNTHINGS is a digital synthesizer development platform that I've been building.

Tune editor (part 6)

jason | 23 January, 2011 17:51

I decided to have a short day - I finally had some feedback from my Eagle PCB search site for some ideas and I thought I would look into it.

I did get a fair amount done though - placing the patterns, and displaying them.

I started with the basic "create the first pattern for a voice" code, which is simply creating the first element into each array:

Tune editor part 6

The bottom one actually has a repeat (of 3 - it, plus two others). I've modelled this slightly after Logic

The repeated sections didn't look very clear, so I added a stripe in the background colour on the left, and also changed the left line of a pattern to a dithered version of background/foregroud colors. It looks good with colours too:

Tune editor part 6

I decided to rewrite the keyboard entry so it's two dimensional, rather than two clicks. The rotary encoder selects along the rows, and the left and right buttons switch between each row. This now removed the need for the code to do a nested field selection.

And then it was time to have more patterns on the same line. This took a while to perfect - you can overlap patterns (the current pattern will stop playing, and the overlapped pattern will continue). The main problems I had was in the memory accessing. This is what it looks like:

Tune editor part 6Tune editor part 6

I then started work on saving tunes (I can then create some pre-canned examples for subsequent tests, rather than having to insert patterns all the time - "Pattern 17" is a test pattern). But mid-way through the code modifications to allow the tunes, patterns and samples to be saved, I got the email about the Eagle search - so stopped.

This is the memory prior to building with save code:

Program Memory  [Origin = 0x200, Length = 0x2aa00]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200              0x13b4          0x1d8e  (7566)
.const                      0x15b4              0x2978          0x3e34  (15924)
.text                       0x3f2c              0xcd26         0x133b9  (78777)
.dinit                     0x10c52               0x2a0           0x3f0  (1008)
.text                      0x10ef2              0x1792          0x235b  (9051)
.isr                       0x12684                 0x2             0x3  (3)

                     Total program memory used (bytes):        0x1b6c9  (112329) 42%

Data Memory  [Origin = 0x800, Length = 0x7800]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.nbss                        0x800                   0           0x9ea  (2538)
.ndata                      0x11ea                   0             0x2  (2)
_03854ee04d3aa7d3           0x11ec                   0           0x200  (512)
_038570704d3aa7d3           0x13ec                   0           0x200  (512)
.nbss                       0x15ec                   0           0x314  (788)
.ndata                      0x1900                   0            0xf4  (244)
.nbss                       0x19f4                   0            0xd4  (212)
.ndata                      0x1ac8                   0            0x22  (34)
.nbss                       0x1aea                   0            0x2a  (42)
.ndata                      0x1b14                   0            0x12  (18)
.nbss                       0x1b26                   0            0x34  (52)
.ndata                      0x1b5a                   0             0x8  (8)
.nbss                       0x1b62                   0            0x12  (18)
.ndata                      0x1b74                   0             0x2  (2)
.nbss                       0x1b76                   0             0x4  (4)
.ndata                      0x1b7a                   0             0x4  (4)
.nbss                       0x1b7e                   0             0x2  (2)
.ndata                      0x1b80                   0             0x2  (2)
.data                       0x1b82                   0           0x106  (262)
.dconst                     0x1c88                   0             0x8  (8)
.data                       0x1c90                   0             0xc  (12)
.bss                        0x1c9c                   0             0x4  (4)
.data                       0x1ca0                   0             0x2  (2)
.heap                       0x1ca2                   0          0x2000  (8192)

                        Total data memory used (bytes):         0x34a2  (13474) 43%

Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                        0x1ca2                              0x2000  (8192)
stack                       0x3ca2                              0x435e  (17246)

                        Maximum dynamic memory (bytes):         0x635e  (25438)
Powered by LifeType - Design by BalearWeb and Jason Tribbeck
Copyright © 2010 | | Jason Tribbeck
All trademarks are the property of their respective owners