954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sequencer

hi there im having some problems, im trying to write a simple software sequencer in visual C++ under windows. I have a few problems my first two menus open up fine but the third wont open it just loops on the title menu. The second probelm i have is that all the sections dont play together any help would be great cheers ontrix code attached

Attachments code.txt (24.52KB)
ontrix
Newbie Poster
6 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

You really need to discover the magic of
a) indentation
b) functions.

A 800+ lines of code in main(), c'mon be serious.
Nobody is going to wade through that lot just to spot what might be wrong.

A rough rule of thumb - if you can't see the entire function on screen at the same time (from it's opening brace to it's closing brace), then it's probably too big to manage.

I bet all those header files have code inside them as well right?

How about a separate function for each top-level menu choice.

>> snipped from the code...

float edit_instrument1[5]; //edit the instrument for a note
  Instrmnt *instrument1 = 0; // This variable will hold the instrument information
  // snip
  float edit_instrument2[5]; //edit the instrument for a note
  Instrmnt *instrument2 = 0; // This variable will hold the instrument information

Why isn't this screaming at you to be
a) a struct containing several things
b) an array of that struct.
That would cut down significantly on the number of variables you have.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You