Re: [racket-users] Racket Video

2018-12-03 Thread David Storrs
Awesome, thanks!

On Mon, Dec 3, 2018 at 2:21 PM Leif Andersen  wrote:

> Glad you're interested in checking out Video. If you need a thing
> that's not yet in the standard library, please poke me and I'll put it
> in. Its usually pretty easy to add something at this point, and I tend
> to do it as people need it.  on the list you just sent, Video already
> supports most of what you are looking for. I'll go down the quickly
> state what forms I would use.
> You can also find more about video at https://lang.video. Based
>
> > - Take an .mp4 video file and a .wav file, composite them into tracksp
>
> `multitrack`.
>
> > - Identify initial clap on both audio and video tracks, sync them
> together
>
> Video currently can't automatically find the 'clap', but you can use
> `playlist` to handle the syncing.
>
> > - Delete sound from video track
>
> `remove-audio`
>
> > - Merge video and audio
>
> `multitrack`
>
> > - Locate/delete inhale fuzz
>
> `highpass/lowpass-filter`
>
> > - Cut everything from beginning to 1s before the first spoken word
>
> `cut-producer`
>
> > - Locate and delete bad takes (a single clap sandwiched between "good
> > to/from here" spikes (double click))
>
> I'm not sure what you're asking for here. But probably `cut-producer`
> and `playlist` can do it?
>

It's a trick for fast editing.  Every once in a while when there haven't
been any errors you pause and make a distinct sound; I like to double-click
one of those "safety button pops up when bottle is opened" things, since it
makes a very specific shape on the waveform -- a double spike where the
spikes are extremely narrow.  That sound means "everything is good up to
here."  When you make a mistake, you clap once, which makes a wide/fuzzy
spike, then you re-do the part you just messed up.  Editing out bad takes
becomes a simple matter of finding a 'good' spike, then removing it and
everything up to the next 'bad' spike.


> > - Grab first five seconds of audio and use it as a profile for noise
> > reduction across the entire audio
>
> Video currently offers highpass, lowpass, bandpass, compand, etc
> filters, which seem to go a long way to automatically cleaning up
> spoken word. It currently doesn't support taking a sample and doing
> noise reduction based on that. I'd be happy to look into that if
> needed. I presume you were thinking of using libsox for that?
>
>
In the past I've used Audacity; I can continue using this and then use the
cleaned-up audio with Video.

> That would eliminate about 90% of the work and I could do the rest
> > manually.
>
> Again, feel free to poke me if you wished something worked
> differently, or want a feature that is missing. I also regularly check
> Video's issues on github at: https://github.com/videolang/video/issues
>
> Good luck, and happy editing.
>

Thanks!


> ~Leif
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racket Video

2018-12-03 Thread David Storrs
Great, thank you.  This is exactly the sort of thing I would like to do
automatically --

- Take an .mp4 video file and a .wav file, composite them into tracks
- Grab first five seconds of audio and use it as a profile for noise
reduction across the entire audio
- Identify initial clap on both audio and video tracks, sync them together
- Delete sound from video track
- Merge video and audio
- Locate/delete inhale fuzz
- Cut everything from beginning to 1s before the first spoken word
- Locate and delete bad takes (a single clap sandwiched between "good
to/from here" spikes (double click))

That would eliminate about 90% of the work and I could do the rest manually.



On Sun, Dec 2, 2018 at 3:33 PM Matthias Felleisen 
wrote:

>
> On Dec 2, 2018, at 2:49 PM, David Storrs  wrote:
>
> Hi all,
>
> I have some video (.mp4) and audio (.wav, although it's from Audacity and
> could be exported in other formats) that I would like to sync up.  At
> RacketCon I recall seeing Leif running a talk about the Racket Video
> language.  I'm looking through the docs now and it's unclear to me what the
> real capabilities are.  Leif, or anyone who has worked with it:  Is the
> language capable of realistic editing?  What sorts of things have you done
> with it in the past
>
>
>
> See https://www2.ccs.neu.edu/racket/pubs/#icfp17-acf for the motivating
> example, namely, scripting the post-production of many videos. — Matthias
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Implications of stateless servlets & how/whether to avoid them

2018-12-03 Thread Jay McCarthy
On Fri, Nov 30, 2018 at 9:43 PM Brian Adkins  wrote:
> Using the lift dispatcher directly didn't feel quite right, so I'll look into 
> dispatch/servlet. Will dispatch/servlet spin up a thread for each request as 
> serve/servlet does? If so, that will save me from handling the request 
> threading myself. I don't think I need a stuffer or manager though, so I'm 
> not sure dispatch/sev

The one thread per request rule happens at a lower level in the heart
of the Web server.

> I don't know if the Racket web server (or related libraries) currently 
> provide a way to stream data in the response, but that is something I'll 
> definitely need relatively soon (primarily for streaming large CSV/JSON 
> files). If it doesn't exist, I don't mind writing it, but I also don't want 
> to begin with an approach now that might make adding that capability more 
> difficult later. From my brief research, given the output field of the 
> response struct is a lambda, I think I can stream using that (i.e. return a 
> lambda in the response immediately that begins writing the data as it 
> retrieves it) - hopefully the infrastructure doesn't buffer the entire 
> output. Other than something like that, I'm happy to work mostly at the level 
> of functions from requests to responses.

The reason why responses have the lambda rather than a byte string is
specifically for streaming like you want. Make sure you specify the
correct response size in the headers.

> I will need full control over the URL, and I thought I read somewhere that 
> some servlets needed to use the URL for state in some cases. That wouldn't 
> work for me.

`send/suspend` may use the URL(*) for state, but that is it. There's
no other part of the Web server that forces your URL in any way.

> I'm confused about your statement, "...make it easy to do stuff like encrypt 
> and sign the state you store on the clients". I would think encrypting and 
> signing something would be simple function calls unrelated to whether I'm 
> using servlets or not. Is this not the case? My client-side state needs are 
> minimal - typically a session ID is sufficient. I wasn't aware of 
> functionality built-in to the web server for this, so I just assumed I would 
> have a secret key on the server that I'd use to encrypt state. I haven't 
> gotten that far yet.

When `send/suspend` manipulates the URL (*or a POST parameter) to
store the state of your program, then you are storing information on
the client. That information is therefore susceptible to attack or
manipulation. The Web server gives you a simple way to either sign or
encrypt that information transparently, so that it is always done and
you never forget.

Jay

> On Friday, November 30, 2018 at 8:25:40 PM UTC-5, Jay McCarthy wrote:
>>
>> Hi Brian,
>>
>> I think you are misunderstanding what that section is about. It is
>> just describing how the system is implemented.  There's basically
>> nothing in there that you need to know as user other than "It may take
>> a while to compile." For instance, you don't worry about the fact that
>> all tree-like functions in your normal Racket code are eventually
>> turned into linear sequences of assembly. Those changes to your code
>> discussed in 3.2 are things that happen in the compiler, you don't
>> need to do anything, just like you don't need to think about register
>> allocation when you write normal programs, but it happens behind the
>> scenes.
>>
>> Nothing described in section 3 happens to your code unless you write
>> in `#lang web-server` or `#lang web-server/base`. You can use or not
>> use continuations and use or not use this library... they are totally
>> orthogonal. There is basically no program that you can write in one
>> that you can't write in the other, as long as you call the appropriate
>> version of `send/suspend`.
>>
>> The whole point of this library is to write code as-if it were
>> stateful, but the compiler automatically makes it stateless. If you
>> are comfortable programming directly with inverted control, then go
>> right ahead and implement the stateless stuff yourself. Both ways are
>> going to be equally efficient, although the `#lang web-server` library
>> will be guaranteed to do it correctly and make it easy to do stuff
>> like encrypt and sign the state you store on the clients.
>>
>> As far as using `serve/servlet` or not, the implementation of it is
>> really simple [1] in case you want to adapt it. I don't recommend
>> using the lift dispatcher directly. You probably want to use
>> `dispatch/servlet`. Remember, in Racket, a servlet is just a function
>> from request to response, with some resource control. It doesn't
>> impose any programming style or other costs on you. I get the
>> impression from your comments that you are really nervous about some
>> sort of costs imposed by using Racket libraries and think you will get
>> some benefit by being "low-level". This is probably misguided and just
>> based on some misunderstandings.

[racket-users] ncurses ffi bindings

2018-12-03 Thread dys . bigwig
Hello all!
https://github.com/dys-bigwig/racket-ncurses/blob/master/ncurses.rkt

Doing little bits every day. Any and all comments welcome. I'm eager to 
learn and hopefully this way other people can benefit :)

P.S if this has already been done, maybe just don't tell me... :P

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.