I have pasted the contents of my j602\addons\media\wav\wav.ijs file at http://pastebin.com/6Ge51T2k
Meanwhile, a search for kernel32.dll beep finds pages like http://pinvoke.net/default.aspx/kernel32.Beep and http://msdn.microsoft.com/en-us/library/windows/desktop/ms679277(v=vs.85).aspx which describe two parameters. The first parameter is the frequency of the sound, in hertz, the second is its duration in milliseconds. If it fails, it returns a zero. I hope this helps. Thanks, -- Raul On Mon, Dec 8, 2014 at 12:51 AM, Skip Cave <[email protected]> wrote: > Joe's Beep function works in J8.03. However, I haven't figured out what > all the parameters do, though it seems like the frequency and duration of > tones can be varied. Unfortunately, it looks like there is no control of > the waveform shape. It seems to only generate sine waves. > > I couldn't find the media/wav folder Raul talked about, anywhere in J 6.02. > > I found this file: qtmedia_audioengine.dll in the J64-8.03/bin/media > directory. The name sounds promising, but I couldn't find any doc on it, > anywhere. > > Generally, I want to define arbitrary waveforms in J usng integer or > floating vectors, and then play the result out the speakers. > > Skip > > > On Sun, Dec 7, 2014 at 7:42 PM, Joe Bogner <[email protected]> wrote: > >> On windows, this should work: >> >> http://www.jsoftware.com/pipermail/programming/2014-June/037891.html >> On Dec 7, 2014 7:50 PM, "Raul Miller" <[email protected]> wrote: >> >> > You're on windows, so there's no way that you can get /dev/audio >> > working, that I know of. >> > >> > I think your best option is to use j 6.02 and the media/wav addon. >> > This addon has not yet been ported to j 8.03. I'm not sure why. I >> > copied the text of media/wav from a j 6.02 session to a j 8.03 windows >> > 64 script, and it worked just fine, in the experiments I tried. >> > >> > Anyways, once you have that loaded, you could try something like: >> > >> > 4 wavplay wavmake <.128+ 128*1 o. 0.4 * i.100 >> > >> > Though that's a bit short, so maybe instead >> > >> > 4 wavplay wavmake <.128+ 128*1 o. 0.4 * i.2000 >> > >> > Note also that the one-liners referred to in the original article >> > seemed to be using a character representation for amplitude, along >> > with a fixed sample rate. That's what I imagine the putchar and "pipe >> > to /dev/audio" meant, though I've not actually tried running their >> > code. >> > >> > The equivalent, here, would probably require something like: >> > putchar=: 4 wavplay wavemake >> > >> > ... and a self imposed limit of numbers which are valid a. indices. >> > >> > Thanks, >> > >> > -- >> > Raul >> > >> > On Sun, Dec 7, 2014 at 7:02 PM, Skip Cave <[email protected]> >> wrote: >> > > If I generate a sine wave in J, >> > > x =. 1 o. 0.4 * i.100 >> > > How do I cause it to be played out the speaker? >> > > I searched the J Software site for sound, audio, music, etc., no luck. >> > > >> > > Skip >> > > >> > > >> > > Skip Cave >> > > >> > > >> > > On Sun, Dec 7, 2014 at 1:50 PM, Raul Miller <[email protected]> >> > wrote: >> > > >> > >> Can we do better than this? >> > >> >> > >> >> > >> >> > >> http://countercomplex.blogspot.com.au/2011/10/algorithmic-symphonies-from-one-line-of.html >> > >> >> > >> (Here, writing to /dev/audio on a unix system - warning: some of them >> > >> are discordant.) >> > >> >> > >> -- >> > >> Raul >> > >> ---------------------------------------------------------------------- >> > >> For information about J forums see >> http://www.jsoftware.com/forums.htm >> > >> >> > > ---------------------------------------------------------------------- >> > > For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- >> > For information about J forums see http://www.jsoftware.com/forums.htm >> > >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
