TinyTracker

Advice on general approaches or feasibility and discussions about game design

Re: TinyTracker

Postby Sorunome » Fri Sep 04, 2015 9:53 pm

Just noticed I didn't drop by a comment yet, this is sure looking awesome!
I especially like that you will be able to use the songs in over games :)
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: TinyTracker

Postby jonnection » Sat Sep 05, 2015 4:24 am

@Jamish @Sorunome:

Thanks for the comments

Truth be told, the sounds are still "all over the place" because I have just gotten the core code to work. In order to start making some kind of music, I need to improve the usability of the controls (namely pitch bending, volume envelope & arpeggios). That video is just proof of concept - but it sure hurts the ears ;-)

This project is taking a long time because there is just so much to code. The user interface, 3x4 pixel font, keyboard handler that understands arrow keys with ABC modifiers, file I/O, excel-like table routine...

One of the big challenges is that the program is reading the module data from the SD card on the fly. Its a bit complicated to implement, and getting rid of lag is very important. But if all goes well, and I get this thing working like it should, putting music in a game (on easiest level) will mean putting a module file on the SD along with your game hex and that's it.

I will release a testable version as soon as I get note effects and file I/O to work reliably
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby erico » Sat Sep 05, 2015 1:07 pm

Some of those instruments reminds me of mooncresta hehe.

Go Jonne GO GO!
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: TinyTracker

Postby jonnection » Sun Sep 06, 2015 7:31 am

Ok so I was talking about "improving the control" of the effects.

What did I mean by that ? Here's a sample of what I mean.

You can now choose a key (here, C-major).

Arpeggio will now automagically calculate the correct chords to play in the arpeggio.

What this means that in order to sound "correct", the triad chords for a major scale are (I, ii, iii, IV, V, vi, viio)

In essence, if you play a C in C major scale, you get a C major triad arpeggio. However, if you play a D (chord 2) you get a D minor chord. And when you play chord 7, you get a diminished.

Enjoy !

User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby jonnection » Mon Sep 07, 2015 10:41 am

Oh crap. Here we go again. Every time I try to do something I run into the 30kB barrier. And no, the SD card or external RAM doesn't help, because you can't run code from them.

Code: Select all
Device: atmega328p
Program:   30646 bytes (93.5% Full)
(.text + .data + .bootloader)
Data:       1783 bytes (87.1% Full)
(.data + .bss + .noinit)


This might actually kill the whole project, because I still have so many features missing and I can't think of any place to cut code.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby mougino » Mon Sep 07, 2015 10:55 am

Hmm,a custom 3x4 pixel font might take a lot of additional place in PROGMEM. Have you considered replacing the default 3x5 font if you don't use it anymore ?
User avatar
mougino
 
Posts: 75
Joined: Sat Jul 25, 2015 8:15 am
Location: Paris, France

Re: TinyTracker

Postby jonnection » Mon Sep 07, 2015 11:57 am

I took a proper look at where the program memory goes. This is excluding initialized data (i.e. its code functions only).

I come yet again to the conclusion, that a Gamebuino game must be so simple, that hardly any menus are needed. Menus and views chomp memory like crazy and there is nothing you can do about it. My long term target is to get rid of ALL Arduino derived code, but it won't help so much.

Game menus 12662
Sound code 3718
PetitFS 3570
GFX functions 2890
LCD & Buttons 1294
LibC 1284
Arduino Print 928
Arduino pin IO 624
File I/O 218
---------------------------
tot 27188

