HNHacker News
TopNewBestAskShowJobs

qrv3w

1,967 karma · joined May 3, 2015

https://github.com/schollz
submissionscomments
qrv3w··on Alda – Text-Based Programming Language for Music Composition
I love these text-based languages for music composition. Its something that is approaching a gap in music composition in real-life vs via computer. In real-life you can tell your bandmates to "just play a I V IV in C" and they get it. But we are still not quite at a place where we can tell a computer that exact phrase and get something useful. I love how close these text-based languages are getting though!

I've actually made my own musical language too - called miti [1], which is just one of many others including textbeat [2], foxdot [3], sonic-pi [4], chuck [5], and melrose [6]. Each has their own goals and capabilities.

- [1] https://github.com/schollz/miti

- [2] https://github.com/flipcoder/textbeat

- [3] https://foxdot.org/

- [4] https://sonic-pi.net/

- [5] https://chuck.cs.princeton.edu/

- [6] https://github.com/emicklei/melrose

qrv3w··on I built my own analog drum machine (2020)
Thanks a lot!
qrv3w··on I built my own analog drum machine (2020)
Is that quote from a particular interview or talk? I'm interested in the context and learning more about Fullman
qrv3w··on Ask HN: How to get started with audio programming?
Echoing a lot of sentiment here, you can do pretty much all of these things with SuperCollider. I'd go straight to SuperCollider rather than a "frontend" like Overtone/SonicPi. Not that these frontends are bad, but SuperCollider also has a nice frontend - the IDE works great with builtin doc searching, autocompletion, etc.

Sample wrangling becomes pretty thorny quickly as if you are triggering samples you want to make sure they don't "clip"/"pop" when you change them (due to discontinuities between the abrupt stop and the new start). I wrote a SuperCollider tutorial that demo's how to make a really high-quality sample player that takes care of these kinds of things plus gives you lots of control over rates, looping, etc. [1] That was my main hurdle with SuperCollider as that it has surprisingly few tutorials for such a long-running and deep program. Hopefully that helps :)

[1] https://schollz.com/blog/sampler/

