I'm new to Processing, have a little project in mind, and don't know where to start. I'm currently reading a book to learn the language, so coming chapters may help me, but for now I just learned to draw rectangles (yay!).
I have a text file with a list of keywords on each line. What I need is: read the file, each X seconds, line after line, and display things or play sounds according to the keywords contained on each line. Then go to the next line.
For instance, the file would look like this:
1 piano
2 piano
3 piano cymbal
4 cymbal guitar
5 guitar organ
…
The program would read the file and react accordingly. The first second, the picture of the piano will be displayed, and the sound of the piano will be heard. The second second will be the same. The third second is the same plus the picture and the sound of the cymbal. And so on. That's a musical sequencer!
(The ‘score’ file will actually be an adaptation of
the Doctor Who timeline, the idea being to generate a piece of music from the characters coming and leaving the series' storyline. Each Doctor, each companion and each foe will be associated to one unique sound. The ‘piano’, ’cymbal’ and ‘guitars’ keywords are just place-holders.)
I guess the program would work something like this:
EVERY X SECOND:
Hide everything.
Read line # (previous line + 1).
Display line #.
If the line contains ‘piano’: display picture ‘piano’ and read sound ‘piano’.
If the line contains ‘cymbal’: display picture ‘cymbal’ and read sound ‘cymbal’.
If the line contains ‘guitar’: display picture ‘guitar’ and read sound ‘guitar’.
…
That's it. Do you have some advices before I dive into it? What should I know about reading (specific lines of) files and playing sounds?