This is what the whole crap-a-doodle looks like, sorted from largest to smallest:
Code: Select all
3782   build\utracker\rboy\Game\Game.o   Game::instrHandler()
3016   build\utracker\rboy\Game\Game.o   Game::instrumentview()
1676   build\utracker\rboy\Game\Game.o   Game::editorHandler()
1362   build\utracker\rboy\Game\Game.o   Game::patternview()
888   build\utracker\rboy\Synth\Synth_mixfuncs.o   updateEnvelopes()
650   build\utracker\rboy\Game\Game.o   Game::drawPopUp(unsigned
606   build\utracker\rboy\Game\Game.o   Game::bstateHandler()
566   build\utracker\petit_fatfs\pff.o   pf_mount(_FATFS_*)
550   build\utracker\rboy\rboy\Rboy.o   Rboy::draw_column(signed
546   build\utracker\petit_fatfs\pff.o   pf_lseek(unsigned
516      malloc
472   build\utracker\rboy\rboy\Rboy.o   Rboy::clipLine(int*,
464   build\utracker\rboy\rboy\Rboy_print.o   Rboy::outputWord()
442   build\utracker\rboy\Game\Game.o   Game::mainMenu(unsigned
432   build\utracker\rboy\rboy\Rboy.o   Rboy::draw_line(int,
426   build\utracker\rboy\Game\Game.o   Game::optionsMenu(unsigned
396   build\utracker\rboy\Synth\Synth_oscfuncs.o   setOSC(OSC*,
382   build\utracker\petit_fatfs\mmc.o   disk_initialize()
366   build\utracker\petit_fatfs\mmc.o   disk_readp(void*,
342   build\utracker\petit_fatfs\pff.o   0
332   build\utracker\rboy\rboy\Rboy_sound.o   __vector_11
326   build\utracker\rboy\rboy\Rboy.o   Rboy::draw_rect(signed
296   build\utracker\rboy\Synth\Synth_oscfuncs.o   emptyOscillators()
292   build\utracker\rboy\rboy\Rboy.o   Rboy::draw_row(signed
292   build\utracker\rboy\rboy\Rboy_HW.o   initDisplay()
282   build\utracker\petit_fatfs\pff.o   0
262   build\utracker\rboy\rboy\Rboy.o   Rboy::sp(unsigned
240   build\utracker\rboy\rboy\Rboy.o   Rboy::fill(unsigned
228   build\utracker\petit_fatfs\mmc.o   0
226   build\utracker\rboy\Game\Game.o   Game::update()
202   build\utracker\rboy\rboy\Rboy_print.o   Rboy::draw_char(unsigned
200   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::printNumber(unsigned
192   E:\gamedev\utracker\rboy\build\/core_uno_16.a(wiring_analog.c.o)   analogWrite
190   build\utracker\rboy\Synth\Synth_oscfuncs.o   testOsc()
180   build\utracker\petit_fatfs\pff.o   pf_open(char
180   build\utracker\rboy\Synth\Synth_oscfuncs.o   makeSampleInstruments()
178   build\utracker\rboy\Synth\Synth_oscfuncs.o   playNote(unsigned
160   build\utracker\rboy\rboy\Rboy_HW.o   pollButtons()
158   build\utracker\petit_fatfs\pff.o   0
156   build\utracker\rboy\rboy\Rboy.o   Rboy::set_pixel(unsigned
154   build\utracker\petit_fatfs\pff.o   pf_opendir(_DIR_*,
152   build\utracker\rboy\Synth\Synth_mixfuncs.o   mix1()
152   build\utracker\rboy\Synth\Synth_mixfuncs.o   mix2()
152   build\utracker\rboy\Synth\Synth_mixfuncs.o   mix3()
144   E:\gamedev\utracker\rboy\build\/core_uno_16.a(wiring.c.o)   __vector_16
128   build\utracker\petit_fatfs\pff.o   0
128   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::print(long,
126   0x7e   pinMode
122   build\utracker\rboy\rboy\Rboy_HW.o   initButtons()
118   build\utracker\rboy\rboy\Rboy.o   Rboy::begin(unsigned
118      init
110   build\utracker\rboy\rboy\Rboy_HW.o   refreshDisplay(unsigned
102   E:\gamedev\utracker\rboy\build\/core_uno_16.a(wiring_digital.c.o)   digitalWrite
98   0x62   setup
96   build\utracker\rboy\rboy\Rboy_HW.o   gotoXY(int,
96   E:\gamedev\utracker\rboy\build\/core_uno_16.a(wiring_digital.c.o)   digitalRead
92   build\utracker\rboy\rboy\Rboy_HW.o   initSound()
92   build\utracker\rboy\Synth\Synth_envfuncs.o   releaseFunc(OSC*)
90   build\utracker\petit_fatfs\petit_fatfs.o   PFF::begin(int,
90   E:\gamedev\utracker\rboy\build\/core_uno_16.a(wiring_digital.c.o)   0
86   build\utracker\rboy\FileIO\FileIO_HW.o   fileOpen(char*,
86   build\utracker\rboy\Game\Game.o   Game::setup()
84   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::write(unsigned
76   build\utracker\rboy\Game\Menu.o   Menu::getString(char*,
70   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::print(__FlashStringHelper
68      __udivmodsi4
66   build\utracker\rboy\Synth\Synth.o   0
64   build\utracker\rboy\Synth\Synth_helpers.o   xorshift16()
64   build\utracker\rboy\Synth\Synth_wavefuncs.o   noise(OSC*)
64   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println()
62   build\utracker\rboy\rboy\Rboy_print.o   Rboy::write(unsigned
62   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println(int,
62      __mulsi3
60   build\utracker\rboy\rboy\Rboy_print.o   getRspace(unsigned
60   build\utracker\rboy\Synth\Synth_envfuncs.o   attackFunc(OSC*)
60   build\utracker\rboy\Synth\Synth_songfuncs.o   emptyPatches()
60   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println(unsigned
58   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println(unsigned
56   0x38   
56   build\utracker\rboy\Game\Game.o   Game::printhex(unsigned
56   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::write(char
54   build\utracker\rboy\Game\Game.o   Game::saveChunk(unsigned
54   build\utracker\rboy\Game\Game.o   Game::loadChunk(unsigned
54   build\utracker\rboy\rboy\Rboy_HW.o   LcdWrite(unsigned
54   build\utracker\rboy\Synth\Synth_songfuncs.o   emptyPatterns()
50   build\utracker\petit_fatfs\petit_fatfs.o   PFF::open_dir(char*)
50   build\utracker\rboy\Game\Game.o   Game::poll()
48   build\utracker\rboy\rboy\Rboy_HW.o   fillDisplay(unsigned
46   build\utracker\rboy\Synth\Synth_envfuncs.o   decayFunc(OSC*)
42   build\utracker\rboy\Game\Game.o   Game::print1hex(unsigned
42   build\utracker\rboy\rboy.o   
42   build\utracker\rboy\rboy\Rboy.o   Rboy::refresh()
40   build\utracker\rboy\Synth\Synth_helpers.o   xorshift8()
40   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println(__FlashStringHelper
40      __udivmodhi4
38   build\utracker\rboy\FileIO\FileIO_HW.o   isThisFileOpen(char*)
38   build\utracker\rboy\rboy\Rboy_HW.o   my_spi_init()
38   build\utracker\rboy\Synth\Synth_songfuncs.o   openSongFromSD(char*)
38   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::print(int,
38   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::println(char
38      __divmodhi4
36   build\utracker\rboy\rboy\Rboy_HW.o   bitswap(unsigned
36   build\utracker\rboy\Synth\Synth_helpers.o   getNoteString(char*,
34   build\utracker\petit_fatfs\mmc.o   disk_attach_spi_functs(void
34   build\utracker\rboy\rboy\Rboy_print.o   getLspace(unsigned
34   build\utracker\rboy\Synth\Synth_wavefuncs.o   tonenoise(OSC*)
30   build\utracker\rboy\Game\Menu.o   Menu::selectNext()
30      main
30   E:\gamedev\utracker\rboy\build\/core_uno_16.a(Print.cpp.o)   Print::print(unsigned
26   build\utracker\rboy\Synth\Synth_songfuncs.o   writePatchToSD(unsigned
26   build\utracker\rboy\Synth\Synth_songfuncs.o   readPatchFromSD(unsigned
26   build\utracker\rboy\Synth\Synth_wavefuncs.o   sqwave(OSC*)
26   0x1a   __divmodqi4
24   build\utracker\rboy\Synth\Synth_wavefuncs.o   triwave(OSC*)
24      __udivmodqi4
22   build\utracker\petit_fatfs\petit_fatfs.o   PFF::PFF()
22   build\utracker\rboy\FileIO\FileIO_HW.o   fileClose()
22   build\utracker\rboy\FileIO\FileIO_HW.o   fileRewind()
20   build\utracker\rboy\rboy\Rboy_HW.o   rightReleased()
20   build\utracker\rboy\rboy\Rboy_HW.o   aReleased()
20   build\utracker\rboy\rboy\Rboy_HW.o   bReleased()
20   build\utracker\rboy\rboy\Rboy_HW.o   cReleased()
18      strcmp
18   build\utracker\rboy\FileIO\FileIO_HW.o   rxsb()
18   build\utracker\rboy\rboy\Rboy_HW.o   leftReleased()
18   build\utracker\rboy\rboy\Rboy_HW.o   cBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   bBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   aBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   downBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   upBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   rightBtn()
18   build\utracker\rboy\rboy\Rboy_HW.o   leftBtn()
16   build\utracker\rboy\Game\Menu.o   Menu::selectPrev()
16   build\utracker\rboy\rboy\Rboy_print.o   Rboy::set_cursor(int,
16   build\utracker\rboy\Synth\Synth_wavefuncs.o   sawwave(OSC*)
14      strcpy_P
14      memset
14      strcpy
14   build\utracker\rboy\FileIO\FileIO_HW.o   fileSeekAbsolute(long)
14   build\utracker\rboy\FileIO\FileIO_HW.o   txsb(unsigned
14   build\utracker\rboy\rboy\Rboy_HW.o   downReleased()
12   build\utracker\petit_fatfs\petit_fatfs.o   PFF::MMC_DESELECT()
12   build\utracker\petit_fatfs\petit_fatfs.o   PFF::MMC_SELECT()
12   build\utracker\rboy\Game\Menu.o   Menu::Menu(char*,
12      __tablejump__
10   build\utracker\petit_fatfs\petit_fatfs.o   0
10      loop
10   build\utracker\rboy\Synth\Synth_songfuncs.o   writeChunkToSD(unsigned
10   build\utracker\rboy\Synth\Synth_songfuncs.o   readChunkFromSD(unsigned
8   build\utracker\petit_fatfs\petit_fatfs.o   PFF::open_file(char*)
8   build\utracker\rboy\rboy\Rboy_HW.o   upReleased()
8   build\utracker\rboy\Synth\Synth_wavefuncs.o   waveoff(OSC*)
2   build\utracker\rboy\FileIO\FileIO_HW.o   fileWriteBytes(unsigned
2   build\utracker\rboy\FileIO\FileIO_HW.o   fileReadBytes(unsigned
2   build\utracker\rboy\Synth\Synth_envfuncs.o   noADSR(OSC*)
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby jonnection » Mon Sep 07, 2015 12:33 pm

mougino wrote:Hmm,a custom 3x4 pixel font might take a lot of additional place in PROGMEM. Have you considered replacing the default 3x5 font if you don't use it anymore ?


Actually, I don't use any Gamebuino library code at all. I had my own lib written before I got involved with Gamebuino.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby jonnection » Mon Sep 07, 2015 12:51 pm

Quick analysis reveals a whopping 1247 bytes I could slim down.

Thats not going to be enough for:
- note effects
- sound pattern sequence editor
- saving/loading music files to save slots on the SD

... I would need about 10k for that.

Now I will really stop to think whether I want to go through with optimizing for size, bit by bit.

Maybe I will have to do all functions using A+B+C+arrow key "combos" in the pattern editor, instead of menus. It won't be as user friendly but cant really think how to do it otherwise. Users will just have to "consult the manual" and learn the keyboard combos.

And this is not because I write bloated code. 30 k is just not a lot for a tracker.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: TinyTracker

Postby jonnection » Mon Sep 07, 2015 4:17 pm

Crunched code down to 26600 Kb

Arpeggio on real hardware

User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

PreviousNext

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 107 guests

cron