Skip to content

Commit fa43732

Browse files
committed
arpeggio down command, spectrum analyzer
1 parent c5270cf commit fa43732

15 files changed

+263
-35
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-68 Bytes
Binary file not shown.
10 Bytes
Binary file not shown.

src/config.c

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ static const struct { int type; const char *name; void *param; Uint64 mask; } co
9292
{ C_BOOL, "drag_selection_sequence", &mused.flags2, DRAG_SELECT_SEQUENCE },
9393
{ C_BOOL, "drag_selection_inst_program", &mused.flags2, DRAG_SELECT_PROGRAM },
9494
{ C_BOOL, "drag_selection_4op_program", &mused.flags2, DRAG_SELECT_4OP },
95+
{ C_BOOL, "show_old_spectrum_visualizer", &mused.flags2, SHOW_OLD_SPECTRUM_VIS },
9596
{ C_END }
9697
};
9798

src/main.c

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ void my_open_menu(const Menu *menu, const Menu *action)
224224

225225
int main(int argc, char **argv)
226226
{
227+
227228
#ifdef WIN32
228229
// Set directsound as the audio driver because SDL>=2.0.6 sets wasapi as the default
229230
// which means no audio on some systems (needs format conversion and that doesn't

src/menudefs.c

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static const Menu showmenu[] =
8888
{ 0, mainmenu, "Show oscilloscope midlines", NULL, MENU_CHECK, &mused.flags2, (void*)SHOW_OSCILLOSCOPE_MIDLINES, 0 }, //wasn't there
8989
{ 0, mainmenu, "Show \"registers\" table", NULL, MENU_CHECK, &mused.flags2, (void*)SHOW_REGISTERS_MAP, 0 }, //wasn't there
9090
{ 0, mainmenu, "Show BPM count", NULL, MENU_CHECK, &mused.flags2, (void*)SHOW_BPM, 0 }, //wasn't there
91+
{ 0, mainmenu, "Show old spectrum vis.", NULL, MENU_CHECK, &mused.flags2, (void*)SHOW_OLD_SPECTRUM_VIS, 0 }, //wasn't there
9192
{ 0, NULL, NULL }
9293
};
9394

src/midi.c

+6
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,13 @@ void midi_event(SDL_Event *e)
150150

151151
#ifdef WIN32
152152

153+
#ifdef _WIN32_WINNT
154+
#undef _WIN32_WINNT
155+
#define _WIN32_WINNT 0x500
156+
#endif
157+
153158
#include <windows.h>
159+
154160
#include <mmsystem.h>
155161

156162
static HMIDIIN hMidiIn = 0;

src/mused.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ enum
124124
DRAG_SELECT_SEQUENCE = 256,
125125
DRAG_SELECT_PROGRAM = 512,
126126
DRAG_SELECT_4OP = 1024,
127+
128+
SHOW_OLD_SPECTRUM_VIS = 2048,
127129
};
128130

129131
//#define SHOW_OSCILLOSCOPES_PATTERN_EDITOR ((Uint64)65536 << 16)
@@ -212,23 +214,32 @@ typedef struct
212214
int mix_rate, mix_buffer;
213215
int window_w, window_h;
214216
int fx_bus, fx_room_size, fx_room_vol, fx_room_dec, fx_tap, fx_axis, fx_room_ticks, fx_room_prev_x, fx_room_prev_y;
217+
215218
/*---vis---*/
219+
216220
int current_visualizer;
217221
struct
218222
{
219223
int cyd_env[MUS_MAX_CHANNELS];
220-
int spec_peak[96], spec_peak_decay[96];
224+
int spec_peak[256], spec_peak_decay[96];
221225
float prev_a;
222226
} vis;
223227

228+
float real_buffer[8192];
229+
float imaginary_buffer[8192];
230+
224231
/*---*/
232+
225233
SDL_Rect cursor_target, cursor;
234+
226235
/*----------*/
236+
227237
UndoStack undo;
228238
UndoStack redo;
229239
SHType last_snapshot;
230240
int last_snapshot_a, last_snapshot_b;
231241
bool modified;
242+
232243
/*------------*/
233244

234245
GfxSurface *wavetable_preview;

src/view.c

+10-6
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ void oscilloscope_view(GfxDomain *dest_surface, SDL_Rect *dest, const SDL_Event
16541654
{
16551655
if(mused.show_four_op_menu)
16561656
{
1657-
dest->y -= 155;
1657+
dest->y -= 145;
16581658
dest->x -= 10;
16591659
}
16601660

@@ -1713,11 +1713,11 @@ static void four_op_text(const SDL_Event *e, const SDL_Rect *area, int p, const
17131713

17141714
void inst_field(const SDL_Event *e, const SDL_Rect *area, int p, int length, char *text) //instrument name/song name
17151715
{
1716-
console_set_color(mused.console,colors[COLOR_MAIN_TEXT]);
1716+
console_set_color(mused.console, colors[COLOR_MAIN_TEXT]);
17171717
console_set_clip(mused.console, area);
17181718
console_clear(mused.console);
17191719

1720-
bevelex(domain,area, mused.slider_bevel, BEV_FIELD, BEV_F_STRETCH_ALL);
1720+
bevelex(domain, area, mused.slider_bevel, BEV_FIELD, BEV_F_STRETCH_ALL);
17211721

17221722
SDL_Rect field;
17231723
copy_rect(&field, area);
@@ -1730,9 +1730,11 @@ void inst_field(const SDL_Event *e, const SDL_Rect *area, int p, int length, cha
17301730
if (mused.edit_buffer == text && mused.focus == EDITBUFFER && mused.selected_param == p)
17311731
{
17321732
int i = my_max(0, mused.editpos - field.w / mused.console->font.w + 1), c = 0;
1733+
17331734
for (; text[i] && c < my_min(length, field.w / mused.console->font.w); ++i, ++c)
17341735
{
17351736
const SDL_Rect *r = console_write_args(mused.console, "%c", mused.editpos == i ? '½' : text[i]);
1737+
17361738
if (check_event(e, r, NULL, NULL, NULL, NULL))
17371739
{
17381740
mused.editpos = i;
@@ -1741,7 +1743,9 @@ void inst_field(const SDL_Event *e, const SDL_Rect *area, int p, int length, cha
17411743
}
17421744

17431745
if (mused.editpos == i && c <= length)
1746+
{
17441747
console_write(mused.console, "�");
1748+
}
17451749
}
17461750

17471751
else
@@ -1781,9 +1785,9 @@ void instrument_name_view(GfxDomain *dest_surface, const SDL_Rect *dest, const S
17811785
if(!(mused.show_four_op_menu) || ((mused.focus != EDIT4OP) && (mused.focus != EDITPROG4OP)))
17821786
{
17831787
SDL_Rect farea, larea, tarea;
1784-
copy_rect(&farea,dest);
1785-
copy_rect(&larea,dest);
1786-
copy_rect(&tarea,dest);
1788+
copy_rect(&farea, dest);
1789+
copy_rect(&larea, dest);
1790+
copy_rect(&tarea, dest);
17871791

17881792
farea.w = 2 * mused.console->font.w + 2 + 16;
17891793

0 commit comments

Comments
 (0)