I wrote:
> In contrast, going down Oleg's route, you'd slave away for a year and
eventually reinvent Audacity.

Rereading that in the light of Raul's comments, I see I was projecting a
discouraging impression, which I didn't mean, and certainly don't agree
with now. I must have been tired when I wrote it, because basically I don't
disagree with anything Raul says.

Indeed, there is much to be said for "going down Oleg's route", at least
some of the way. Perhaps until you understand just what a DAW is doing for
you. Raul's approach makes an audio waveform far more accessible to someone
at-home in the J environment than handling proprietary formats directly
with a tool like Audacity, even simple formats like WAV.

What I had in mind, when I wrote what I did, was a memory of my own past
mistakes. I'd beaver away at a prototype product, paying no attention to
what was already out there, reinventing the wheel – and learning nothing
thereby. Whereas a glance aside at how other people had addressed the
problem would have got me to my goal far more efficiently.

My mistake was not that I should have followed such-and-such a
tried-and-tested path *instead*, but taken time out to explore that path *as
well*. Which reinforces Raul's point (5): It's never just one thing.

The excuse I made to myself at the time was: I was too busy for diversions
and needed focus in order to make progress. But I recall someone telling me
once: "when you have a forest to cut down, there is *always* time to
sharpen your axe."

Ian

On Tue, 27 Apr 2021 at 18:35, Raul Miller <[email protected]> wrote:

