Loading ...
Sorry, an error occurred while loading the content.
Skip to search.
 

Morse Code Translator - VB 6.0...?

Expand Messages
  • kingml7
    Hello to one and all, I have just now found and joined this group because of my interest in making a decent grade in Visual Basic at a local community college.
    Message 1 of 15 , Jul 20, 2003
      Hello to one and all,
      I have just now found and joined this group
      because of my interest in making a decent grade in Visual Basic at a
      local community college. My class ends on Wednesday the 23rd of this
      month and there are two more projects I am trying to complete, which
      may be time intensive. I am trying to code a Morse code translator
      and a poker dealing program that deals the dealer's hand face down
      and shuffles. This program should also rate the better hand. I am
      unaccustomed to posting , so I hope this is not unduly long.
    • Ken Lewis, Sr.
      This is a liberty basic forum, not a VB forum. I am sure there are many good VB forums out there if you look for them. Ken Lewis, Sr. ... From: kingml7
      Message 2 of 15 , Jul 21, 2003
        This is a liberty basic forum, not a VB forum. I am sure there are many
        good VB forums out there if you look for them.

        Ken Lewis, Sr.

        ----- Original Message -----
        From: "kingml7" <kingml7@...>
        To: <libertybasic@yahoogroups.com>
        Sent: Sunday, July 20, 2003 10:05 PM
        Subject: [libertybasic] Morse Code Translator - VB 6.0...?


        > Hello to one and all,
        > I have just now found and joined this group
        > because of my interest in making a decent grade in Visual Basic at a
        > local community college. My class ends on Wednesday the 23rd of this
        > month and there are two more projects I am trying to complete, which
        > may be time intensive. I am trying to code a Morse code translator
        > and a poker dealing program that deals the dealer's hand face down
        > and shuffles. This program should also rate the better hand. I am
        > unaccustomed to posting , so I hope this is not unduly long.
        >
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > libertybasic-unsubscribe@egroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
      • midi_boink
        ... a ... this ... which ... You/we are only allowed to talk about Liberty basic programming in this forum. If you want to write a simple morse translator in
        Message 3 of 15 , Jul 21, 2003
          --- In libertybasic@yahoogroups.com, "kingml7" <kingml7@y...> wrote:
          > Hello to one and all,
          > I have just now found and joined this group
          > because of my interest in making a decent grade in Visual Basic at
          a
          > local community college. My class ends on Wednesday the 23rd of
          this
          > month and there are two more projects I am trying to complete,
          which
          > may be time intensive. I am trying to code a Morse code translator
          > and a poker dealing program that deals the dealer's hand face down
          > and shuffles. This program should also rate the better hand. I am
          > unaccustomed to posting , so I hope this is not unduly long.

          You/we are only allowed to talk about Liberty basic programming in
          this forum.

          If you want to write a simple morse translator in Liberty basic, you
          could do it like this:
          [start]
          input A$
          if a$'"a" then print ".-": goto [start]
          if a$="b" then print .... and so forth.

          If you wanted to get sound output, you could use midi. see piano.bas
          example in liberty basic folder.

          If you want to convert audio into text, forget it, not enough time.
          You would have to learn how to do api calls and get at the audio.
          This might be done by use of the mixer api or other audio api, but
          you would be on your own since no liberty basic programmer has
          submitted such a program, there would be no examples available.
          It would be much too big a progject to complete in just a few days.

          Dealing cards, and evaluating them, is going to be a bigger program,
          and I do not think you will have enough time to finish it.

          Go with the code translator, you should be able to finish it in time.
        • Gordon Sweet
          REF TO :- Message: 1 Date: Mon, 21 Jul 2003 03:05:15 -0000 From: kingml7 Subject: Morse Code Translator - VB 6.0...? If you would like to
          Message 4 of 15 , Jul 23, 2003
            REF TO :-
            Message: 1
            Date: Mon, 21 Jul 2003 03:05:15 -0000
            From: "kingml7" <kingml7@...>
            Subject: Morse Code Translator - VB 6.0...?

            If you would like to experiment with my attempt at a Morse Trainer using LB then goto

            http://www.gsweet.fsnet.co.uk/LBHAM.zip

            You will find it can not only use the internal console speaker for say older laptops, but a selection of voices in Winmm.dll I thought might prove suitable.

            Gordon



            [Non-text portions of this message have been removed]
          • dulcimer23
            Hey, I coded a Morse Code tutor program way back when Hector was a pup for the TRS-80, using their Basic plus assembly language for the sound routines. The
            Message 5 of 15 , Aug 22, 2003
              Hey, I coded a Morse Code tutor program way back when Hector was a pup
              for the TRS-80, using their Basic plus assembly language for the sound
              routines. The Liberty Basic is pretty close to the Commodore Basic and
              the Basic for the old TRS-80, at least in a number of ways.

              It seems to me that if you want to make a "translator" for text to
              Morse Code in any kind of Basic program, you want to get input, as
              Midi_boink points out, but then you want to translate the characters
              into Morse Code. For example

              Get input$
              If input$="a" then output$=".-"
              If input$="b" then output$="-..."
              If input$="c" then output$="-.-."

              Any Morse Code reference will show you the code for all the
              characters.

              Of course, you then print out the output$

              Now, it seems that for sound, you need to be able to set frequency and
              duration of the output. Yes, you could use midi, I suppose, with
              frequency being set by choice of midi note.

              I'd much rather be able to select an exact frequency - and this
              relates to something I am doing at the present, so any advice would be
              appreciated. I'd like to take a midi note and then bend it precisely.
              I've gone through the piano.bas program and seen how it works and
              revised it with a bitmap of a dulcimer fretboard - three strings
              seventeen frets, diatonic scale. Now, I'd like to get into different
              tempraments, something apart from the 12 tone equal temprament scale,
              so I have to pitch bend each note a precise amount . . . anyway, back
              to the Morse Code problem . . .

              As any ham should be able to tell you,
              a dot sound will be a certain arbitrary limit (depending on the code
              speed. I had to start at five words per minute, but I worked my way up
              to 20 wpm for my extra class license)

              a dash sound will be three times as long as a dot sound

              the space between dots and dashes in a code letter is one dot in
              length, so "a" which is dot-dash would be one dot sound, one dot
              silence, and one dash sound.

              the space between code letters would be five dots of silence

              At least that's a bare bones outline of how to go about making a Basic
              program that will take keyboard text input and translate it into
              visual ( . or - ) output or sound output.

              Midi_boink is right about the translator of sound (code) input into
              text output. That is a fairly major project. If I remember correctly,
              when I was learning Basic and machine language (on my own) and started
              from no knowledge to finished project, it took about ten months work,
              but I ended up with a program that I really liked, and it sure taught
              me a lot about programming!

              OK, now back to my problem. I'm not really experienced in midi. I
              think I see how piano.bas works, so what I would like to do is add a
              midi pitch bend message along with each midi play note message.

              Do I need to also add a midi pitch bend message with each stop note
              message to "reset" the pitch bend back to midline? Zero pitch bend is,
              evidently Hex 2000.

              I know that the midi event for pitch bend is 224 while the note on
              event is 144 (plus channel number, of course), and then the two bytes
              for the bend itself, so I am assuming I can just copy and modify the
              note on subroutine to a note bend subroutine, change the event number
              and then substitute the two bytes of the bend for the old note number
              and velocity in the note out routine. Does that sound reasonable?

              Also, of course, I will have to make an array of bend numbers to match
              up with the individual notes, but that part is the easy part.

              Again, any help you could give me in using the midi pitch bend in
              Liberty Basic would be appreciated.

              Also, if anyone thinks they'd like to see the dulcimer program based
              on piano.bas, let me know and I'll post it.





              --- In libertybasic@yahoogroups.com, "midi_boink" <NoteJam@a...>
              wrote:
              > --- In libertybasic@yahoogroups.com, "kingml7" <kingml7@y...> wrote:
              > > Hello to one and all,
              > > I have just now found and joined this group
              > > because of my interest in making a decent grade in Visual Basic at
              > a
              > > local community college. My class ends on Wednesday the 23rd of
              > this
              > > month and there are two more projects I am trying to complete,
              > which
              > > may be time intensive. I am trying to code a Morse code translator
              > > and a poker dealing program that deals the dealer's hand face down
              > > and shuffles. This program should also rate the better hand. I am
              > > unaccustomed to posting , so I hope this is not unduly long.
              >
              > You/we are only allowed to talk about Liberty basic programming in
              > this forum.
              >
              > If you want to write a simple morse translator in Liberty basic, you
              > could do it like this:
              > [start]
              > input A$
              > if a$'"a" then print ".-": goto [start]
              > if a$="b" then print .... and so forth.
              >
              > If you wanted to get sound output, you could use midi. see
              piano.bas
              > example in liberty basic folder.
              >
              > If you want to convert audio into text, forget it, not enough time.

              > You would have to learn how to do api calls and get at the audio.
              > This might be done by use of the mixer api or other audio api, but
              > you would be on your own since no liberty basic programmer has
              > submitted such a program, there would be no examples available.
              > It would be much too big a progject to complete in just a few days.
              >
              > Dealing cards, and evaluating them, is going to be a bigger program,
              > and I do not think you will have enough time to finish it.
              >
              > Go with the code translator, you should be able to finish it in
              time.
            • William Roggow
              Also, if anyone thinks they d like to see the dulcimer program based on piano.bas, let me know and I ll post it. I, for one, would be interested in seeing
              Message 6 of 15 , Aug 22, 2003
                "Also, if anyone thinks they'd like to see the dulcimer program based
                on piano.bas, let me know and I'll post it."


                I, for one, would be interested in seeing your program. Let me know when
                you post it.

                Thanks

                Bill R.
                roggowb@...
              • willieej2002
                I can t wait to see your results! ... -Willie ... based ... know when
                Message 7 of 15 , Aug 22, 2003
                  I can't wait to see your results!

                  :)

                  -Willie

                  --- In libertybasic@yahoogroups.com, "William Roggow" <roggowb@e...>
                  wrote:
                  > "Also, if anyone thinks they'd like to see the dulcimer program
                  based
                  > on piano.bas, let me know and I'll post it."
                  >
                  >
                  > I, for one, would be interested in seeing your program. Let me
                  know when
                  > you post it.
                  >
                  > Thanks
                  >
                  > Bill R.
                  > roggowb@e...
                • dulcimer23
                  OK, program and bitmap are posted in the files area under dulcimer23 folder.
                  Message 8 of 15 , Aug 22, 2003
                    OK, program and bitmap are posted in the files area under dulcimer23
                    folder.
                    --- In libertybasic@yahoogroups.com, "willieej2002"
                    <willieej2002@y...> wrote:
                    > I can't wait to see your results!
                    >
                    > :)
                    >

                    > > I, for one, would be interested in seeing your program. Let me
                    > know when
                    > > you post it.
                    > >
                    > > Thanks
                    > >
                    > > Bill R.
                    > > roggowb@e...
                  • William Roggow
                    Thanks for posting your program. It is interesting to see what others are doing with the MIDI voices of the sound card. Bill R. ... From: dulcimer23
                    Message 9 of 15 , Aug 23, 2003
                      Thanks for posting your program. It is interesting to see what others are
                      doing with the MIDI voices of the sound card.

                      Bill R.
                      ----- Original Message -----
                      From: dulcimer23 <csamels@...>
                      To: <libertybasic@yahoogroups.com>
                      Sent: Friday, August 22, 2003 8:33 PM
                      Subject: [libertybasic] Re: Dulcimer Program


                      > OK, program and bitmap are posted in the files area under dulcimer23
                      > folder.
                      > --- In libertybasic@yahoogroups.com, "willieej2002"
                      > <willieej2002@y...> wrote:
                      > > I can't wait to see your results!
                      > >
                      > > :)
                      > >
                      >
                      > > > I, for one, would be interested in seeing your program. Let me
                      > > know when
                      > > > you post it.
                      > > >
                      > > > Thanks
                      > > >
                      > > > Bill R.
                      > > > roggowb@e...
                      >
                      >
                      >
                      > To unsubscribe from this group, send an email to:
                      > libertybasic-unsubscribe@egroups.com
                      >
                      >
                      >
                      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                      >
                    • midi_boink
                      ... be ... precisely. ... different ... scale, A pitch bend message is as follows: In hexadecimal, En lowbyte highbyte where n is the channel number 0 to 15
                      Message 10 of 15 , Aug 27, 2003
                        >
                        > I'd much rather be able to select an exact frequency - and this
                        > relates to something I am doing at the present, so any advice would
                        be
                        > appreciated. I'd like to take a midi note and then bend it
                        precisely.
                        > I've gone through the piano.bas program and seen how it works and
                        > revised it with a bitmap of a dulcimer fretboard - three strings
                        > seventeen frets, diatonic scale. Now, I'd like to get into
                        different
                        > tempraments, something apart from the 12 tone equal temprament
                        scale,

                        A pitch bend message is as follows:

                        In hexadecimal,
                        En lowbyte highbyte where n is the channel number 0 to 15
                        representing channels 1-16.
                        and the sum of low byte plus 128 times high bye is the pitch bend
                        value. The bend value can range from -8192 to 8192 in decimal.

                        a low byte of 0 and a high byte of 40 is the center position (no
                        pitch bend)

                        So in decimal, the first byte of our code is 14*16+channel number of
                        1 to 16.

                        so 225 0 64 is a command to set pitch bend to 0 on channel 1.

                        Think you might have to change a varible or two in the dll call. I
                        think those calls are all set to handle intergers, and you need to
                        use a varible that will allow signed numbers.

                        I have not tried pitch bending, but from what I have read, you can
                        send the pitch bend first, or after the note is played. I also do
                        not know if pitch bend must be reset to zero before the next note, or
                        it gets bent too. I believe the next note would end up bent, unless
                        you reset the bend for zero bend, and just because a note gets turned
                        off, would not reset bend to zero for next note.

                        Just try sending a bent note, and then try following that with a
                        normal note, but do not reset the bend, and find out what happens.

                        For alternate tuning, go to
                        http://xenia.media.mit.edu/~bdenckla/thesis/texts/htthe/node55.html
                      • midi_boink
                        What was the web address for the dulcimer program? I was not able to find it. Thanks.
                        Message 11 of 15 , Aug 27, 2003
                          What was the web address for the dulcimer program? I was not able to
                          find it.
                          Thanks.
                        • William Roggow
                          Program and bitmap are posted in the files area under dulcimer23 folder.
                          Message 12 of 15 , Aug 27, 2003
                            Program and bitmap are posted in the files area under dulcimer23
                            folder.
                          • dulcimer23
                            Thanks, that s sort of what I thought, and I guess I will have to just fool around with it to see what happens. As for other tunings/tempraments, I ve already
                            Message 13 of 15 , Aug 27, 2003
                              Thanks, that's sort of what I thought, and I guess I will have to just
                              fool around with it to see what happens. As for other
                              tunings/tempraments, I've already made up a spread sheet with about
                              ten to fifteen different ones from a book in the 80's on
                              Microtonality, so I've got the frequencies ready to go. What I needed,
                              of course was just a simple way to get a particular type of wave
                              output at a particular specified frequency specified attack, decay,
                              sustain, release, etc rather than having to go through standard midi
                              notes and bend them into the right freq.

                              I appreciate your feedback.

                              --- In libertybasic@yahoogroups.com, "midi_boink" <NoteJam@a...>
                              wrote:
                              >
                              >
                              > >
                              > > I'd much rather be able to select an exact frequency - and this
                              > > relates to something I am doing at the present, so any advice
                              would
                              > be
                              > > appreciated. I'd like to take a midi note and then bend it
                              > precisely.
                              > > I've gone through the piano.bas program and seen how it works and
                              > > revised it with a bitmap of a dulcimer fretboard - three strings
                              > > seventeen frets, diatonic scale. Now, I'd like to get into
                              > different
                              > > tempraments, something apart from the 12 tone equal temprament
                              > scale,
                              >
                              > A pitch bend message is as follows:
                              >
                              > In hexadecimal,
                              > En lowbyte highbyte where n is the channel number 0 to 15
                              > representing channels 1-16.
                              > and the sum of low byte plus 128 times high bye is the pitch bend
                              > value. The bend value can range from -8192 to 8192 in decimal.
                              >
                              > a low byte of 0 and a high byte of 40 is the center position (no
                              > pitch bend)
                              >
                              > So in decimal, the first byte of our code is 14*16+channel number of
                              > 1 to 16.
                              >
                              > so 225 0 64 is a command to set pitch bend to 0 on channel 1.
                              >
                              > Think you might have to change a varible or two in the dll call. I
                              > think those calls are all set to handle intergers, and you need to
                              > use a varible that will allow signed numbers.
                              >
                              > I have not tried pitch bending, but from what I have read, you can
                              > send the pitch bend first, or after the note is played. I also do
                              > not know if pitch bend must be reset to zero before the next note,
                              or
                              > it gets bent too. I believe the next note would end up bent, unless
                              > you reset the bend for zero bend, and just because a note gets
                              turned
                              > off, would not reset bend to zero for next note.
                              >
                              > Just try sending a bent note, and then try following that with a
                              > normal note, but do not reset the bend, and find out what happens.
                              >
                              > For alternate tuning, go to
                              > http://xenia.media.mit.edu/~bdenckla/thesis/texts/htthe/node55.html
                            • dulcimer23
                              Well, I took the route I thought I d have to take, and it seems to work. I have the pitch bend message go out just before the play note midi message, and I
                              Message 14 of 15 , Aug 31, 2003
                                Well, I took the route I thought I'd have to take, and it seems to
                                work. I have the pitch bend message go out just before the play note
                                midi message, and I just substituted the event number for pitch bend,
                                low and hit bytes for bend amount in place of the event number for
                                send note, velocity and note number. It works. With, as Midi_boink
                                responded later, you use 0 lo 64 hi bend amounts, you get no bend.
                                (You don't have to change variable types or anything.) With bend of 0
                                lo 0 hi, I got a two semitone lower note, and with bend of 127, 127, I
                                got a two tone higher note, so my bends will be between 0, 32 and 0,
                                96 to keep them within a semi-tone.

                                As long as I send the bend message before the play note message, I
                                don't have to reset the bend to zero each time.

                                --- In libertybasic@yahoogroups.com, "dulcimer23" <csamels@n...>
                                wrote:

                                >
                                > I know that the midi event for pitch bend is 224 while the note on
                                > event is 144 (plus channel number, of course), and then the two
                                bytes
                                > for the bend itself, so I am assuming I can just copy and modify the
                                > note on subroutine to a note bend subroutine, change the event
                                number
                                > and then substitute the two bytes of the bend for the old note
                                number
                                > and velocity in the note out routine. Does that sound reasonable?
                              • bbjen@hotPOP.com
                                Dulcimer23, Please consider submitting an article for the newletter when you finalize your method. It sounds very interesting and there are lots of MIDI fans
                                Message 15 of 15 , Aug 31, 2003
                                  Dulcimer23,

                                  Please consider submitting an article for the newletter when you finalize
                                  your method.
                                  It sounds very interesting and there are lots of MIDI fans in the group.

                                  Bill J.
                                  --------------------------------------------

                                  At 07:20 PM 8/31/2003 -0000, you wrote:
                                  >Well, I took the route I thought I'd have to take, and it seems to
                                  >work. I have the pitch bend message go out just before the play note
                                  >midi message, and I just substituted the event number for pitch bend,
                                  >low and hit bytes for bend amount in place of the event number for
                                  >send note, velocity and note number. It works. With, as Midi_boink
                                  >responded later, you use 0 lo 64 hi bend amounts, you get no bend.
                                  >(You don't have to change variable types or anything.) With bend of 0
                                  >lo 0 hi, I got a two semitone lower note, and with bend of 127, 127, I
                                  >got a two tone higher note, so my bends will be between 0, 32 and 0,
                                  >96 to keep them within a semi-tone.
                                  >
                                  >As long as I send the bend message before the play note message, I
                                  >don't have to reset the bend to zero each time.
                                Your message has been successfully submitted and would be delivered to recipients shortly.