qrv3w··on Magic Wormhole: Get things from one computer to another, safely
The free hosting from DigitalOcean is for one year and ends on 12/31 this year. After that the public relay will cost me over $70/month (or maybe more, as that's the current cost covered but it continues to grow). I cannot afford that so around that time I'll try to get donations.
qrv3w··on Magic Wormhole: Get things from one computer to another, safely
croc maintainer here: like mentioned from the throwaway account above - yes, this is true that there was a recent major vulnerability. [1] It was fixed within a week [2], so I guess it is also true that croc has a history of fixing vulnerabilities, rather quickly. I should hope this means that security is taken seriously.

Anyways, croc is pretty similar to wormhole except that it allows resuming files (which wormhole does not yet [3]) and has some peer discovery for local network transfers. I've been using croc everyday for over three years and I'm still very happy with it. But, you should totally use magic-wormhole if that floats your boat - its a great tool, along with psanford's Go version. That may help me actually as I think croc has too many users on the public relay and the cost of bandwidth is becoming too high to keep the public relay available after this year.

[1]: https://redrocket.club/posts/croc/

[2]: https://schollz.com/blog/croc9/

[3]: https://github.com/magic-wormhole/magic-wormhole/issues/88

qrv3w··on X0.at: upload files from cURL
I'll tack on mine as well, which you can self-host: https://github.com/schollz/share

Also there is a cute alias you can do to easily 'share' files:

alias share='f() { curl --progress-bar --upload-file "$1" https://share.schollz.com | tee /dev/null; echo };f'

qrv3w··on Show HN: Who will match my donation?
This site shows an up-to-date list of (hopefully) all accredited non-profits which are currently matching donations.

I was motivated to make this because I found it difficult to find any resource for listing which accredited non-profits were currently matching donations.

The code for this site essentially cross-references all established non-profits on Charity Navigator with their associated Twitter handles and then uses their recent Tweet stream to determine whether they are matching donations.

qrv3w··on TL;DR Rust
This is the first Go-to-Rust post I've seen! Are there others? This one is especially good too, lots of practical examples with their sublety explained well.
qrv3w··on Croc: Easily and securely send things from one computer to another
Sure. I'd be happy to accept a PR if this feature is interested in being added!
qrv3w··on Croc: Easily and securely send things from one computer to another
> but it also means you can't send a file filled with 0's.

I think I was sleepy because I errored in saying that. You can send a file with 0's without a problem.

The only little bug is if you resume a transfer of a file that is filled with zeros then the recipient will re-request blocks it already has (because they are zeros) so that parts of the file get sent twice (worst-case scenario). It is a bug, but a small one IMO that has never manifested in my reality (via issues or my own use). Happy to accept PRs to fix it though!

qrv3w··on Croc: Easily and securely send things from one computer to another
> How does your resumption feature work, cryptographically?

Files are collections of "blocks". This allows files to be read in parallel (reading block at position X) and written in parallel (writing block at position X). Resumption works by having the recipient determine empty blocks (positions filled with 0's) and then requesting the sender to only send required blocks (specified by positions).

This has a trade-off - there are no "progress" files needed (which might not get removed if you don't know about them and don't want to resume) but it also means you can't send a file filled with 0's.

qrv3w··on Croc: Easily and securely send things from one computer to another
Thanks, I appreciate that :)
qrv3w··on Croc: Easily and securely send things from one computer to another
I was inspired by wormhole to make croc. croc does not use the wormhole spec. I found it necessary to diverge from the wormhole spec so I could easily implement features that I find important. AFAIK I've* implemented features in croc that are still not available in wormhole, including:

- resuming transfers [1]

- ipv6 support [2]

- local transfer without public relay [3]

- simple installation for windows [4]

- sending folders without zipping (i.e. send in place) [5]

*some features, like ipv6 support, were generously tested/coded/inspired by others.

[1]: https://github.com/warner/magic-wormhole/issues/88

[2]: https://github.com/warner/magic-wormhole/issues/354

[3]: https://github.com/warner/magic-wormhole/issues/48

[4]: https://github.com/warner/magic-wormhole/issues/208

[5]: https://github.com/warner/magic-wormhole/issues/58

qrv3w··on Croc: Easily and securely send things from one computer to another
> How does the relay server work?

Basically the relay server is a dumb switchboard. It waits for a connection to established with an identifier. When two connections with the same identifier are found, the relay server pipes the data between them.

Security is ensured by having each connection to the relay use PAKE. Once the two clients connected via the relay they establish their own communication securely using PAKE, so neither the relay (nor anyone else) can decipher the transfer.

If you use croc locally, you actually don't use the public relay as the two clients can automatically discover themselves with peer discovery. [1]

> does the developer maintain and fund it out of pocket? That seems to me to be quite costly.

Yes, I've maintain it and funded it out of pocket for a few years. Recently, I've gotten Github sponsor support that helps. [2] It's not too costly.

[1]: https://github.com/schollz/peerdiscovery/

[2]: https://github.com/sponsors/schollz

qrv3w··on Croc: Easily and securely send things from one computer to another
I'm confused about why you wrote "relay code shouldn't be written to only support <10 channels" as any three character combination is a channel?

You mention wormhole doesn't have a problem with colliding channels, but that it requires assigning a channel from the relay. To me this is a trade-off. If wormhole can't connect to a relay, wormhole can't assign a channel and won't work. Whereas, in croc, if you can't connect to the relay it will still work over LAN since the client chooses the channel.

I appreciate this discussion, there's a discussion on Github about this now. [1] Would you mind moving this discussion there?

[1]: https://github.com/schollz/croc/issues/261

qrv3w··on Croc: Easily and securely send things from one computer to another
The first port is for communication, the four other ports are for transferring data in parallel. You can setup a relay to use only two ports (one for comm, one for transfer) but in general I found that the parallel transfer give a little speed-up.
qrv3w··on Croc: Easily and securely send things from one computer to another
The claim is wrong, I didn't know about the rsync compression (-z option, wish it was defaulted). I ran a test using the rsync compression and rsync transferred a little bit faster (~4% faster). croc is faster than wormhole last couple times I tried though. I'll update the readme.
qrv3w··on Croc: Easily and securely send things from one computer to another
> "croc send -c 'xyz blahblahblah' filename" on multiple computers without error

That seemed to be a bug and is fixed now. After two parties enter a channel it should give you a "room is full" response.

> Magic Wormhole works a bit differently. IIRC it dynamically requests a channel from the server which is prepended to the passphrase as a number. This seems a bit more resilient to me, as the birthday problem suggests it's quite likely two people will end up with the same channel just by bad luck with Croc....There are only ~900 different three letter word beginnings in the wordlist, so you'd only need to claim that many channels on the server to make it unusable for anyone who lets Croc pick passwords, and occasional collisions between users are certain. Lol that should probably be fixed.

I think wormhole uses only 99 channels [1] so it is also susceptible to a DOS attack. But generally, collisions in channels can occur but are probably pretty rare because I don't have enough people using croc simultaneously to collide. Importantly - colliding channels doesn't undermine security because you have to have the whole passphrase to successfully perform PAKE. But, when you say it should probably be fixed, you refer to mitigating a DOS attack?

[1]: https://github.com/warner/magic-wormhole/issues/107

qrv3w··on Croc: Easily and securely send things from one computer to another
The receiver and sender find each other using the first three characters of the passphrase to establish a channel to communicate. Once in the channel they perform PAKE which will allow both parties to establish a secure key from the entire passphrase OR it will alert both parties that the passphrases differ and will break the channel (PAKE only works if the passphrase is the same, even if they made it to the same channel).

The sender and receiver know who the relay is beforehand. That is they either use the default relay (baked into the croc binary) or specify another relay.

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
When I measured jitter I found that it was higher in cheaper instruments [1], so I think it might be dependent on the hardware that is listening to the MIDI output.

[1]: https://github.com/schollz/miti/issues/4

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
I would love to hook up multiple - the polymonotron...
qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
Thanks :)

