Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-27 Thread Adam Jimerson
Thanks again, I don't know anything about Python programming but where would
I label the inputs for the frequency and the volume at?  I can easily make
the changes to the frequency, a dog whistle is anywhere from 16000 to 22000
Hz and for the volume anything over 0.1 is to loud the speakers on the
FreeRunner struggle with it, what I mean by that is 22000 Hz sounds lower
than 17000 Hz.

On Fri, Apr 24, 2009 at 11:20 AM, Stuart Pullinger <
s.pullin...@elec.gla.ac.uk> wrote:

> Adam Jimerson wrote:
> > Thanks that is what I was looking for,
> No probs.
>
> > to bad there isn't a UI or anything for it.
> >
> Tadaaa! Hope pasting it into an email doesn't ruin the formatting. This
> is my first pygtk/pygst program and it has been cobbled together from
> various code examples on the web. I hope you like it.
>
> Stuart
>
> #!/usr/bin/env python
>
> ##
> # testtone.py
> # Hacked together by Stuart Pullinger (s dot pullinger at elec dot gla
> dot ac dot uk) from the following sources:
> # http://www.pygtk.org/pygtk2tutorial/index.html
> # http://pygstdocs.berlios.de/pygst-tutorial/index.html
> #
>
> http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/
> ##
>
> import pygtk
> pygtk.require('2.0')
> import gtk
> import pygst
> pygst.require("0.10")
> import gst
>
> class TestTone:
>
>def startstop(self, widget, data=None):
>if self.playing:
>#we are playing so stop
>self.pipeline.set_state(gst.STATE_NULL)
>self.playing = False
>else:
>#we are stopped so start playing
>self.pipeline.set_state(gst.STATE_PLAYING)
>self.playing = True
>
>def change_freq(self, adj):
>self.audiotestsrc.set_property('freq', adj.value)
>
>def change_vol(self, adj):
>self.audiotestsrc.set_property('volume', adj.value)
>
>def delete_event(self, widget, event, data=None):
>print "delete event occurred"
>return False
>
>def destroy(self, widget, data=None):
>print "destroy signal occurred"
>gtk.main_quit()
>
>def __init__(self):
># create a new window
>self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
>
>self.window.connect("delete_event", self.delete_event)
>self.window.connect("destroy", self.destroy)
>
>self.window.set_border_width(10)
>
>self.button = gtk.Button("Start / Stop")
>self.button.connect("clicked", self.startstop, None)
>
>self.adjustfreq = gtk.Adjustment(440, 20, 2, 10, 100, 0)
>
>self.freq_button = gtk.SpinButton(adjustment=self.adjustfreq,
> climb_rate=0.5, digits=2)
>self.adjustfreq.connect('value_changed', self.change_freq)
>
>self.adjustvol = gtk.Adjustment(0.4, 0, 1, 0.01, 0.1, 0)
>self.vol_button = gtk.SpinButton(adjustment=self.adjustvol,
> climb_rate=0.5, digits=2)
>self.adjustvol.connect('value_changed', self.change_vol)
>
>self.pipeline = gst.Pipeline("mypipeline")
>self.audiotestsrc = gst.element_factory_make("audiotestsrc",
> "audio")
>self.audiotestsrc.set_property('freq', 440)
>self.audiotestsrc.set_property('volume', 0.4)
>self.pipeline.add(self.audiotestsrc)
>self.sink = gst.element_factory_make("alsasink", "sink")
>self.pipeline.add(self.sink)
>self.audiotestsrc.link(self.sink)
>
>self.playing = False
>
>self.vbox = gtk.VBox(False, 0)
>self.vbox.pack_start(self.freq_button)
>self.vbox.pack_start(self.vol_button)
>self.vbox.pack_start(self.button)
>self.window.add(self.vbox)
>self.button.show()
>self.freq_button.show()
>self.vol_button.show()
>self.vbox.show()
>self.window.show()
>
>def main(self):
># All PyGTK applications must have a gtk.main(). Control ends here
># and waits for an event to occur (like a key press or mouse event).
>gtk.main()
>
> # If the program is run directly or passed as an argument to the python
> # interpreter then create a HelloWorld instance and show it
> if __name__ == "__main__":
>testtone = TestTone()
>testtone.main()
>
>
>
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-24 Thread Stuart Pullinger
Adam Jimerson wrote:
> Thanks that is what I was looking for, 
No probs.

