I’d like to create a calc sheet that helps me quickly write code to make computer midi tone music representations of songs or music. Here is a screen shot to reference:
------------------------------------------Simple Explanation of What I want this to do------------------------------
Using the Screen shot as a reference:
E1 has 253 entered in to it.
A10 is selected (pressed, clicked).
Script, macro, formula, whatever is needed to do this collects 665 from cell B10, collects 253 from cell E1 and types [:t665,253] in cell D5 since that’s the D cell selected and has less than 128 characters in it.
Then:
E1: 654
A7 is selected
[:t785,654] appears in cell (“line”) D5 next to the previous snippet created.
Now cell D5 has [:t665,253][:t785,654] in it.
Here is the file. It’s not as shown in the screen shot because I manually completed the song I was working on writing the code manually and cleared the D cells, I placed example code in the D cells of this file as if C5 then G5 then F5# were pressed/selected with random durations:
SongWriter.ods
==================== Details =======================
For the TTS (Tex-To-Speech) software which is DecTalk I’m trying to get this going for instead of having to manually write each character for each code snippet for each note in a line. What I’m trying to get calc to do for me would save a lot of time and manually typing each code snippet’s character.
To explain and example what I want this to do if I selected or pressed cell A5 I want it to write [:t
and the text 895
in cell B5 next to it then a comma, then the numeric value based on the value entered in cell E1 and a left square bracket to close the code snippet so the code it all creates in the D column cell is [:t895,#in_cell E1]
. Say the value entered in E1 was 37 (for example) it would type [:t895,37]
in a D cell.
Then if I entered 2345 in to cell E1 and selected cell A15 (labelled “B4”) it types another code snippet [:t495,2345]
next to it in the same D cell so that D cell now has [:t895,37][:t495,2345]
in it. I want this to keep placing the snippets in the same D “line” until all of the code snippets reach 128 characters which causes selecting more notes to be entered in to the next D cell below it.
I already have the D cells validity not allowing any more than 128 characters.
The info I need is how to make selecting a cell do this in the D cells.
I’ve written all this text to explain anything someone kind enough to help me learn how to do this’ curiosity on what it’s for, why, etc. I don’t expect anyone that reads this to also know DecTalk’s coding syntax. The way DecTalks code syntax is and the way the game I’m creating this for is is why I have the sheet designed the way it is. The design cannot change, I’m not asking for design suggestions I’m asking what I’ve plainly asked: How do I make selecting a cell type text in to another cell?
Don’t change the design of the file!!! Please.
Buttons instead of text in column A? okay! Can do. But please don’t try to add more notes, change the layout, or anything else. It’s designed the way it is for a reason that took me several full days of trial and error to design it so it works for the purpose I’m creating this for (DecTalk, a video game - both of which have limitations and other things I don’t expect anyone to know that need to be considered). Changing the layout, design, or any of it’s cosmetics will make your much appreciated effort in helping me with this unable to be used. Don’t waste either of our time ya know?
All I need to know is how to make a button or selecting a cell type the code.
----------------------------------------------Code Snippet Explained-------------------------------------------
[
opens a code snippet for DecTalk. :t
tells DecTalk to use computer midi tones instead of phonemes/phonetic speech for the sounds. The first number, 895 in the example which is the A5 note on a piano, is telling DecTalk what note to produce. The number after the comma tells DecTalk how long in milliseconds to play the sound. Then the ]
closes the code snippet.
-----------------------------------------------Columns, Etc, Explanation---------------------------------------
Column A is obviously the notes of a piano if you don’t recognize them.
- DecTalk’s midi tone range capability is numerically 1 through 5000. Below piano note F2 the tones start losing value so I didn’t collect them below that and I have yet to create cells for notes above piano note C6 because that’s all I need for the song I’m in the process of creating at the moment - Mario Brothers Theme song if you’re curious. The first line in D4 is the first measure of the song, the second line in D5 is the second measure of the song. I manually typed every character for those lines.
Column B is DecTalk’s numeric midi code value for the note in column A next to it.
Cell E1 is a numeric value text field that requires a numeric value (validity already set up and done) that I want entered after the comma that’s placed after [:t and the value it enters after that based on what the text in column B is that’s been typed when a cell in column A is selected or pressed.
Cell H1 (Rest field) is another field that I plan to set up to enter only allow a comma, period, or underscore (which is DecTalk syntax for pre-determined time periods of rest) or a numeric value. That’s something I can do after I get the advice I’m looking for as to how to get it doing the above.
The rows that are column D5 through D45 are the text fields for the code, where I want the text produced by what’s selected and entered to be placed. This is for a video game that uses DecTalk TTS. The game chat is where the code for TTS is entered and it only allows 128 characters per message.
Column K is counting the characters in each D column cell/row/line. I have the D column row cells setup to produce an error prompt if there are more than 128 characters.
---------------------------------------------------Additional info / Details-------------------------------------------
I don’t have an issue with having to select a new D column row to start a new line of code when the character limit is reached in the cell above it but if that can also be automated that would be a nice feature to have as well.
Each time I select or press a cell in Column A I want it to enter the [:t#,#####]
code snippet next to the previous one in the same D column row until the 128 character limit is reached.
I have more I want this to do that causes me to learn the really cool stuff Calc can to that I can use for other purposes in the future but I want to get this part of it figured out first.
Is this possible to do with calc? I wanted to try it with calc before venturing in to doing it with VB or Flash, JS, or C#. I believe IF functions might do it? I’m going to play around with IF statements and whatever else I can think of that might do it in the mean time until this gets a reply with suggestions.
Thanks in advance! I have confidence in the members of this community that if it’s possible to do someone knows how to do it.