Do you want to replace all the hyphens with a number? In that case you can look at the Replace function. Otherwise, you'll need to use the InStr and Mid functions...
Can you give us a sample string?
Has someone helped you? Then you can Rate their helpful post.
Start with a line of "-", then:
String = Replace(String, "--", "-" & Number)
You could also start with an empty string, then:
String = String & "-" & Number
This doesn't limit the number of numbers to the length of the "-" string.
Then put it in a loop that fetches the next number every time it loops until you're out of numbers.
I think whatever you end up with, you shoud start off with something that you will be able to print out. You are going to have to decide how many tabs will go accross one page, whether you are going to include any other staffs for melody or bass/drums?
That's why I suggest that you start with a rich text box. You could even design a sheet in Word, including the staffs, measure, chord tabs, you name it. Just save it as an RTF file. Then you can load it into the program, and use the program to print over the RTF file.
You're going to have to come up with a way to identify each string position in each tab. What I did in my rtb was to place [1] - [45] in the positions that I wanted to place my data, and then used find and replace to replace them with values from my program.
You might even want to scan something in for starters.
That is a good idea for the music sheet, but I think I just need to know how to replace the hyphons with numbers(which i know now) and how to do that in different lines. The rest I can handle because, and no offense to you, I probably know a bit more on guitars than you might. I don't mean to sound cocky, and you may know more.
Well, i thought you were doing sheet music. if you just want a few tabs on a form, and you don't care about printing them, then go with whatever works. When you open the project it wil talk to your printer, and scale the width of the screen to half of the printer's page width. You don't have to use it, though.
btw - I've had a Roland GR-70 MIDI guitar that I loan out. I play keyboards.
MIDI allows the sequencer to print out whatever you play.
Last edited by dglienna; Apr 8th, 2005 at 06:17 PM.
A print part of it would be nice. I am doing sheet music but I was just talkin about the other bass and melody. This is mainly for guitar tabbing. Right now I'm trying to figure out how to take a blank tab and have it so the user can place chords and power chords and all that good stuff inside the blank tab. Any suggestions?
Make an array of strings, one element for each (guitar)string.
Then use the index to pick the right line:
Dim GuitarString(1-6) As String
DoSomethingWith (String(1))
I know computerstrings but not guitarstrings.
How do these tabs work?
Each line represents a guitarstring?
Going from left to right represents time?
What do the numbers on the line represent? Where you put your finger on the neck when you strike the string?
If I put a tab on one string, can I still put a tab above it on another string? (as in A)
Or should I puta "--" on the other strings and put the tab for the other string a step to the right? (as in B)
In that case it would be better to start with empty strings and build them up as you add tabs.
You would append the tab to the proper string and "--" to the others, then do the next tab.
How do you obtain the tabdata?
Is it written on disk?
Code:
A B
-1-------- -1--------
-2-------- ---2------
-3-------- -----3----
---------- ----------
---------- ----------
---------- ----------
Tabs a very simple. The six lines of hyphons represent each string on the guitar. the top line is the top string on the guitar, the bottom is the bottom. The numbers represents where you place your fingers on the fret board. ---5--- would be the fifth fret from the right end if you're facing the guitar.
When you made that code, jeroen, did you use the arrays and a (vb) string for each of the (guitar) strings? This is what I'm trying to do but I'm not sure how to put the data into the text box.
Ok no one wants to seem to help me. I'm fine with that I wouldn't want to deal with me either. I'm going to give up on this project for now and try to build my way up to it with simpler things.
thanks for your help jeroen, but alot of this stuff is really too complicated for me. I just need something so that I can do this. I already have command buttons and text boxes, so it isnt much help when you have to create other ones.
Here is my form, you can take a look at it, all I need is a way to put in numbers in the hyphon lines. I need the numbers to be put anywhere in the hyphon line with it being a number of the user's choice.
I wouldn't know where to begin to help, as I'm not a guitarist, but know a great deal about music. I've suggestied a few things that I thought would help. This has to be done the way that you want it. You haven't said if everything is one neck of the guitar, or a lot of tabs next to each other.
Hey Nick -
Don't give up on this; it is an interesting project! I play(ed) guitar and I am familiar with tabs (although at this point I'm chained to my desk coding while my son and his buddies have their way with my instruments
I was looking at your form and then I pulled out an old music book ("The Best of AC/DC" to be exact) and started thinking about this ...
Here's an idea: rather than use a multi-line textbox for the user interface, consider a grid (MSFlexGrid). You could dimension the grid as 6 rows by however many columns, where the rows represent the guitar strings. When the user clicks in the cell of the grid, they could enter the fret number; or if they right-click, a popup menu with various options could appear (enter barre chord "A", etc.)
You could actually have a control array of such grids so you could fit six or so of these on a form. You could have "back" and "next" buttons so that the user can move forward to continue entering the tab for the song, or move back to review what has already been entered.
When the user is done, you could save their entries to a text file like you were speaking of. You could have an option to load back in a previously saved file.
Boy, this is turning into a major project, isn't it? And I know you are new to VB so that makes it even more challenging. I would encourage you keep this project alive (even if just on the back burner) and work on it over time. If I get the time (which unfortunately is tight) I'll try to whip up some kind of example.
I guess that's a good idea. But all I know how to do is command push buttons and x.visible = true lol. It'll be tough seeing how I have no clue what a flex grid is. But i'll give it a shot I probably have much more time on my hands than you do.
I understand where you're coming from, and working up the solution I suggested is not a trivial matter. As I suggested, keep it on the back burner; meanwhile I'll see what I can do.
FYI, many controls beyond what you find in the regular VB toolbox (including the FlexGrid) are accessed through Project -> Components - you check off the desired control and once you click OK, that control will be added to your toolbox. (Note - you have to know what you are looking for, because a lot of junk not usable by VB may also appear in that Components list.) The FlexGrid appears as "Microsoft FlexGrid Control 6.0 (SP3)".