> to bad there isn't a UI or anything for it.
>
Tadaaa! Hope pasting it into an email doesn't ruin the formatting. This
is my first pygtk/pygst program and it has been cobbled together from
various code examples on the web. I hope you like it.

Stuart

#!/usr/bin/env python

##
# testtone.py
# Hacked together by Stuart Pullinger (s dot pullinger at elec dot gla
dot ac dot uk) from the following sources:
# http://www.pygtk.org/pygtk2tutorial/index.html
# http://pygstdocs.berlios.de/pygst-tutorial/index.html
#
http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/
##

import pygtk
pygtk.require('2.0')
import gtk
import pygst
pygst.require("0.10")
import gst

class TestTone:

def startstop(self, widget, data=None):
if self.playing:
#we are playing so stop
self.pipeline.set_state(gst.STATE_NULL)
self.playing = False
else:
#we are stopped so start playing
self.pipeline.set_state(gst.STATE_PLAYING)
self.playing = True

def change_freq(self, adj):
self.audiotestsrc.set_property('freq', adj.value)

def change_vol(self, adj):
self.audiotestsrc.set_property('volume', adj.value)

def delete_event(self, widget, event, data=None):
print "delete event occurred"
return False

def destroy(self, widget, data=None):
print "destroy signal occurred"
gtk.main_quit()

def __init__(self):
# create a new window
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
   
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
   
self.window.set_border_width(10)
   
self.button = gtk.Button("Start / Stop")
self.button.connect("clicked", self.startstop, None)

self.adjustfreq = gtk.Adjustment(440, 20, 2, 10, 100, 0)

self.freq_button = gtk.SpinButton(adjustment=self.adjustfreq,
climb_rate=0.5, digits=2)
self.adjustfreq.connect('value_changed', self.change_freq)
   
self.adjustvol = gtk.Adjustment(0.4, 0, 1, 0.01, 0.1, 0)
self.vol_button = gtk.SpinButton(adjustment=self.adjustvol,
climb_rate=0.5, digits=2)
self.adjustvol.connect('value_changed', self.change_vol)
   
self.pipeline = gst.Pipeline("mypipeline")
self.audiotestsrc = gst.element_factory_make("audiotestsrc",
"audio")
self.audiotestsrc.set_property('freq', 440)
self.audiotestsrc.set_property('volume', 0.4)
self.pipeline.add(self.audiotestsrc)
self.sink = gst.element_factory_make("alsasink", "sink")
self.pipeline.add(self.sink)
self.audiotestsrc.link(self.sink)
   
self.playing = False
   
self.vbox = gtk.VBox(False, 0)
self.vbox.pack_start(self.freq_button)
self.vbox.pack_start(self.vol_button)
self.vbox.pack_start(self.button)
self.window.add(self.vbox)
self.button.show()
self.freq_button.show()
self.vol_button.show()
self.vbox.show()
self.window.show()

def main(self):
# All PyGTK applications must have a gtk.main(). Control ends here
# and waits for an event to occur (like a key press or mouse event).
gtk.main()

# If the program is run directly or passed as an argument to the python
# interpreter then create a HelloWorld instance and show it
if __name__ == "__main__":
testtone = TestTone()
testtone.main()



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Adam Jimerson
Thanks that is what I was looking for, to bad there isn't a UI or anything
for it.

On Thu, Apr 23, 2009 at 12:18 PM, Stuart Pullinger <
s.pullin...@elec.gla.ac.uk> wrote:

