Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: VDJ script tools - Page: 2

This topic is old and might contain outdated or incorrect information.

The sample they give for back ticks using get_text is:

get text 'You are listening to `get loaded_song "title" ` at `volume` volume

Appears to be 2 problems with that. I guess they mean get_text and there is no closing single quote which should be after the last volume word in my eyes. This sample probably does not work since at least they are using get<space>text. That might work by itself if get_text was used and the end of script also ends the first single quote but if someone copies that and decides to do:

get_text 'You are listening to `get loaded_song "title" ` at `volume` volume & get_text 'something else'

then it is probably undefined unless & also ends the first single quote.

The other sample they give is this where they use a single back tick in front of play. .

set 'varname' ' `play'

Maybe some kind of rule that says you can use a single back tick if fully enclosed and the quote nesting level has ended.

My question was will { set 'varname' ' `play` ' } with back ticks before and after play, work the same as the above with a single back tick?

I added some spaces to separate back ticks so you could see them a little better.

 

Posted Mon 23 Jul 18 @ 9:47 am
I updated the site and think I have the back tick nesting correct now but let me know if you see a problem.
 

Posted Mon 23 Jul 18 @ 2:10 pm
Some information that will lead up to why tools are so very important for anyone trying to tell a computer (or another program) what to do.

The word 'computer' goes way back and comes from the word compute meaning to calculate. Today we simply define the word computer to mean a programmable logic device that has inputs and outputs and some kind of memory for storage and execution. That is essentially it. When we say computer normally we think of our desktop or laptop but computers are used in all kinds of devices today like microwaves and other appliances, your phones, your controllers, etc.

Early computers were programmed by plugging wires into different slots. That did not last long and someone developed a circuit that could interpret a set of numbers that were instructions to the computer telling it what to do. This is called a program. A computer cannot do anything without a program. Well then when you turn on your computer, how does the computer start executing a program? You may have heard the phrase, "pull oneself up by one's bootstraps". The origin of this is from the 19th century. There are variations of it but it means you might be able to do something impossible like, get over a fence by pulling yourself up by your own bootstraps. Since a computer cannot do anything without a program, when you start your computer, there is a special circuit that force feeds the CPU with a program that gets it kick started. We call this boot or reboot and that comes from the word bootstrap.
 

Posted Tue 24 Jul 18 @ 7:42 pm
So early on, they now have some circuit that can execute instructions represented by numbers. We use the term byte to represent the smallest addressable unit. Typically a byte is 8 binary digits (bits for short) but can be some other value. I have seen 9 and 256 bits used for a byte. Just up to a given device. I will be using 8 bits per byte.

Binary means each bit has 2 possible values 0 or 1. With decimal each bit would have 10 possible values 0 thru 9. Binary is used for computers because it is easier to design electronic circuits that have only 2 states like on and off.

An 8 bit byte can contain the numbers 0 thru 255 or a total of 256 values. All data and instructions in a computer are represented by one or more bytes. Everything you see on a display is represented internally by some sequence of bytes.

Let's say we have some number that is decimal 170.

In binary that is 10101010

Oh joy, lets go stark raving mad and try to program a computer using only binary numbers. You can see how you could get easily lost.

10101010 01000110 11110000 00001000
00101111 10010000 01100100 11010010


They faced this kind of a problem early on. They had something that could take a set of numbers but now from the human side they needed to come up with a way to organize those numbers into something that was easier to read and represent what they were trying to do.

Using decimal numbers for the above binary does not help much. You could use hexadecimal to help just a little bit more. Hexadecimal is base 16. Each hexadecimal digit can have 16 possible values 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Well guess what? Each hexadecimal digit (hex for short) represents exactly 4 bits so it is a better way to view binary bytes. So in hex our program now looks like this.

AA 76 F0 08
2F 90 64 D2


Well your still going to end up a basket case looking at that kind of stuff. Occasionally, I still have to sift thru hex numbers trying to figure out what some code is trying to do which might explain some of the craziness within most programmers.

So they decided to represent those numbers using a natural language like English. Initially (and still today) the words and numbers used exactly represented the instructions and data that the computer knows about. This is called assembler or asm for short. So let's say we need a program that can compute c = a + b. With asm it might be:

mov R1,a
add R1,b
sto c, R1


Well this is better than numbers and people still code in asm everyday but you might say still greek to me.

We really just want to write our program by saying:

c = a + b

This was the next step and COBOL was one of the first main stream high level languages developed for computers. Credit is given to Grace Hopper and she is called the mother of COBOL. I had the unique chance to go to a speech she was giving at the school I was attending. She was 72 years old and the oldest captain in the US navy. She had been recalled out of retirement because she was so valuable. I was pretty much dumb struct after the speech. She was so sharp and so up to date on all the micro processors of the day I walked out thinking there are no real limits on what can be done.

High level languages use what is called a compiler. The compiler takes the English like statements and converts it to something the computer can understand. It also does a lot of syntax checking. 'syntax' is essentially the rules for a particular languages. Most of the bugs that a programmer will introduce are syntax errors. An end user will usually never have to deal with this because a program normally cannot be produced that has syntax errors in it. In other words the compiler will complain and stop it's compilation if you have syntax errors in your program. These are typically very easy to fix though. Mostly misspelling or something out of place etc. The compiler usually also provides a lot more than just syntax checking as well.

 

Posted Tue 24 Jul 18 @ 10:12 pm


(Old topics and forums are automatically closed)