[Gambas-user] R: morse code sound ?

Dominique Michel dominique.michel at ...3298...
Sun Feb 9 06:06:09 CET 2014


Le Fri, 7 Feb 2014 23:55:37 -0800,
Randall Morgan <rmorgan62 at ...626...> a écrit :

> I got 5F here. Looking forward to a possible 30F next week.
> 
> True the old BASIC machines used the internal speakers, and those are
> hard to find. But almost every *nix box has a sound system. And we
> no-longer need to count clock cycles, we can use the the built-in
> timing routines or delay routines. The Sound and Play function where
> blocking functions. No need for anything fancy. But I do think adding
> a simple Play freq., duration function would be a great addition to
> the language and would make it more complete. For anything more
> elaborate there is Sdl and such.

It was possible to do music with the GWBasic on the old IBM pc.
Otherwise, the AmigaBasic was very powerful, and also to make music.

The clock issue is not a trivial one at all. It was a few discussions
about this on the jack-devel list very recently. As example:
http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack-is-broken-on-ARM-without-bogomips-td17596.html

On the other hand, I think gambas can simply use the sampling rate
provided by the sound system. "All" that is needed is to output samples
at the correct sampling rate.

Otherwise, it is the play command that come with sox that is a great
tool, and among other things, it can play amazing beeps. But we are
in the 21th century, and if something like the play command is
implemented, I would prefer if it use Gstreamer, ALSA or JACK, instead
of the buzzer.

Also, for the morse code, the new WaveGenerator example show how to use
the media component to make audio waves. I can be paused/restarted with
just:

Public Sub btnPlay_Click()

  $bPlay = Not $bPlay

  If $bPlay Then
    $hPlayer.Play
  Else
    $hPlayer.Pause
  Endif

End

That imply the morse code should be able to drive it. That would be a
good test to see how fast hPlayer can commute between Pause and Play.

Dominique

> 
> 
> 
> 
> On Fri, Feb 7, 2014 at 10:07 PM, Bruce <bbruen at ...2308...> wrote:
> 
> > On Fri, 2014-02-07 at 18:15 -0800, Randall Morgan wrote:
> > > It seems like playing a simple tone is something that should be a
> > primitive
> > > in the Gambas Language... A simple Play(frequency, duration) type
> > > of function as was found in many of the early BASIC languages. Am
> > > I the only one who think like this?
> > >
> >
> > Ah yes! But those magical sounds were made by dividing the clock
> > signal and sending the resultant wave directly out to the onboard
> > speaker port. I dont think any of the boxes here have a onboard
> > speaker any more?
> >
> > "Leisure Suit Larry" anyone?
> >
> > cheers
> > Bruce
> >
> > p.s. It's cooled down a bit, only 42C today
> >
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common
> > Pitfalls. Read the Whitepaper.
> >
> > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> 
> 
> 




More information about the User mailing list