> Adam Jimerson wrote:
> > I mean like playing a tone, the same tone, but at different pitch like
> > 67Hz as an example
> >
> It can be done from the command-line with gstreamer:
>
> gst-launch audiotestsrc freq=67 volume=0.8 ! alsasink
>
> (It's very quiet!)
>
> You may have to install a few extra packages via opkg eg:
>
> opkg install gst-plugin-audiotestsrc
> on shr-testing or using the direct address:
>
> http://build.shr-project.org/shr-testing/ipk/armv4t/gst-plugin-audiotestsrc_0.10.17-r5_armv4t.ipk
>
> Use:
> gst-inspect audiotestsrc
> fo more info.
>
> Stuart
>
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Stuart Pullinger
Adam Jimerson wrote:
> I mean like playing a tone, the same tone, but at different pitch like
> 67Hz as an example
>
It can be done from the command-line with gstreamer:

gst-launch audiotestsrc freq=67 volume=0.8 ! alsasink

(It's very quiet!)

You may have to install a few extra packages via opkg eg:

opkg install gst-plugin-audiotestsrc
on shr-testing or using the direct address:
http://build.shr-project.org/shr-testing/ipk/armv4t/gst-plugin-audiotestsrc_0.10.17-r5_armv4t.ipk

Use:
gst-inspect audiotestsrc
fo more info.

Stuart

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Adam Jimerson
I am using SHR so I don't know if there is anything like that for my phone.

On Thu, Apr 23, 2009 at 11:39 AM, Ali  wrote:

> On Thu, 2009-04-23 at 11:08 -0400, Adam Jimerson wrote:
> > I am looking for a app like the Dog Whistle for the iPhone that allows
> > you to set a pitch and it plays a note at the pitch, I looked in
> > opkg.org and in the application page in the wiki and didn't see one
> > like that and was wondering if there is one or if it would be a great
> > suggestion for a app for a developer to make?
> If you are using debian or a derivative I'm sure there is something, how
> well the gui will work on the phone is anyone's guess. You could always
> use audacity, but that's overkill.
>
>
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Ali
On Thu, 2009-04-23 at 11:08 -0400, Adam Jimerson wrote:
> I am looking for a app like the Dog Whistle for the iPhone that allows
> you to set a pitch and it plays a note at the pitch, I looked in
> opkg.org and in the application page in the wiki and didn't see one
> like that and was wondering if there is one or if it would be a great
> suggestion for a app for a developer to make?
If you are using debian or a derivative I'm sure there is something, how
well the gui will work on the phone is anyone's guess. You could always
use audacity, but that's overkill.


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Adam Jimerson
I mean like playing a tone, the same tone, but at different pitch like 67Hz
as an example

On Thu, Apr 23, 2009 at 11:17 AM, Nicola Mfb  wrote:

> 2009/4/23 Adam Jimerson :
> > I am looking for a app like the Dog Whistle for the iPhone that allows
> you
> > to set a pitch and it plays a note at the pitch, I looked in opkg.organd in
> > the application page in the wiki and didn't see one like that and was
> > wondering if there is one or if it would be a great suggestion for a app
> for
> > a developer to make?
>
> If playing notes fits your needs try
> http://tg.gstaedtner.net/projects/euphony.html
>
> Regards
>
> Nicola
>
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Nicola Mfb
2009/4/23 Adam Jimerson :
> I am looking for a app like the Dog Whistle for the iPhone that allows you
> to set a pitch and it plays a note at the pitch, I looked in opkg.org and in
> the application page in the wiki and didn't see one like that and was
> wondering if there is one or if it would be a great suggestion for a app for
> a developer to make?

If playing notes fits your needs try
http://tg.gstaedtner.net/projects/euphony.html

Regards

 Nicola

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Looking for a app similar to the Dog Whistle for the iPhone

2009-04-23 Thread Adam Jimerson
I am looking for a app like the Dog Whistle for the iPhone that allows you
to set a pitch and it plays a note at the pitch, I looked in opkg.org and in
the application page in the wiki and didn't see one like that and was
wondering if there is one or if it would be a great suggestion for a app for
a developer to make?
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community