Shop OBEX P1 Docs P2 Docs Learn Events
Visual Music Synchronization (new code inside) — Parallax Forums

Visual Music Synchronization (new code inside)

Ol' GeoOl' Geo Posts: 30
edited 2007-09-19 22:42 in Learn with BlocklyProp
Hi, folks...

I am back to WAM 2.2 to resume my study. Upon Chapter #8 (Frequency and Sound), I am unable to hear sounds due to my deafness since infancy. So, I added some codes to some exercises to display notes on Debug Terminal in order to follow music visually. One particular example to which I added codes is MusicWithMoreFeatures.bs2. The additional codes are showing below as well as the entire modified file is attached. In old days, on some music movie, a ball was dancing upon English words in synchronization if you are old enough to remember.

The problem is music synchronization with English words. I ain't no Beethoven. Would someone be kind to help me to rearrange the words in synchronization? Download the attached file and play the music. See if it is in synchronization or not.

Added some data in DATA area:
Wd1       DATA "For ", 0
Wd2       DATA "He's ", 0
Wd3       DATA "a ", 0
Wd4       DATA "Jolly ", 0
Wd5       DATA "Good ", 0
Wd6       DATA "Fellow ", 0
Spc       DATA " ", 0
Done      DATA "!", CR, 0

Words     DATA  Word Wd1, Word Spc, Word Spc, Word Spc,   ' "For"
                Word Wd2, Word Wd3,                       ' "He's a"
                Word Wd4, Word Spc, Word Spc,             ' "Jolly"
                Word Wd5, Word Spc, Word Spc,             ' "Good"
                Word Wd6, Word Spc, Word Spc, Word Spc,   ' "Fellow"
                Word Done                                 ' "!"

message   VAR Word




Included ShowMessage call in the loop:
DO UNTIL noteLetter = "Q"
  READ Words + (2 * index), Word message
  GOSUB ShowMessage
  ...
  
  index = index + 1
LOOP

END




Added a new subroutine at the end:
idx     VAR Byte
letter  VAR Byte

ShowMessage:
  idx = 0
  DO
    READ message + idx, letter
    IF letter <> 0 THEN DEBUG letter
    idx = idx + 1
  LOOP UNTIL (letter = 0)
  RETURN




Big thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ol' Geo
Retired Software Engineer

An oscilloscope is a window of unseen electronic world. - GM

Post Edited (Ol' Geo) : 9/19/2007 3:15:43 AM GMT

Comments

  • Steph LindsaySteph Lindsay Posts: 767
    edited 2007-09-17 22:50
    Really neat concept here! But no, the words aren't appearing in synch with their respective notes playing on the speaker. For the song in this program, the phrase would need to be repeated twice. To make the words coincide, there should be one syllable per note:

    for-he's-a-jol-ly-good-fel-low, for-he's-a-jol-ly-good-fel-low

    You could put a blank space in the debug statement for each single-syllable word, and leave it out for the two-syllable words "jolly" and "fellow" maybe?

    -Stephanie Lindsay
    Editor, Parallax Inc.
  • WhitWhit Posts: 4,191
    edited 2007-09-19 01:06
    Great idea Ol' Geo!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Ol' GeoOl' Geo Posts: 30
    edited 2007-09-19 03:11
    Thanks, -Stephanie, for helping me out. I owe you one. [noparse]:)[/noparse]

    I have rearranged words as per your suggestion. I didn't know the phrase repeats twice. Hope all words are now in synch. Please check the new code once more to be sure. Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ol' Geo
    Retired Software Engineer

    An oscilloscope is a window of unseen electronic world. - GM

    Post Edited (Ol' Geo) : 9/19/2007 3:17:22 AM GMT
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2007-09-19 22:42
    Hey Ol'Geo, it works great! That is really fun!!!

    This is a really creative and interesting enhancement to the program.
    I think it would make a great homework assignment for teachers using WAM, too!

    -Stephanie
Sign In or Register to comment.