PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Dependents: YATTT sd_map_test cPong SnowDemo ... more
PokittoLib
Library for programming Pokitto hardware
How to Use
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
POKITTO_LIBS/Synth/Synth_song.h@28:958b71c4b92a, 2018-01-05 (annotated)
- Committer:
- Pokitto
- Date:
- Fri Jan 05 02:19:51 2018 +0000
- Revision:
- 28:958b71c4b92a
- Parent:
- 0:e8b8f36b4505
Sound level stored in EEPROM, sound output improved
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pokitto | 0:e8b8f36b4505 | 1 | /**************************************************************************/ |
Pokitto | 0:e8b8f36b4505 | 2 | /*! |
Pokitto | 0:e8b8f36b4505 | 3 | @file Synth_song.h |
Pokitto | 0:e8b8f36b4505 | 4 | @author Jonne Valola |
Pokitto | 0:e8b8f36b4505 | 5 | |
Pokitto | 0:e8b8f36b4505 | 6 | @section LICENSE |
Pokitto | 0:e8b8f36b4505 | 7 | |
Pokitto | 0:e8b8f36b4505 | 8 | Pokitto development stage library |
Pokitto | 0:e8b8f36b4505 | 9 | Software License Agreement |
Pokitto | 0:e8b8f36b4505 | 10 | |
Pokitto | 0:e8b8f36b4505 | 11 | Copyright (c) 2015, Jonne Valola ("Author") |
Pokitto | 0:e8b8f36b4505 | 12 | All rights reserved. |
Pokitto | 0:e8b8f36b4505 | 13 | |
Pokitto | 0:e8b8f36b4505 | 14 | This library is intended solely for the purpose of Pokitto development. |
Pokitto | 0:e8b8f36b4505 | 15 | |
Pokitto | 0:e8b8f36b4505 | 16 | Redistribution and use in source and binary forms, with or without |
Pokitto | 0:e8b8f36b4505 | 17 | modification requires written permission from Author. |
Pokitto | 0:e8b8f36b4505 | 18 | */ |
Pokitto | 0:e8b8f36b4505 | 19 | /**************************************************************************/ |
Pokitto | 0:e8b8f36b4505 | 20 | |
Pokitto | 0:e8b8f36b4505 | 21 | #ifndef SYNTH_SONG_H |
Pokitto | 0:e8b8f36b4505 | 22 | #define SYNTH_SONG_H |
Pokitto | 0:e8b8f36b4505 | 23 | |
Pokitto | 0:e8b8f36b4505 | 24 | #define CHUNKSIZE 8*3*2 // 48 bytes |
Pokitto | 0:e8b8f36b4505 | 25 | //extern uint8_t chunk1[], chunk2[]; |
Pokitto | 0:e8b8f36b4505 | 26 | extern uint8_t chunk[2][CHUNKSIZE]; |
Pokitto | 0:e8b8f36b4505 | 27 | extern uint8_t cc; // current chunk |
Pokitto | 0:e8b8f36b4505 | 28 | |
Pokitto | 0:e8b8f36b4505 | 29 | struct SONG { |
Pokitto | 0:e8b8f36b4505 | 30 | byte rb_version; // rbtracker version with which the song was created |
Pokitto | 0:e8b8f36b4505 | 31 | uint16_t song_bpm; // song beats per minute |
Pokitto | 0:e8b8f36b4505 | 32 | byte num_patches; // how many different instruments ie patches |
Pokitto | 0:e8b8f36b4505 | 33 | byte num_channels; // how many channels are used by this song (1-3) |
Pokitto | 0:e8b8f36b4505 | 34 | byte num_patterns; // how many different patterns are used |
Pokitto | 0:e8b8f36b4505 | 35 | byte song_end; // at what position song ends |
Pokitto | 0:e8b8f36b4505 | 36 | int8_t song_loop; // where to loop at end of song. -1 means no loop |
Pokitto | 0:e8b8f36b4505 | 37 | byte block_sequence[3][10]; //the sequence of blocks for each track |
Pokitto | 0:e8b8f36b4505 | 38 | const uint8_t * instrument_stream[3]; //pointers to the instruments in the track streams |
Pokitto | 0:e8b8f36b4505 | 39 | const uint8_t * note_stream[3]; //pointers to the notes in the track streams |
Pokitto | 0:e8b8f36b4505 | 40 | }; |
Pokitto | 0:e8b8f36b4505 | 41 | |
Pokitto | 0:e8b8f36b4505 | 42 | struct BLOCK { |
Pokitto | 0:e8b8f36b4505 | 43 | uint8_t notenumber[64]; // was 64 |
Pokitto | 0:e8b8f36b4505 | 44 | uint8_t instrument[64]; // was 64 |
Pokitto | 0:e8b8f36b4505 | 45 | }; |
Pokitto | 0:e8b8f36b4505 | 46 | |
Pokitto | 0:e8b8f36b4505 | 47 | |
Pokitto | 0:e8b8f36b4505 | 48 | #endif // SYNTH_SONG_H |
Pokitto | 0:e8b8f36b4505 | 49 |