I play piano and I don't find the latency a problem, which means its probably < 100 ms. The midi stuff is actually just bindings to rtmidi (in C++).

The most annoying thing is "jitter" which I calculated to be 15-20 ms, which is fine, but sometimes there are spikes of 50 -150 ms which are annoying.

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
Thanks! That's a neat solution! If I had seen that before, I may not have made miti :)

I found there's other few programming-friendly simple MIDI sequencers [1] but generally none of them were simple enough for me. I'm pretty happy with the simplicity and power behind miti and use it quite a bit for my own purposes. Feel free to ping me if you have issues with it or ideas to improve it!

[1]: https://github.com/schollz/miti/#other-similar-work

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
Yeah, the monotron is monophonic. But you're ear is right on because it does sound like multiple synths - I'm actually augmenting the monotron a bit here using another device called the norns [1] with a script I wrote [2] which converts the initial drone note into a drone covering six different pitches at various volumes (sort of a super saw). After that augmented drone you'll hear an arpeggio which is pure monotron (plus its delay which adds a little polyphony as mentioned).

[1]: https://monome.org/docs/norns/

[2]: https://llllllll.co/t/barcode

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
Thanks for that link, wasn't aware.

For this I used the simplest approach I could think of - using sox [1] with its builtin power spectrum analyzer. It works pretty well as the resulting tuning is fantastic. It would be nice to a faster pitch detector - could speed up tuning from ~15 seconds to maybe just a few seconds.

[1] https://linux.die.net/man/1/sox

qrv3w··on Using a Raspberry Pi to Add MIDI to a CV Synthesizer
I get that my solution is a little more expensive. But, actually the whole thing costs ~$25, not $40, if you buy the three components thriftly (used Pi ~$15, usb audio adapter $5, mcp4725 $5).

In contrast, that link you mentioned has over 15 parts instead of 3 parts, and it needs to be on a PCB/breadboard. The total cost is cheaper (probably $10 if your thrifty) but requires way more effort IMO than using a Pi.

Crucially, I've never seen any MIDI to CV that provides a method for automatic tuning which is very time consuming. Using a Pi provides that easily and automatically with sox.

qrv3w··on Ask HN: What is your favorite method of sending large files?
As BusTrainBus says, "installability" is useful, and it was one of my motivations.

I agree installation for magic wormhole is easy for Mac/Linux, but I think its not easy on Windows. Windows is very common (77% of the market share for desktops [1]) so I wanted to keep croc easy to install for Windows.

In fact, if you are just receiving a file on Windows, all you have to do is download the binary from releases [2], unzip it, and double click on the binary - no terminal experience required. (Sending a file does require using a terminal, but all CLI apps have that hurdle...).

[1]: https://gs.statcounter.com/os-market-share/desktop/worldwide

[2]: https://github.com/schollz/croc/releases

qrv3w··on Ask HN: What is your favorite method of sending large files?
Definitely possible. I'll happily take any PR that does this.
qrv3w··on Ask HN: What is your favorite method of sending large files?
I didn't see this one until now :)
← PreviousPage 2 of 10Next →