This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,034 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ToneMatrix changelog: | ||
|
||
0.9: | ||
- Added save song and load song functions | ||
- Changed from 12 grids to 16 grids | ||
- Removed "Quit" and "Stop playing" menu options | ||
|
||
0.8: | ||
- Added 12 grid sequencer | ||
- Added loop all function | ||
- Added cut, copy, and paste functions | ||
|
||
0.7: | ||
- Added mute row function | ||
- Added solo row function | ||
|
||
0.6: | ||
- Fixed "trail" bug | ||
|
||
0.5: | ||
- Initial release | ||
- Clear grid, tempo, and stop functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
ToneMatrix is a 16-step drum machine. The Y (vertical) axis | ||
represents eight different sounds, and more than one can be | ||
played at a time. The X (horizontal) axis represents one | ||
4/4 measure in sixteenth-notes. | ||
|
||
Select a node on the grid with the D-pad and the X button, | ||
and that sound will be played in time. Press O to stop/ | ||
resume playing. Press [] (square) to mute the row the cursor | ||
is on. Press /\ (triangle) to mute every row except the | ||
row the cursor is on. You can mute more than one row at | ||
once. | ||
|
||
Press START to use the menu, and use the D-pad to select a | ||
menu item or change a value (like the tempo), and X (cross) | ||
to confirm your choice. Press SELECT for help. | ||
|
||
You can play up to twelve measures in a row by using the R | ||
and L triggers, or by switching the "grid" value in the | ||
START mneu. If "loop all" is on, then the measures will | ||
play one after another. If it is off, it will only repeat | ||
one measure. It is recommended that you stop playback | ||
before editing another grid. | ||
|
||
To install: | ||
If you have custom firmware or a homebrew-enabled PSP, | ||
place the "unsigned" folder into the /PSP/GAME folder on | ||
your Memory Stick. If you have official firmware on your PSP | ||
(or if you have a PSPgo), place the "signed" folder into the | ||
/PSP/GAME folder on your Memory Stick. | ||
|
||
- | ||
|
||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License as | ||
published by the Free Software Foundation; either version 2 of | ||
the License, or (at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be | ||
useful, but WITHOUT ANY WARRANTY; without even the implied | ||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
PURPOSE. See the GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public | ||
License along with this program; if not, visit | ||
http://www.gnu.org/licenses/gpl-2.0.txt | ||
|
||
If you want to redistribute any modifications you make to | ||
the program, please credit yourself in the modified source | ||
file(s) under my name as, | ||
"Copyright (c) <year> <your name here>" | ||
|
||
Feel free to contact me at [email protected] if you have any | ||
questions or concerns. Thanks for playing :) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ToneMatrix will only load songs if the file name is one of the following: | ||
|
||
song0.tms | ||
song1.tms | ||
song2.tms | ||
song3.tms | ||
song4.tms | ||
song5.tms | ||
song6.tms | ||
song7.tms | ||
song8.tms | ||
song9.tms | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
TARGET = tm | ||
OBJS = main.o draw.o file.o menu.o misc.o sound.o | ||
|
||
CFLAGS = -G4 -Wall -O2 | ||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti | ||
ASFLAGS = $(CFLAGS) | ||
|
||
BUILD_PRX = 1 | ||
|
||
LIBS = -losl -lc -ljpeg -lpng -lz -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpsphprm -lpspaudiolib -lpspaudio -lm | ||
|
||
EXTRA_TARGETS = EBOOT.PBP | ||
PSP_EBOOT_TITLE = ToneMatrix 0.9 | ||
PSP_EBOOT_ICON = ICON0.PNG | ||
|
||
PSPSDK=$(shell psp-config --pspsdk-path) | ||
include $(PSPSDK)/lib/build.mak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* ToneMatrix - draw.c | ||
* Copyright (c) 2012 Tanner Babcock */ | ||
#include <oslib/oslib.h> | ||
#include "main.h" | ||
|
||
// GOLD | ||
void tmDrawGrid(void) { | ||
int x, y; | ||
oslDrawFillRect(0, 15, 480, 255, RGBA(0, 0, 0, 255)); | ||
for (x = 1; x < (MAX_X+1); x++) { | ||
for (y = 1; y < (MAX_Y+1); y++) { | ||
if (tmMuteEmpty(mute) || solo == 0) { | ||
if (data[current].grid[x-1][y-1] == OFF) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? HOFF : OFFC); | ||
else if (data[current].grid[x-1][y-1] == ON) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? HON : ONC); | ||
else if (data[current].grid[x-1][y-1] == CURSOFF) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? HOFF : OFFC); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
else if (data[current].grid[x-1][y-1] == CURSON) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? HON : ONC); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
} | ||
if (mute[y-1] && solo == 0) { | ||
if (data[current].grid[x-1][y-1] == OFF) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? MHOFF : MOFF); | ||
else if (data[current].grid[x-1][y-1] == ON) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? MHON : MON); | ||
else if (data[current].grid[x-1][y-1] == CURSOFF) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? MHOFF : MOFF); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
else if (data[current].grid[x-1][y-1] == CURSON) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? MHON : MON); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
} | ||
|
||
if (solo == y && tmMuteEmpty(mute)) { | ||
if (data[current].grid[x-1][y-1] == OFF) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? SHOFF : SOFF); | ||
else if (data[current].grid[x-1][y-1] == ON) | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? SHON : SON); | ||
else if (data[current].grid[x-1][y-1] == CURSOFF) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? SHOFF : SOFF); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
else if (data[current].grid[x-1][y-1] == CURSON) { | ||
oslDrawFillRect(x1form, y1form, x2form, y2form, (x == col) ? SHON : SON); | ||
oslDrawImageXY(select, x1form, y1form); | ||
} | ||
} | ||
} | ||
} | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* ToneMatrix - file.c | ||
* Copyright (c) 2012 Tanner Babcock */ | ||
#include <oslib/oslib.h> | ||
#include <pspiofilemgr_stat.h> | ||
#include <stdio.h> | ||
#include <time.h> | ||
#include <unistd.h> | ||
#include "main.h" | ||
|
||
void tmFileDialog(bool save) { | ||
int x; | ||
unsigned char option = 0; | ||
bool empty[MAX_SAVE_SLOTS]; | ||
char strings[MAX_SAVE_SLOTS][50]; | ||
char mdate[MAX_SAVE_SLOTS][50]; | ||
char tmp[30]; | ||
|
||
SceIoStat a; | ||
typedef struct { | ||
int year, month, day; | ||
int minute, hour; | ||
} metadata; | ||
metadata songMeta[MAX_SAVE_SLOTS]; | ||
|
||
current = 0; | ||
for (x = 0; x < MAX_SAVE_SLOTS; x++) { | ||
bzero(tmp, sizeof(tmp)); | ||
sprintf(tmp, "songs/song%d.tms", x); | ||
sceIoGetstat(tmp, &a); | ||
songMeta[x].year = a.st_mtime.year; | ||
songMeta[x].month = a.st_mtime.month; | ||
songMeta[x].day = a.st_mtime.day; | ||
songMeta[x].minute = a.st_mtime.minute; | ||
songMeta[x].hour = a.st_mtime.hour; | ||
} | ||
// I have to make a separate struct because accessing sm->tm_mday | ||
// from the while (!osl_quit) fries the memory stick | ||
// same reason why there's a bool empty[] | ||
|
||
for (x = 0; x < MAX_SAVE_SLOTS; x++) { | ||
bzero(tmp, sizeof(tmp)); | ||
sprintf(tmp, "songs/song%d.tms", x); | ||
empty[x] = tmDoesFileExist(tmp); | ||
} | ||
while (!osl_quit) { | ||
oslStartDrawing(); | ||
oslReadKeys(); | ||
tmDrawGrid(); | ||
oslDrawFillRect(0, 0, 480, 272, RGBA(0, 0, 0, 125)); | ||
if (save) | ||
oslDrawString(10, 40, "Press X (cross) to save your song in the selected slot."); | ||
else | ||
oslDrawString(10, 40, "Press X (cross) to load a song from the selected slot."); | ||
oslDrawString(10, 50, "Press O (circle) to cancel."); | ||
for (x = 0; x < MAX_SAVE_SLOTS; x++) { | ||
bzero(strings[x], sizeof(strings[x])); | ||
bzero(tmp, sizeof(tmp)); | ||
sprintf(tmp, "song%d.tms", x); | ||
sprintf(strings[x], "%s %s", (option == x) ? "->" : " ", (empty[x]) ? "EMPTY" : tmp); | ||
sprintf(mdate[x], "%d/%d/%d %d:%d UTC", songMeta[x].month, songMeta[x].day, songMeta[x].year, songMeta[x].hour, songMeta[x].minute); | ||
oslDrawString(10, (70+(x*10)), strings[x]); | ||
if (!empty[x]) | ||
oslDrawString(200, (70+(x*10)), mdate[x]); | ||
} | ||
oslDrawString(10, 190, "Press /\\ (triangle) to delete the selected song slot."); | ||
if ((osl_keys->pressed.up) && (option > 0)) | ||
option--; | ||
if ((osl_keys->pressed.down) && (option < (MAX_SAVE_SLOTS-1))) | ||
option++; | ||
if (osl_keys->pressed.cross) { | ||
if (empty[option]) { | ||
if (save) { | ||
tmWrite(option); | ||
break; | ||
} | ||
} | ||
else { | ||
if (save) { | ||
if (tmOverwriteWarning(option)) { | ||
tmWrite(option); | ||
break; | ||
} | ||
} | ||
else { | ||
tmRead(option); | ||
break; | ||
} | ||
} | ||
} | ||
if (osl_keys->pressed.triangle) { | ||
if (!empty[option]) { | ||
if (tmDeleteWarning(option)) { | ||
bzero(tmp, sizeof(tmp)); | ||
sprintf(tmp, "songs/song%d.tms", option); | ||
remove(tmp); | ||
empty[option] = TRUE; | ||
} | ||
} | ||
} | ||
if (osl_keys->pressed.circle) | ||
break; | ||
if (osl_keys->pressed.start) | ||
break; | ||
oslEndDrawing(); | ||
oslSyncFrame(); | ||
} | ||
return; | ||
} | ||
|
||
bool tmDoesFileExist(const char *path) { | ||
FILE *in = fopen(path, "r"); | ||
if (!in) { | ||
fclose(in); | ||
return TRUE; | ||
} | ||
else { | ||
fclose(in); | ||
return FALSE; | ||
} | ||
} | ||
|
||
void tmRead(int slot) { | ||
int x, y, z; | ||
char f[25]; | ||
sprintf(f, "songs/song%d.tms", slot); | ||
FILE *in = fopen(f, "r"); | ||
for (z = 0; z < MAX_GRIDS; z++) { | ||
for (x = 0; x < MAX_X; x++) { | ||
for (y = 0; y < MAX_Y; y++) | ||
fscanf(in, "%c", &data[z].grid[x][y]); | ||
fseek(in, 4, SEEK_CUR); | ||
} | ||
fseek(in, 5, SEEK_CUR); | ||
} | ||
fclose(in); | ||
return; | ||
} | ||
|
||
void tmWrite(int slot) { | ||
int x, y, z; | ||
char f[25]; | ||
sprintf(f, "songs/song%d.tms", slot); | ||
FILE *out = fopen(f, "r"); | ||
if (out) | ||
remove(f); | ||
fclose(out); | ||
out = fopen(f, "w"); | ||
for (z = 0; z < MAX_GRIDS; z++) { | ||
for (x = 0; x < MAX_X; x++) { | ||
for (y = 0; y < MAX_Y; y++) | ||
fprintf(out, "%c", data[z].grid[x][y]); | ||
fprintf(out, "%c%c%c%c", 82, 42, 82, 22); | ||
} | ||
fprintf(out, "%c%c%c%c\a", 82, 42, 82, 22); | ||
} | ||
fclose(out); | ||
return; | ||
} |
Oops, something went wrong.