> I should also add a few thoughts about this situation:
>
> (0) We should not let ourselves be overwhelmed by our wealth of
> possibilities. Just because someone else did something different
> better than we did is no reason to be apathetic and do nothing.
>
> (1) J is a useful tool for thinking about computer "architectural" issues:
>
> (1a) J allows for the concise expression of ideas as working code
> (1b) J's arrays closely match the character of computer memory
> (1c) J's "loops are just notation" approach helps us focus elsewhere
>
> (2) We can use different tools together.
>
> Audacity is a good tool. But it should not be our only tool, any more
> than J should be our only tool. Generally speaking, computers tend to
> be useful when we can use them to interact with outside systems. (The
> internet is one approach there, but has never been the only approach.
> And, the internet should also not be our only tool...)
>
> (3) Sound can be a useful component of a user interface, and knowing
> how to deal with it at a variety of levels of abstraction can be a
> useful skill.
>
> (4) File formats can only be useful to us to the degree that we
> understand them. And, consequently, we can only work with them in ways
> that our tools support.
>
> (5) It's never just one thing.
>
> Take care,
>
> --
> Raul
>
> On Tue, Apr 27, 2021 at 3:42 AM Raul Miller <[email protected]> wrote:
> >
> > PlaySound uses the wav audio format.
> >
> > FYI,
> >
> > --
> > Raul
> >
> > On Mon, Apr 26, 2021 at 9:06 PM Ian Clark <[email protected]> wrote:
> > >
> > > Raul wrote:
> > > > Still... possibly of interest to some people here?
> > >
> > > Yes, definitely. I remember playing with Oleg's media/wav -but too
> long ago
> > > to recall much ambient detail. I regretted its lack of Mac support,
> though.
> > >
> > > Mathematica has long had the ability to play any line graph it can
> generate
> > > as an audio waveform. They tout the feature as a useful tool in the
> pure
> > > mathematician's armoury. It's a bit like chemists sniffing or tasting
> their
> > > reagents. Offhand I recall the Riemann Zeta function having an eerie
> spacey
> > > sound, like a musical circular saw.
> > >
> > > Taking the Mathematica people at their word suggests that
> > > ~addons/graphics/plot ought to have the ability to generate wav, ogg,
> mp3,
> > > aiff or indeed any of the portable audio formats from a line graph,
> just as
> > > it can output it in visual form to pdf, png, etc. A decent interface
> with
> > > Audacity would be good too.
> > >
> > > Audacity I particularly recommend. (
> http://www.audacityteam.org/download/
> > > ) It's a general-purpose waveform editor you'd spend a long time
> > > replicating in J, but soon feel the need for. I've even heard of it
> being
> > > used as a logic analyser for circuit-design. Of all the DAWs (Digital
> Audo
> > > Workstations) it's the most flexible and internally accessible, and a
> lot
> > > of 3rd parties have contributed fancy add-ons.
> > >
> > > Audacity is freeware; most other DAWs decidedly aren't.
> > >
> > > I'd recommend generating standard audio formats from the word go,
> rather
> > > than reinvent the wheel by working with PlaySound applied to raw J
> number
> > > lists, as Oleg does. But it's quite on-the-cards you'll cook up a rare
> > > sound with J that would repay importing into Audacity, Ableton LIVE,
> Logic
> > > Pro <http://www.audacityteam.org/download/> or even GarageBand to
> give it a
> > > drum accompaniment or a vocal track. All these can import most of the
> audio
> > > formats you meet with, the cross-platform bog standard being mp3 (or
> used
> > > to be).
> > >
> > > In contrast, going down Oleg's route, you'd slave away for a year and
> > > eventually reinvent Audacity.
> > >
> > >
> > >
> > > On Mon, 26 Apr 2021 at 23:56, Raul Miller <[email protected]>
> wrote:
> > >
> > > > I've been playing around a little with Oleg Kobchenko's media/wav
> > > >
> > > > In its current implementation, it relys on
> > > >
> > > >
> https://docs.microsoft.com/en-us/windows/win32/multimedia/the-playsound-function
> > > > which means that it does not adequately support osx nor linux
> > > > machines. Finding and supporting equivalent mechanisms there would be
> > > > interesting.
> > > >
> > > > But, anyways, here's a brief introduction:
> > > >
> > > >    load'media/wav'
> > > >    lq=: [: <. 0.5 + 255 * ]
> > > >    normalize=: (% >./)@(- <./)
> > > >    4 wavplay wavmake lq normalize 1 o. 2p1*440*normalize i.11000
> > > >
> > > > This will play one second of 440 Hz --
> > > > https://en.wikipedia.org/wiki/A_(musical_note)
> > > >
> > > > The default sample rate used by this playback mechanism is 11000
> > > > samples per second.
> > > >
> > > > The normalize verb transforms a numeric list so that its minimum
> value
> > > > is 0 and its maximum value is 1.
> > > >
> > > > The lq verb translates a 0..1 floating point or fractional list to a
> > > > 0..255 numeric list. And, 4 wavplay wavmake on the result of lq sends
> > > > the sequence as an audio sample to be played by the computer's sound
> > > > system.
> > > >
> > > > If I wanted to be a little fancier, I might also want to disable a
> > > > potential ending "click" that can arise when a sound sample ends with
> > > > a non-neutral voltage value and no corresponding sound sample follows
> > > > it. And, maybe while I am at that, I should make it so that repeated
> > > > applications of lq perform its transformation only once.
> > > >
> > > > softend=: ,  2#{: (+ * * i.@|) 128 - {:
> > > > lqsoft=:  softend@lq^:(1 >: >./)
> > > >
> > > > Now I can throw in a one second "envelope" on my note
> > > >
> > > > A=: normalize 1 o. 2p1*440*normalize i.11000
> > > > envelope=: normalize (* ^@-) 15*normalize i.11000
> > > > play=: 4 wavplay wavmake
> > > >
> > > >    play lqsoft envelope*A
> > > >
> > > > There's a lot more that can be done here -- assembling and scheduling
> > > > different notes, introducing beats and resonances, etc. etc. I've
> > > > barely scratched the surface of what can be done. And, of course,
> > > > different machines will introduce their own quirks, and we each have
> > > > our own various ideas of what sounds good.
> > > >
> > > > Still... possibly of interest to some people here?
> > > >
> > > > Thanks,
> > > >
> > > > --
> > > > 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

Reply via email to