From 771f3799f825811f1997b0d4f5d77a9823a6065c Mon Sep 17 00:00:00 2001 From: Bhavin Gandhi Date: Fri, 22 Jan 2021 22:19:14 +0530 Subject: Add subtitles for 35 --- 2020/info/35.md | 4 +- ...c-zmusic--questions--zachary-kanfer-autogen.vtt | 508 -------------- ...ive-music-zmusic--questions--zachary-kanfer.vtt | 490 ++++++++++++++ ...titive-music-zmusic--zachary-kanfer-autogen.vtt | 724 -------------------- ...ive-repetitive-music-zmusic--zachary-kanfer.vtt | 730 +++++++++++++++++++++ 5 files changed, 1222 insertions(+), 1234 deletions(-) delete mode 100644 2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer-autogen.vtt create mode 100644 2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.vtt delete mode 100644 2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer-autogen.vtt create mode 100644 2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.vtt (limited to '2020') diff --git a/2020/info/35.md b/2020/info/35.md index 2901eee9..910a0949 100644 --- a/2020/info/35.md +++ b/2020/info/35.md @@ -1,10 +1,10 @@ # WAVEing at Repetitive Repetitive Repetitive Music Zachary Kanfer -[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.webm"]] +[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.webm" size="122M" subtitles="/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.vtt" duration="9:44"]] [Download compressed .webm video (12.7M)](https://mirror.csclub.uwaterloo.ca/emacsconf/2020/smaller/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer--vp9-q56-video-original-audio.webm) -[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.webm" download="Download Q&A video"]] +[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.webm" download="Download Q&A video" size="89M" subtitles="/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.vtt" duration="6:18"]] [Download compressed Q&A .webm video (6.9M)](https://mirror.csclub.uwaterloo.ca/emacsconf/2020/smaller/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer--vp9-q56-video-original-audio.webm) During quarantine, I found myself spending time with an Android app. diff --git a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer-autogen.vtt b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer-autogen.vtt deleted file mode 100644 index 3c8dd20c..00000000 --- a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer-autogen.vtt +++ /dev/null @@ -1,508 +0,0 @@ -WEBVTT - -00:00:02.800 --> 00:00:09.200 -I can yes - -00:00:09.200 --> 00:00:13.120 -okay um yeah so I'm uh zachary canfer - -00:00:13.120 --> 00:00:14.920 -let's go to the - -00:00:14.920 --> 00:00:17.520 -questions uh the first question uh why - -00:00:17.520 --> 00:00:19.119 -do we go top to bottom for time - -00:00:19.119 --> 00:00:19.840 -progression - -00:00:19.840 --> 00:00:23.920 -uh and left to right uh for low to high - -00:00:23.920 --> 00:00:27.279 -interesting I think uh so the initial - -00:00:27.279 --> 00:00:30.000 -uh thing I was copying that initial app - -00:00:30.000 --> 00:00:31.599 -work this way - -00:00:31.599 --> 00:00:35.280 -um and - -00:00:35.280 --> 00:00:36.960 -yeah I mean certainly traditional music - -00:00:36.960 --> 00:00:38.960 -you know on a staff uh - -00:00:38.960 --> 00:00:43.040 -does go left to right uh like this - -00:00:43.040 --> 00:00:46.000 -um I mean going top to bottom does make - -00:00:46.000 --> 00:00:47.440 -it easier to add more beats without - -00:00:47.440 --> 00:00:48.960 -having to wrap but certainly that could - -00:00:48.960 --> 00:00:49.920 -be managed - -00:00:49.920 --> 00:00:52.239 -um yeah I I had not really thought about - -00:00:52.239 --> 00:00:53.760 -it but it is definitely something worth - -00:00:53.760 --> 00:00:55.199 -looking into - -00:00:55.199 --> 00:01:02.480 -uh yeah you are now unmuted - -00:01:02.480 --> 00:01:05.680 -ah good point thank you let me go ahead - -00:01:05.680 --> 00:01:06.960 -and do that - -00:01:06.960 --> 00:01:14.240 -uh the entire screen - -00:01:14.240 --> 00:01:16.880 -okay so the screen share should be - -00:01:16.880 --> 00:01:18.320 -starting - -00:01:18.320 --> 00:01:21.439 -there we go cool all right uh - -00:01:21.439 --> 00:01:24.880 -two will be placed on the song um not - -00:01:24.880 --> 00:01:26.640 -now I can I can make some recordings of - -00:01:26.640 --> 00:01:28.080 -it or certainly you can try it - -00:01:28.080 --> 00:01:30.720 -um I couldn't quite get the the - -00:01:30.720 --> 00:01:33.119 -microphone and the webcam and everything - -00:01:33.119 --> 00:01:37.040 -to work with the sound playing now um so - -00:01:37.040 --> 00:01:40.079 -uh I can record some also please uh - -00:01:40.079 --> 00:01:43.520 -I put a link at the uh here in the uh - -00:01:43.520 --> 00:01:46.640 -etherpad https://zck.me/emacsconf2020 - -00:01:46.640 --> 00:01:48.479 -where you can go and get the source - -00:01:48.479 --> 00:01:49.920 -and you can try it yourself uh there's - -00:01:49.920 --> 00:01:51.920 -no dependencies needed so it's just all - -00:01:51.920 --> 00:01:54.560 -in Emacs um so please you know try it - -00:01:54.560 --> 00:01:57.040 -yourself - -00:01:57.040 --> 00:02:00.079 -any chance for an Emacs tracker or mod - -00:02:00.079 --> 00:02:01.040 -player - -00:02:01.040 --> 00:02:03.680 -um I don't really know what a mod player - -00:02:03.680 --> 00:02:04.479 -or tracker - -00:02:04.479 --> 00:02:08.000 -are but I mean I'm sure - -00:02:08.000 --> 00:02:09.679 -that would be cool uh maybe there's one - -00:02:09.679 --> 00:02:11.599 -on now but I don't know uh - -00:02:11.599 --> 00:02:13.920 -my musical background so I've played - -00:02:13.920 --> 00:02:15.200 -various instruments since about the - -00:02:15.200 --> 00:02:15.840 -third grade - -00:02:15.840 --> 00:02:18.160 -uh started recorder uh play cello I play - -00:02:18.160 --> 00:02:19.520 -guitar now - -00:02:19.520 --> 00:02:22.560 -um but yeah so just kind of random - -00:02:22.560 --> 00:02:23.680 -instruments and - -00:02:23.680 --> 00:02:26.959 -uh yeah I guess kind of some of those - -00:02:26.959 --> 00:02:27.280 -things - -00:02:27.280 --> 00:02:30.480 -influence how I think about music um - -00:02:30.480 --> 00:02:33.519 -uh yeah um - -00:02:33.519 --> 00:02:35.360 -are there any open source musical - -00:02:35.360 --> 00:02:36.640 -management sample libraries that could - -00:02:36.640 --> 00:02:37.840 -be used - -00:02:37.840 --> 00:02:41.200 -um good question I'm sure there are um I - -00:02:41.200 --> 00:02:42.400 -don't know any that integrate really - -00:02:42.400 --> 00:02:43.360 -well with Emacs - -00:02:43.360 --> 00:02:44.560 -one of the cool things that I liked - -00:02:44.560 --> 00:02:45.680 -about this is that there are no - -00:02:45.680 --> 00:02:47.440 -dependencies - -00:02:47.440 --> 00:02:49.360 -you know you don't need any external - -00:02:49.360 --> 00:02:50.800 -program to - -00:02:50.800 --> 00:02:53.040 -uh generate the music I mean it it does - -00:02:53.040 --> 00:02:54.160 -shell out to - -00:02:54.160 --> 00:02:57.280 -to play um but that - -00:02:57.280 --> 00:02:58.640 -should be able to be done on any - -00:02:58.640 --> 00:02:59.840 -operating system as always you have - -00:02:59.840 --> 00:03:03.519 -something that can play wav files - -00:03:03.519 --> 00:03:05.599 -um but yeah it is interesting to kind of - -00:03:05.599 --> 00:03:06.879 -try the different - -00:03:06.879 --> 00:03:10.000 -uh different sounds and different - -00:03:10.000 --> 00:03:12.239 -tones uh that you could get with - -00:03:12.239 --> 00:03:14.400 -different instruments - -00:03:14.400 --> 00:03:16.959 -have I written any actual songs um - -00:03:16.959 --> 00:03:17.599 -nothing - -00:03:17.599 --> 00:03:21.040 -super uh - -00:03:21.040 --> 00:03:23.680 -uh well put together just I kind of just - -00:03:23.680 --> 00:03:25.519 -been playing around with this - -00:03:25.519 --> 00:03:27.440 -it's kind of I making this was one of - -00:03:27.440 --> 00:03:29.040 -those things where like once I made it I - -00:03:29.040 --> 00:03:30.080 -was like okay - -00:03:30.080 --> 00:03:31.280 -now I can play with it and I did a - -00:03:31.280 --> 00:03:32.720 -little bit and was like I don't know if - -00:03:32.720 --> 00:03:33.920 -I feel like it right now - -00:03:33.920 --> 00:03:37.280 -you know which I've I've found that to - -00:03:37.280 --> 00:03:38.720 -be the case with some things that I've - -00:03:38.720 --> 00:03:39.599 -implemented - -00:03:39.599 --> 00:03:41.360 -in Emacs where it's I make it and then - -00:03:41.360 --> 00:03:43.519 -it's the kind of some of the desire to - -00:03:43.519 --> 00:03:44.480 -use it all the time - -00:03:44.480 --> 00:03:46.879 -goes away but I'm sure I'll circle back - -00:03:46.879 --> 00:03:47.760 -around - -00:03:47.760 --> 00:03:51.040 -at some point especially kind of maybe - -00:03:51.040 --> 00:03:52.400 -once I add in different tones or - -00:03:52.400 --> 00:03:54.640 -something - -00:03:54.640 --> 00:03:56.400 -I guess a similar question for - -00:03:56.400 --> 00:03:57.840 -pre-recorded sounds yeah I mean - -00:03:57.840 --> 00:04:01.120 -if it's part of what I did what I wrote - -00:04:01.120 --> 00:04:02.080 -was a - -00:04:02.080 --> 00:04:04.720 -wave generation library so if you kind - -00:04:04.720 --> 00:04:06.720 -of have the data - -00:04:06.720 --> 00:04:08.400 -you could use those and like chop them - -00:04:08.400 --> 00:04:10.159 -up and take certain lengths of them - -00:04:10.159 --> 00:04:13.360 -and make a wav file so it's not plug and - -00:04:13.360 --> 00:04:14.959 -play right now but you could certainly - -00:04:14.959 --> 00:04:19.120 -add those notes uh to do it - -00:04:19.120 --> 00:04:21.040 -um any knitting midi mapping - -00:04:21.040 --> 00:04:22.720 -possibilities um - -00:04:22.720 --> 00:04:24.560 -I haven't looked into it but I'm sure - -00:04:24.560 --> 00:04:26.160 -you definitely could output to midi - -00:04:26.160 --> 00:04:28.800 -um which is another benefit of having - -00:04:28.800 --> 00:04:30.400 -that multiple layers with the top layer - -00:04:30.400 --> 00:04:31.520 -is just like - -00:04:31.520 --> 00:04:33.360 -um you know if the root note is this - -00:04:33.360 --> 00:04:35.120 -we're just two semitones up or seven - -00:04:35.120 --> 00:04:36.560 -semitones up or whatever it is - -00:04:36.560 --> 00:04:38.160 -uh it should be relatively simple to - -00:04:38.160 --> 00:04:40.720 -kind of switch out that layer underneath - -00:04:40.720 --> 00:04:44.479 -uh from wave to midi or other things - -00:04:44.479 --> 00:04:45.759 -what were some of the challenges with - -00:04:45.759 --> 00:04:47.520 -writing a special mode for Emacs - -00:04:47.520 --> 00:04:49.759 -uh interested in getting into this not - -00:04:49.759 --> 00:04:51.040 -sure where to start - -00:04:51.040 --> 00:04:54.960 -um there uh yeah it so - -00:04:54.960 --> 00:04:57.120 -this isn't the first mode I've written - -00:04:57.120 --> 00:04:58.320 -um so that's right - -00:04:58.320 --> 00:05:01.759 -certainly that helps um I actually - -00:05:01.759 --> 00:05:05.600 -um I have a video that we recorded it - -00:05:05.600 --> 00:05:08.240 -as part of Emacs nyc on making a major - -00:05:08.240 --> 00:05:09.039 -mode - -00:05:09.039 --> 00:05:10.720 -that's basically like starts from - -00:05:10.720 --> 00:05:12.639 -nothing and kind of builds up to - -00:05:12.639 --> 00:05:15.680 -an implementation of tic-tac-toe um - -00:05:15.680 --> 00:05:17.039 -but so it kind of goes into printing - -00:05:17.039 --> 00:05:19.600 -things out and buttons and making the - -00:05:19.600 --> 00:05:21.280 -mode - -00:05:21.280 --> 00:05:22.800 -I mean one of the best parts about Emacs - -00:05:22.800 --> 00:05:24.560 -is because it's so - -00:05:24.560 --> 00:05:26.479 -uh configurable and so introspectible - -00:05:26.479 --> 00:05:28.479 -you can start pretty simply - -00:05:28.479 --> 00:05:30.320 -and just kind of asking max about things - -00:05:30.320 --> 00:05:32.320 -and then make one little - -00:05:32.320 --> 00:05:34.960 -change um it's really it's not that bad - -00:05:34.960 --> 00:05:36.479 -so uh - -00:05:36.479 --> 00:05:39.039 -I'll try to throw a link up on that uh - -00:05:39.039 --> 00:05:40.560 -on on that page I put up or - -00:05:40.560 --> 00:05:42.000 -please email me for whoever asked this - -00:05:42.000 --> 00:05:44.479 -question uh to get a link to that video - -00:05:44.479 --> 00:05:46.240 -um or just look at look at the source - -00:05:46.240 --> 00:05:47.919 -code of this or any other major mode - -00:05:47.919 --> 00:05:50.479 -um it it's pretty ems breaks it makes it - -00:05:50.479 --> 00:05:52.880 -pretty easy to extend uh - -00:05:52.880 --> 00:05:56.479 -major modes and I think that's that's - -00:05:56.479 --> 00:05:57.600 -the last question - -00:05:57.600 --> 00:06:00.240 -in the ether pad so uh thanks so much - -00:06:00.240 --> 00:06:02.479 -everybody for coming - -00:06:02.479 --> 00:06:06.720 -you are now unmuted uh thank you so much - -00:06:06.720 --> 00:06:09.039 -to curry for your awesome talk - -00:06:09.039 --> 00:06:12.960 -and for doing live questions - -00:06:12.960 --> 00:06:19.840 -thank you thank you cheers diff --git a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.vtt b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.vtt new file mode 100644 index 00000000..c60bd115 --- /dev/null +++ b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--questions--zachary-kanfer.vtt @@ -0,0 +1,490 @@ +WEBVTT + +00:00:02.800 --> 00:00:09.200 +I can, yes. + +00:00:09.200 --> 00:00:13.120 +Okay, yeah, so I'm Zachary Kanfer, + +00:00:13.120 --> 00:00:14.920 +let's go to the + +00:00:14.920 --> 00:00:17.520 +questions. The first question, "Why + +00:00:17.520 --> 00:00:19.119 +do we go top to bottom for time + +00:00:19.119 --> 00:00:19.840 +progression, + +00:00:19.840 --> 00:00:23.920 +and left to right for low to high?" + +00:00:23.920 --> 00:00:27.279 +Interesting, I think…, so the initial + +00:00:27.279 --> 00:00:30.000 +thing I was copying, that initial app + +00:00:30.000 --> 00:00:35.280 +work this way, and + +00:00:35.280 --> 00:00:36.960 +yeah, I mean, certainly traditional music, + +00:00:36.960 --> 00:00:38.960 +you know, on a staff + +00:00:38.960 --> 00:00:43.040 +does go left to right like this. + +00:00:43.040 --> 00:00:46.000 +I mean, going top to bottom does make + +00:00:46.000 --> 00:00:47.440 +it easier to add more beats without + +00:00:47.440 --> 00:00:48.960 +having to wrap, but certainly that could + +00:00:48.960 --> 00:00:49.920 +be managed. + +00:00:49.920 --> 00:00:52.239 +Yeah, I had not really thought about + +00:00:52.239 --> 00:00:53.760 +it, but it is definitely something worth + +00:00:53.760 --> 00:00:55.199 +looking into. + +00:00:55.199 --> 00:01:02.480 +Yeah. + +00:01:02.480 --> 00:01:05.680 +Ah, good point, thank you. Let me go ahead + +00:01:05.680 --> 00:01:06.960 +and do that. + +00:01:06.960 --> 00:01:14.240 +The entire screen… + +00:01:14.240 --> 00:01:16.880 +Okay, so the screen share should be + +00:01:16.880 --> 00:01:18.320 +starting, + +00:01:18.320 --> 00:01:21.439 +there we go. Cool, all right. + +00:01:21.439 --> 00:01:24.880 +Two, "Will you play us another song?" Not + +00:01:24.880 --> 00:01:26.640 +now, I can make some recordings of + +00:01:26.640 --> 00:01:28.080 +it, or certainly you can try it. + +00:01:28.080 --> 00:01:30.720 +I couldn't quite get the + +00:01:30.720 --> 00:01:33.119 +microphone and the webcam and everything + +00:01:33.119 --> 00:01:37.040 +to work with the sound playing now. So, + +00:01:37.040 --> 00:01:40.079 +I can record some. Also, please… + +00:01:40.079 --> 00:01:43.520 +I have put a link at the… here in the + +00:01:43.520 --> 00:01:46.640 +Etherpad, zck.org/emacsconf2020 [updated], + +00:01:46.640 --> 00:01:48.479 +where you can go and get the source, + +00:01:48.479 --> 00:01:49.920 +and you can try it yourself. There's + +00:01:49.920 --> 00:01:51.920 +no dependencies needed, so it's just all + +00:01:51.920 --> 00:01:54.560 +in Emacs. So, please, you know, try it + +00:01:54.560 --> 00:01:57.040 +yourself. + +00:01:57.040 --> 00:02:00.079 +"Any chance for an Emacs tracker or mod + +00:02:00.079 --> 00:02:01.040 +player?" + +00:02:01.040 --> 00:02:03.680 +I don't really know what a mod player + +00:02:03.680 --> 00:02:04.479 +or tracker + +00:02:04.479 --> 00:02:08.000 +are, but I mean, I'm sure + +00:02:08.000 --> 00:02:09.679 +that would be cool, maybe there's one + +00:02:09.679 --> 00:02:11.599 +on now, but I don't know. + +00:02:11.599 --> 00:02:13.920 +My musical background. So, I've played + +00:02:13.920 --> 00:02:15.200 +various instruments since about the + +00:02:15.200 --> 00:02:15.840 +third grade. + +00:02:15.840 --> 00:02:18.160 +Started recorder, play cello, I play + +00:02:18.160 --> 00:02:19.520 +guitar now. + +00:02:19.520 --> 00:02:22.560 +But yeah, so just kind of random + +00:02:22.560 --> 00:02:23.680 +instruments, and + +00:02:23.680 --> 00:02:26.959 +I guess kind of some of those + +00:02:26.959 --> 00:02:27.280 +things + +00:02:27.280 --> 00:02:30.480 +influence how I think about music. + +00:02:33.519 --> 00:02:35.360 +"Are there any open source musical + +00:02:35.360 --> 00:02:36.640 +management sample libraries that could + +00:02:36.640 --> 00:02:37.840 +be used?" + +00:02:37.840 --> 00:02:41.200 +Good question, I'm sure there are, I + +00:02:41.200 --> 00:02:42.400 +don't know any of that integrate really + +00:02:42.400 --> 00:02:43.360 +well with Emacs. + +00:02:43.360 --> 00:02:44.560 +One of the cool things that I liked + +00:02:44.560 --> 00:02:45.680 +about this is that there are no + +00:02:45.680 --> 00:02:47.440 +dependencies, + +00:02:47.440 --> 00:02:49.360 +you know, you don't need any external + +00:02:49.360 --> 00:02:50.800 +program to + +00:02:50.800 --> 00:02:53.040 +generate the music. I mean, it does + +00:02:53.040 --> 00:02:54.160 +shell out to + +00:02:54.160 --> 00:02:57.280 +to play, but that + +00:02:57.280 --> 00:02:58.640 +should be able to be done on any + +00:02:58.640 --> 00:02:59.840 +operating system, as always, you have + +00:02:59.840 --> 00:03:03.519 +something that can play WAVE files, + +00:03:03.519 --> 00:03:05.599 +but yeah, it is interesting to kind of + +00:03:05.599 --> 00:03:10.000 +try the different sounds and different + +00:03:10.000 --> 00:03:12.239 +tones that you could get with + +00:03:12.239 --> 00:03:14.400 +different instruments. + +00:03:14.400 --> 00:03:16.959 +Have I written any actual songs? + +00:03:16.959 --> 00:03:21.040 +Nothing super + +00:03:21.040 --> 00:03:23.680 +well put together, I kind of just + +00:03:23.680 --> 00:03:25.519 +been playing around with this. + +00:03:25.519 --> 00:03:27.440 +It's kind of… making this was one of + +00:03:27.440 --> 00:03:29.040 +those things where once I made it, I + +00:03:29.040 --> 00:03:30.080 +was like, okay, + +00:03:30.080 --> 00:03:31.280 +now I can play with it, and I did a + +00:03:31.280 --> 00:03:32.720 +little bit, and was like, I don't know if + +00:03:32.720 --> 00:03:33.920 +I feel like it right now. + +00:03:33.920 --> 00:03:37.280 +You know, which I've found that to + +00:03:37.280 --> 00:03:38.720 +be the case with some things that I've + +00:03:38.720 --> 00:03:39.599 +implemented + +00:03:39.599 --> 00:03:41.360 +in Emacs where it's… I make it, and then + +00:03:41.360 --> 00:03:43.519 +it's the kind of some of the desire to + +00:03:43.519 --> 00:03:44.480 +use it all the time + +00:03:44.480 --> 00:03:46.879 +goes away, but I'm sure I'll circle back + +00:03:46.879 --> 00:03:47.760 +around + +00:03:47.760 --> 00:03:51.040 +at some point especially kind of maybe + +00:03:51.040 --> 00:03:52.400 +once I add in different tones or + +00:03:52.400 --> 00:03:54.640 +something. + +00:03:54.640 --> 00:03:56.400 +I guess a similar question for + +00:03:56.400 --> 00:03:57.840 +pre-recorded sounds. Yeah, I mean, + +00:03:57.840 --> 00:04:01.120 +if it's… part of what I did, what I wrote + +00:04:01.120 --> 00:04:02.080 +was a + +00:04:02.080 --> 00:04:04.720 +WAVE generation library, so, if you kind + +00:04:04.720 --> 00:04:06.720 +of have the data, + +00:04:06.720 --> 00:04:08.400 +you could use those and chop them + +00:04:08.400 --> 00:04:10.159 +up and take certain lengths of them + +00:04:10.159 --> 00:04:13.360 +and make a WAVE file, so it's not plug and + +00:04:13.360 --> 00:04:14.959 +play right now, but you could certainly + +00:04:14.959 --> 00:04:19.120 +add those notes to do it. + +00:04:19.120 --> 00:04:22.720 +"Any MIDI mapping possibilities?" + +00:04:22.720 --> 00:04:24.560 +I haven't looked into it, but I'm sure + +00:04:24.560 --> 00:04:26.160 +you definitely could output to MIDI + +00:04:26.160 --> 00:04:28.800 +which is another benefit of having + +00:04:28.800 --> 00:04:30.400 +that multiple layers with the top layer + +00:04:30.400 --> 00:04:31.520 +is just, + +00:04:31.520 --> 00:04:33.360 +you know, if the root note is this, + +00:04:33.360 --> 00:04:35.120 +we're just two semitones up or seven + +00:04:35.120 --> 00:04:36.560 +semitones up or whatever it is. + +00:04:36.560 --> 00:04:38.160 +It should be relatively simple to + +00:04:38.160 --> 00:04:40.720 +kind of switch out that layer underneath + +00:04:40.720 --> 00:04:44.479 +from WAVE to MIDI or other things. + +00:04:44.479 --> 00:04:45.759 +"What were some of the challenges with + +00:04:45.759 --> 00:04:47.520 +writing a special mode for Emacs?" + +00:04:47.520 --> 00:04:49.759 +Interested in getting into this, not + +00:04:49.759 --> 00:04:51.040 +sure where to start. + +00:04:51.040 --> 00:04:54.960 +There… yeah, it so… + +00:04:54.960 --> 00:04:57.120 +this isn't the first mode I've written, + +00:04:57.120 --> 00:04:58.320 +so that's right…, + +00:04:58.320 --> 00:05:01.759 +certainly that helps. I actually… + +00:05:01.759 --> 00:05:05.600 +I have a video that we recorded it + +00:05:05.600 --> 00:05:08.240 +as part of EmacsNYC on making a major + +00:05:08.240 --> 00:05:09.039 +mode. + +00:05:09.039 --> 00:05:10.720 +That's basically starts from + +00:05:10.720 --> 00:05:12.639 +nothing, and kind of builds up to + +00:05:12.639 --> 00:05:15.680 +an implementation of tic-tac-toe, + +00:05:15.680 --> 00:05:17.039 +but so it kind of goes into printing + +00:05:17.039 --> 00:05:19.600 +things out and buttons and making the + +00:05:19.600 --> 00:05:21.280 +mode. + +00:05:21.280 --> 00:05:22.800 +I mean, one of the best parts about Emacs + +00:05:22.800 --> 00:05:24.560 +is, because it's so + +00:05:24.560 --> 00:05:26.479 +configurable and so introspectible, + +00:05:26.479 --> 00:05:28.479 +you can start pretty simply, + +00:05:28.479 --> 00:05:30.320 +and just kind of ask Emacs about things, + +00:05:30.320 --> 00:05:32.320 +and then make one little + +00:05:32.320 --> 00:05:34.960 +change. It's really… it's not that bad, + +00:05:34.960 --> 00:05:39.039 +so, I'll try to throw a link up on that + +00:05:39.039 --> 00:05:40.560 +page I put up, or + +00:05:40.560 --> 00:05:42.000 +please email me for whoever asked this + +00:05:42.000 --> 00:05:44.479 +question to get a link to that video, + +00:05:44.479 --> 00:05:46.240 +or just look at the source + +00:05:46.240 --> 00:05:47.919 +code of this or any other major mode. + +00:05:47.919 --> 00:05:50.479 +Emacs makes it + +00:05:50.479 --> 00:05:52.880 +pretty easy to extend + +00:05:52.880 --> 00:05:56.479 +major modes. And I think that's + +00:05:56.479 --> 00:05:57.600 +the last question + +00:05:57.600 --> 00:06:00.240 +in the Etherpad, so, thanks so much + +00:06:00.240 --> 00:06:02.479 +everybody for coming. + +00:06:04.033 --> 00:06:06.720 +(Amin: Thank you so much + +00:06:06.720 --> 00:06:09.039 +to Zachary for your awesome talk, + +00:06:09.039 --> 00:06:12.960 +and for doing live questions. + +00:06:12.960 --> 00:06:19.840 +Thank you.) Thank you. (Amin: Cheers.) diff --git a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer-autogen.vtt b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer-autogen.vtt deleted file mode 100644 index 8fce6e98..00000000 --- a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer-autogen.vtt +++ /dev/null @@ -1,724 +0,0 @@ -WEBVTT - -00:00:04.080 --> 00:00:04.960 -hi - -00:00:04.960 --> 00:00:08.559 -i'm zachary canfer and this is waving - -00:00:08.559 --> 00:00:11.679 -and repetitive repetitive repetitive - -00:00:11.679 --> 00:00:15.759 -music over quarantine i've been bored - -00:00:15.759 --> 00:00:18.400 -and i found this android app that has a - -00:00:18.400 --> 00:00:19.680 -bunch of mini games - -00:00:19.680 --> 00:00:23.519 -one of which lets you compose music - -00:00:23.519 --> 00:00:26.640 -and it works but i - -00:00:26.640 --> 00:00:28.160 -want a little bit more functionality - -00:00:28.160 --> 00:00:30.720 -than it offers it's not very flexible - -00:00:30.720 --> 00:00:33.760 -so i thought what if i made this - -00:00:33.760 --> 00:00:35.360 -what and what programs could i make this - -00:00:35.360 --> 00:00:37.760 -in that are really flexible are really - -00:00:37.760 --> 00:00:40.320 -customizable - -00:00:40.320 --> 00:00:44.239 -emacs so i looked into it and - -00:00:44.239 --> 00:00:46.320 -emacs can play sounds right if you hit - -00:00:46.320 --> 00:00:47.840 -control g a couple times you'll hear - -00:00:47.840 --> 00:00:49.760 -like an error tone - -00:00:49.760 --> 00:00:51.360 -and it turns out that that is actually - -00:00:51.360 --> 00:00:54.559 -playing a wave file - -00:00:54.559 --> 00:00:58.960 -but what's a wave file - -00:00:58.960 --> 00:01:01.920 -well it turns out that wave is a musical - -00:01:01.920 --> 00:01:03.440 -file format - -00:01:03.440 --> 00:01:07.840 -or really an annoying file format - -00:01:07.840 --> 00:01:12.080 -so data in it can be an unsigned integer - -00:01:12.080 --> 00:01:15.360 -or a science integer it's not consistent - -00:01:15.360 --> 00:01:17.920 -and it's little ending by default which - -00:01:17.920 --> 00:01:20.320 -is not the way i like to think about it - -00:01:20.320 --> 00:01:23.200 -now you can set a wav file to be big - -00:01:23.200 --> 00:01:25.200 -endian but if you do that - -00:01:25.200 --> 00:01:28.640 -emacs can't play it so little ending it - -00:01:28.640 --> 00:01:30.479 -is - -00:01:30.479 --> 00:01:33.520 -there's also duplicate data fields - -00:01:33.520 --> 00:01:35.360 -here are some fields that are fine but - -00:01:35.360 --> 00:01:36.960 -then there's a fourth field that's - -00:01:36.960 --> 00:01:38.960 -calculated based on multiplying two of - -00:01:38.960 --> 00:01:40.799 -the other ones together - -00:01:40.799 --> 00:01:42.399 -and then there's another data field - -00:01:42.399 --> 00:01:44.880 -that's you multiply those three ones - -00:01:44.880 --> 00:01:48.479 -together so it's just repetitive and - -00:01:48.479 --> 00:01:50.479 -unnecessary but you have to do it or - -00:01:50.479 --> 00:01:54.159 -it's not a valid wave file - -00:01:54.159 --> 00:01:56.479 -also the last part of the file is - -00:01:56.479 --> 00:01:58.159 -described as data - -00:01:58.159 --> 00:02:01.759 -or as one website i found said - -00:02:01.759 --> 00:02:05.200 -the actual sound data now - -00:02:05.200 --> 00:02:06.960 -i don't know about you but when i see - -00:02:06.960 --> 00:02:09.039 -that i think - -00:02:09.039 --> 00:02:12.080 -what is a data it turns out - -00:02:12.080 --> 00:02:15.120 -that sound is just a wave and - -00:02:15.120 --> 00:02:17.760 -the data is just a bunch of measurements - -00:02:17.760 --> 00:02:19.120 -of the height of that wave forming each - -00:02:19.120 --> 00:02:20.400 -sample - -00:02:20.400 --> 00:02:24.480 -so this wave starts at 8 goes 9 11 13 - -00:02:24.480 --> 00:02:27.840 -14 15 and then back down and if you just - -00:02:27.840 --> 00:02:29.520 -take those measurements those numbers - -00:02:29.520 --> 00:02:32.080 -put them in a file that's all your data - -00:02:32.080 --> 00:02:35.200 -is - -00:02:35.200 --> 00:02:36.560 -all right let's go to a demo of my - -00:02:36.560 --> 00:02:38.959 -program - -00:02:38.959 --> 00:02:41.920 -so this is what z music looks like the - -00:02:41.920 --> 00:02:44.080 -blue highlighted row is a single beat - -00:02:44.080 --> 00:02:48.319 -there's 16 of them in this z music file - -00:02:48.319 --> 00:02:52.000 -and each dash in the row - -00:02:52.000 --> 00:02:55.040 -is a single note increasing starting - -00:02:55.040 --> 00:02:57.920 -really low all the way on the left and - -00:02:57.920 --> 00:02:58.959 -going up - -00:02:58.959 --> 00:03:01.680 -as we go to the right so if we started - -00:03:01.680 --> 00:03:02.400 -playing - -00:03:02.400 --> 00:03:05.040 -we won't hear anything but we'll see the - -00:03:05.040 --> 00:03:06.400 -highlighted beat is the currently - -00:03:06.400 --> 00:03:07.680 -playing one - -00:03:07.680 --> 00:03:11.120 -and we see that it loops so we can stop - -00:03:11.120 --> 00:03:12.720 -it - -00:03:12.720 --> 00:03:30.879 -and now we can click to add some notes - -00:03:30.879 --> 00:03:33.120 -even more than one note at the same time - -00:03:33.120 --> 00:03:43.920 -works - -00:03:43.920 --> 00:03:56.160 -and we can even add notes while it's - -00:03:56.160 --> 00:03:58.840 -[Applause] - -00:03:58.840 --> 00:04:00.150 -playing - -00:04:00.150 --> 00:04:08.239 -[Applause] - -00:04:08.239 --> 00:04:10.480 -okay here are some other features that i - -00:04:10.480 --> 00:04:12.959 -didn't have time to demo - -00:04:12.959 --> 00:04:16.000 -so you can save the music to a file and - -00:04:16.000 --> 00:04:18.239 -this is interesting because normally - -00:04:18.239 --> 00:04:20.880 -if there's no note in a beat we just - -00:04:20.880 --> 00:04:22.800 -don't play that beat - -00:04:22.800 --> 00:04:24.639 -but if you're writing to a file you have - -00:04:24.639 --> 00:04:25.919 -to put something in - -00:04:25.919 --> 00:04:27.840 -so when it's playing it knows to not - -00:04:27.840 --> 00:04:31.360 -make a sound there - -00:04:31.360 --> 00:04:34.479 -we can also use different scales we're - -00:04:34.479 --> 00:04:36.240 -using the minor pentatonic - -00:04:36.240 --> 00:04:38.080 -in the demo but you can use the major - -00:04:38.080 --> 00:04:39.680 -scale the minor scale - -00:04:39.680 --> 00:04:42.400 -or anything else and there's also - -00:04:42.400 --> 00:04:44.400 -keyboard support but it sounds really - -00:04:44.400 --> 00:04:45.199 -bad - -00:04:45.199 --> 00:04:48.240 -and i'll explain why later - -00:04:48.240 --> 00:04:50.800 -here are some things i learned while - -00:04:50.800 --> 00:04:53.520 -writing z music - -00:04:53.520 --> 00:04:56.479 -emacs has buttons which are great as - -00:04:56.479 --> 00:04:58.240 -long - -00:04:58.240 --> 00:04:59.919 -as you don't put two of them right next - -00:04:59.919 --> 00:05:02.160 -to each other so if you do that - -00:05:02.160 --> 00:05:04.400 -mousing over one of them highlights both - -00:05:04.400 --> 00:05:06.160 -of them - -00:05:06.160 --> 00:05:07.919 -now that's because a button is really - -00:05:07.919 --> 00:05:10.080 -just a series of characters with a text - -00:05:10.080 --> 00:05:11.680 -property to highlight them - -00:05:11.680 --> 00:05:15.120 -so the fix is you put another character - -00:05:15.120 --> 00:05:16.479 -between the two buttons - -00:05:16.479 --> 00:05:18.080 -then mousing over one of them only - -00:05:18.080 --> 00:05:19.759 -highlights the one you want - -00:05:19.759 --> 00:05:21.600 -but even this doesn't work really great - -00:05:21.600 --> 00:05:22.800 -for z music - -00:05:22.800 --> 00:05:25.440 -because the music has a lot of very - -00:05:25.440 --> 00:05:27.120 -small buttons in a row - -00:05:27.120 --> 00:05:29.840 -so it's really easy to accidentally put - -00:05:29.840 --> 00:05:31.600 -your cursor over the space - -00:05:31.600 --> 00:05:34.639 -and click on that instead of the button - -00:05:34.639 --> 00:05:37.120 -so i looked into unicode and i found - -00:05:37.120 --> 00:05:38.160 -this character called - -00:05:38.160 --> 00:05:40.800 -a zero width space so we should be able - -00:05:40.800 --> 00:05:42.560 -to put that between buttons and not be - -00:05:42.560 --> 00:05:45.120 -able to accidentally click on it - -00:05:45.120 --> 00:05:46.960 -unfortunately a zeroth space isn't - -00:05:46.960 --> 00:05:50.080 -actually zero width - -00:05:50.080 --> 00:05:51.680 -if we put a hundred of them between two - -00:05:51.680 --> 00:05:53.759 -other characters you can see there's - -00:05:53.759 --> 00:05:54.880 -space there - -00:05:54.880 --> 00:05:56.240 -and i think what's happening is the - -00:05:56.240 --> 00:05:58.160 -space is zero width - -00:05:58.160 --> 00:06:01.360 -but then emax put uses one pixel between - -00:06:01.360 --> 00:06:02.800 -each pair of characters - -00:06:02.800 --> 00:06:08.080 -for the cursor so it's almost zero width - -00:06:08.080 --> 00:06:09.919 -some ways to play sound that don't quite - -00:06:09.919 --> 00:06:12.960 -work play sound plays music - -00:06:12.960 --> 00:06:14.800 -but it blocks you can't do things like - -00:06:14.800 --> 00:06:17.280 -set other notes or even pause the music - -00:06:17.280 --> 00:06:19.600 -and if you throw it into async.el it's - -00:06:19.600 --> 00:06:21.600 -silent and i don't know why - -00:06:21.600 --> 00:06:24.479 -so the solution i went with is taking - -00:06:24.479 --> 00:06:25.440 -that wav file - -00:06:25.440 --> 00:06:27.039 -ran into the file system and then - -00:06:27.039 --> 00:06:29.199 -shelling out to a native executable to - -00:06:29.199 --> 00:06:30.639 -play the sound - -00:06:30.639 --> 00:06:32.880 -and that works fine as long as you only - -00:06:32.880 --> 00:06:34.240 -do it once - -00:06:34.240 --> 00:06:36.080 -because if you do it a couple times at - -00:06:36.080 --> 00:06:37.600 -the same time like if you have a chord - -00:06:37.600 --> 00:06:38.639 -and you want to play three notes - -00:06:38.639 --> 00:06:40.000 -simultaneously - -00:06:40.000 --> 00:06:42.319 -you get this weird interference and - -00:06:42.319 --> 00:06:43.680 -that's actually why the keyboard from - -00:06:43.680 --> 00:06:46.319 -before didn't work - -00:06:46.319 --> 00:06:49.199 -also side effects have this unexpected - -00:06:49.199 --> 00:06:50.240 -impact - -00:06:50.240 --> 00:06:53.039 -uh when you saw the demo it was running - -00:06:53.039 --> 00:06:55.120 -pretty smoothly - -00:06:55.120 --> 00:06:57.680 -but if i just add one message statement - -00:06:57.680 --> 00:06:58.479 -every beat for - -00:06:58.479 --> 00:07:00.960 -debugging purposes i was getting lag and - -00:07:00.960 --> 00:07:03.759 -jitter - -00:07:03.759 --> 00:07:05.440 -here's the one thing i learned about - -00:07:05.440 --> 00:07:08.319 -music theory music theory - -00:07:08.319 --> 00:07:11.599 -is not easy to program - -00:07:11.599 --> 00:07:12.880 -i was looking around to see what - -00:07:12.880 --> 00:07:15.440 -concepts we can use to code the scales - -00:07:15.440 --> 00:07:16.080 -to code the - -00:07:16.080 --> 00:07:18.160 -notes the first thing that i saw is - -00:07:18.160 --> 00:07:20.240 -scale degrees - -00:07:20.240 --> 00:07:23.360 -and this when i looked into it you don't - -00:07:23.360 --> 00:07:26.319 -want to program in scale degrees - -00:07:26.319 --> 00:07:28.240 -so you see we have the first second - -00:07:28.240 --> 00:07:29.759 -third fourth fifth sixth seventh but - -00:07:29.759 --> 00:07:32.080 -then it wraps around that octave up - -00:07:32.080 --> 00:07:33.919 -is also a first and that's because both - -00:07:33.919 --> 00:07:36.000 -of those notes are c - -00:07:36.000 --> 00:07:38.479 -uh so that didn't work and also you - -00:07:38.479 --> 00:07:39.759 -couldn't really easily - -00:07:39.759 --> 00:07:43.599 -specify a flat or sharp you could say - -00:07:43.599 --> 00:07:47.680 -a sharp third uh or - -00:07:47.680 --> 00:07:50.879 -you know a flat seventh or whatever but - -00:07:50.879 --> 00:07:52.319 -then you kind of have these two pieces - -00:07:52.319 --> 00:07:53.759 -of data that indicate the note and i - -00:07:53.759 --> 00:07:55.840 -didn't i didn't love that - -00:07:55.840 --> 00:07:57.440 -so i looked a little looked again and i - -00:07:57.440 --> 00:07:59.280 -found intervals - -00:07:59.280 --> 00:08:01.120 -and then i thought about it and you - -00:08:01.120 --> 00:08:02.080 -don't really want to program in - -00:08:02.080 --> 00:08:03.440 -intervals either - -00:08:03.440 --> 00:08:05.520 -it fixes some of the problems with scale - -00:08:05.520 --> 00:08:07.039 -degrees you see - -00:08:07.039 --> 00:08:08.319 -all the way on the right you have an - -00:08:08.319 --> 00:08:10.319 -octave so you wrap to 8 and you - -00:08:10.319 --> 00:08:13.039 -go 9 10 and that works but you solve the - -00:08:13.039 --> 00:08:14.319 -same problem you see you have a major - -00:08:14.319 --> 00:08:16.400 -third but below we also have a minor - -00:08:16.400 --> 00:08:18.080 -third so you saw that problem of having - -00:08:18.080 --> 00:08:20.160 -two pieces of information - -00:08:20.160 --> 00:08:23.360 -uh so i thought about it music's really - -00:08:23.360 --> 00:08:27.120 -frequencies like an a is 440 hertz - -00:08:27.120 --> 00:08:28.400 -so at a low level that's what we're - -00:08:28.400 --> 00:08:29.360 -going to do we're just going to use - -00:08:29.360 --> 00:08:30.560 -frequencies - -00:08:30.560 --> 00:08:32.800 -and then at the one level above that uh - -00:08:32.800 --> 00:08:34.159 -that's a little bit easier for humans to - -00:08:34.159 --> 00:08:35.360 -think about - -00:08:35.360 --> 00:08:37.039 -we're going to use semitones up from the - -00:08:37.039 --> 00:08:39.519 -root which is kind of like scale degrees - -00:08:39.519 --> 00:08:40.959 -but instead of just counting each note - -00:08:40.959 --> 00:08:42.880 -as one more we're going to say how many - -00:08:42.880 --> 00:08:44.560 -semitones up it is - -00:08:44.560 --> 00:08:47.200 -so if there's a sharp between two notes - -00:08:47.200 --> 00:08:48.480 -that's going to be two steps up instead - -00:08:48.480 --> 00:08:50.000 -of just one - -00:08:50.000 --> 00:08:51.279 -and then we translate those two - -00:08:51.279 --> 00:08:54.160 -frequencies so your a is 440 hertz - -00:08:54.160 --> 00:08:56.920 -another note might be - -00:08:56.920 --> 00:08:58.480 -613.5 - -00:08:58.480 --> 00:09:00.720 -or whatever and we that's we use the low - -00:09:00.720 --> 00:09:02.959 -level to play - -00:09:02.959 --> 00:09:05.200 -some future work i have i want to add - -00:09:05.200 --> 00:09:06.480 -some drums - -00:09:06.480 --> 00:09:08.240 -i want to make that keyboard actually - -00:09:08.240 --> 00:09:09.680 -work uh - -00:09:09.680 --> 00:09:12.399 -and uh computers and synthesizers are - -00:09:12.399 --> 00:09:14.320 -the only place you hear a pure sine wave - -00:09:14.320 --> 00:09:16.000 -like the one we have here - -00:09:16.000 --> 00:09:17.680 -so i want to add overtones or other - -00:09:17.680 --> 00:09:19.440 -octaves above it uh just to make it - -00:09:19.440 --> 00:09:23.120 -sound a little bit more realistic - -00:09:23.120 --> 00:09:25.360 -i've put notes references in the source - -00:09:25.360 --> 00:09:28.480 -code up at zck dot me slash emacs conf - -00:09:28.480 --> 00:09:31.839 -2020 i'm one of the organizers of emacs - -00:09:31.839 --> 00:09:33.040 -nyc - -00:09:33.040 --> 00:09:36.080 -check that out and if you take a look - -00:09:36.080 --> 00:09:38.240 -or have any thoughts i'd love to hear - -00:09:38.240 --> 00:09:39.839 -them and - -00:09:39.839 --> 00:09:46.160 -thanks so much for coming to my talk diff --git a/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.vtt b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.vtt new file mode 100644 index 00000000..57837210 --- /dev/null +++ b/2020/subtitles/emacsconf-2020--35-waveing-at-repetitive-repetitive-repetitive-music-zmusic--zachary-kanfer.vtt @@ -0,0 +1,730 @@ +WEBVTT + +00:00:04.080 --> 00:00:04.960 +Hi. + +00:00:04.960 --> 00:00:08.559 +I'm Zachary Kanfer, and this is waving + +00:00:08.559 --> 00:00:11.679 +at repetitive repetitive repetitive + +00:00:11.679 --> 00:00:15.759 +music. Over quarantine, I've been bored, + +00:00:15.759 --> 00:00:18.400 +and I found this Android app that has a + +00:00:18.400 --> 00:00:19.680 +bunch of mini-games, + +00:00:19.680 --> 00:00:23.519 +one of which lets you compose music. + +00:00:23.519 --> 00:00:26.640 +And it works, but I + +00:00:26.640 --> 00:00:28.160 +want a little bit more functionality + +00:00:28.160 --> 00:00:30.720 +than it offers, it's not very flexible. + +00:00:30.720 --> 00:00:33.760 +So, I thought what if I made this, + +00:00:33.760 --> 00:00:35.360 +and what programs could I make this + +00:00:35.360 --> 00:00:37.760 +in that are really flexible, are really + +00:00:37.760 --> 00:00:40.320 +customizable. + +00:00:40.320 --> 00:00:44.239 +Emacs. So, I looked into it, and + +00:00:44.239 --> 00:00:46.320 +Emacs can play sounds, right? If you hit + +00:00:46.320 --> 00:00:47.840 +control g a couple of times, you'll hear + +00:00:47.840 --> 00:00:49.760 +like an error tone, + +00:00:49.760 --> 00:00:51.360 +and it turns out that, that is actually + +00:00:51.360 --> 00:00:54.559 +playing a WAVE file, + +00:00:54.559 --> 00:00:58.960 +but what's a WAVE file? + +00:00:58.960 --> 00:01:01.920 +Well, it turns out that WAVE is a musical + +00:01:01.920 --> 00:01:03.440 +file format, + +00:01:03.440 --> 00:01:07.840 +or really an annoying file format. + +00:01:07.840 --> 00:01:12.080 +So, data in it can be an unsigned integer + +00:01:12.080 --> 00:01:15.360 +or a signed integer, it's not consistent, + +00:01:15.360 --> 00:01:17.920 +and it's little-endian by default which + +00:01:17.920 --> 00:01:20.320 +is not the way I like to think about it. + +00:01:20.320 --> 00:01:21.600 +Now, you can + +00:01:21.600 --> 00:01:23.733 +set a WAVE file to be big-endian, + +00:01:23.733 --> 00:01:25.200 +but if you do that, + +00:01:25.200 --> 00:01:26.600 +Emacs can't play it. + +00:01:26.600 --> 00:01:30.479 +So, little-endian it is. + +00:01:30.479 --> 00:01:33.520 +There's also duplicate data fields. + +00:01:33.520 --> 00:01:35.360 +Here are some fields that are fine, but + +00:01:35.360 --> 00:01:36.960 +then there's a fourth field that's + +00:01:36.960 --> 00:01:38.960 +calculated based on multiplying two of + +00:01:38.960 --> 00:01:40.799 +the other ones together, + +00:01:40.799 --> 00:01:42.399 +and then there's another data field + +00:01:42.399 --> 00:01:44.880 +that's… you multiply those three ones + +00:01:44.880 --> 00:01:48.479 +together. So, it's just repetitive and + +00:01:48.479 --> 00:01:50.479 +unnecessary, but you have to do it, or + +00:01:50.479 --> 00:01:54.159 +it's not a valid WAVE file. + +00:01:54.159 --> 00:01:56.479 +Also, the last part of the file is + +00:01:56.479 --> 00:01:58.159 +described as data + +00:01:58.159 --> 00:02:01.759 +or as one website I found said, + +00:02:01.759 --> 00:02:05.200 +the actual sound data. Now, + +00:02:05.200 --> 00:02:06.960 +I don't know about you but when I see + +00:02:06.960 --> 00:02:09.039 +that, I think, + +00:02:09.039 --> 00:02:12.080 +what is data? It turns out + +00:02:12.080 --> 00:02:15.120 +that sound is just a wave, and + +00:02:15.120 --> 00:02:17.760 +the data is just a bunch of measurements + +00:02:17.760 --> 00:02:19.120 +of the height of that wave forming each + +00:02:19.120 --> 00:02:20.400 +sample. + +00:02:20.400 --> 00:02:24.480 +So, this wave starts at 8 goes 9, 11, 13, + +00:02:24.480 --> 00:02:27.840 +14, 15, and then back down. If you just + +00:02:27.840 --> 00:02:29.520 +take those measurements, those numbers, + +00:02:29.520 --> 00:02:30.700 +put them in a file, + +00:02:30.700 --> 00:02:35.200 +that's all your data is. + +00:02:35.200 --> 00:02:36.560 +All right. Let's go to a demo of my + +00:02:36.560 --> 00:02:38.959 +program. + +00:02:38.959 --> 00:02:41.920 +So, this is what zmusic looks like. The + +00:02:41.920 --> 00:02:44.080 +blue highlighted row is a single beat, + +00:02:44.080 --> 00:02:48.319 +there's 16 of them in this zmusic file, + +00:02:48.319 --> 00:02:52.000 +and each dash in the row + +00:02:52.000 --> 00:02:55.040 +is a single note increasing…, starting + +00:02:55.040 --> 00:02:57.920 +really low all the way on the left and + +00:02:57.920 --> 00:02:58.959 +going up + +00:02:58.959 --> 00:03:01.680 +as we go to the right. So, if we started + +00:03:01.680 --> 00:03:02.400 +playing, + +00:03:02.400 --> 00:03:05.040 +we won't hear anything, but we'll see the + +00:03:05.040 --> 00:03:06.400 +highlighted beat is the currently + +00:03:06.400 --> 00:03:07.680 +playing one, + +00:03:07.680 --> 00:03:09.833 +and we see that it loops. + +00:03:09.833 --> 00:03:12.720 +So, we can stop it, + +00:03:12.720 --> 00:03:20.633 +and now we can click to add some notes. + +00:03:20.633 --> 00:03:30.879 +[Music] + +00:03:30.879 --> 00:03:33.120 +Even more than one note at the same time + +00:03:33.120 --> 00:03:37.333 +works. + +00:03:37.333 --> 00:03:43.920 +[Music] + +00:03:43.920 --> 00:03:45.567 +And we can even add notes + +00:03:45.567 --> 00:03:56.160 +while it's playing. + +00:03:56.160 --> 00:04:08.239 +[Music] + +00:04:08.239 --> 00:04:10.480 +Okay, here are some other features that I + +00:04:10.480 --> 00:04:12.959 +didn't have time to demo. + +00:04:12.959 --> 00:04:16.000 +So, you can save the music to a file, and + +00:04:16.000 --> 00:04:18.239 +this is interesting because normally + +00:04:18.239 --> 00:04:20.880 +if there's no note in a beat, we just + +00:04:20.880 --> 00:04:22.800 +don't play that beat, + +00:04:22.800 --> 00:04:24.639 +but if you're writing to a file you have + +00:04:24.639 --> 00:04:25.919 +to put something in, + +00:04:25.919 --> 00:04:27.840 +so when it's playing it knows to not + +00:04:27.840 --> 00:04:31.360 +make a sound there. + +00:04:31.360 --> 00:04:33.800 +We can also use different scales. + +00:04:33.800 --> 00:04:36.240 +We're using the minor pentatonic + +00:04:36.240 --> 00:04:38.080 +in the demo, but you can use the major + +00:04:38.080 --> 00:04:39.680 +scale the minor scale + +00:04:39.680 --> 00:04:40.967 +or anything else. + +00:04:40.967 --> 00:04:43.367 +And there's also keyboard support, + +00:04:43.367 --> 00:04:45.199 +but it sounds really bad, + +00:04:45.199 --> 00:04:48.240 +and I'll explain why later. + +00:04:48.240 --> 00:04:50.800 +Here are some things I learned while + +00:04:50.800 --> 00:04:53.520 +writing zmusic. + +00:04:53.520 --> 00:04:56.479 +Emacs has buttons which are great as + +00:04:56.479 --> 00:04:58.240 +long + +00:04:58.240 --> 00:04:59.919 +as you don't put two of them right next + +00:04:59.919 --> 00:05:02.160 +to each other. So, if you do that, + +00:05:02.160 --> 00:05:04.400 +mousing over one of them highlights both + +00:05:04.400 --> 00:05:06.160 +of them. + +00:05:06.160 --> 00:05:07.919 +Now, that's because a button is really + +00:05:07.919 --> 00:05:10.080 +just a series of characters with a text + +00:05:10.080 --> 00:05:11.680 +property to highlight them. + +00:05:11.680 --> 00:05:15.120 +So, the fix is, you put another character + +00:05:15.120 --> 00:05:16.479 +between the two buttons, + +00:05:16.479 --> 00:05:18.080 +then mousing over one of them only + +00:05:18.080 --> 00:05:19.759 +highlights the one you want, + +00:05:19.759 --> 00:05:21.600 +but even this doesn't work really great + +00:05:21.600 --> 00:05:22.800 +for zmusic, + +00:05:22.800 --> 00:05:25.440 +because zmusic has a lot of very + +00:05:25.440 --> 00:05:27.120 +small buttons in a row. + +00:05:27.120 --> 00:05:29.840 +So, it's really easy to accidentally put + +00:05:29.840 --> 00:05:31.600 +your cursor over the space + +00:05:31.600 --> 00:05:34.639 +and click on that instead of the button. + +00:05:34.639 --> 00:05:37.120 +So, I looked into unicode, and I found + +00:05:37.120 --> 00:05:38.160 +this character called + +00:05:38.160 --> 00:05:40.800 +a zero-width space. So, we should be able + +00:05:40.800 --> 00:05:42.560 +to put that between buttons and not be + +00:05:42.560 --> 00:05:45.120 +able to accidentally click on it. + +00:05:45.120 --> 00:05:46.960 +Unfortunately, a zero-width space isn't + +00:05:46.960 --> 00:05:50.080 +actually zero width. + +00:05:50.080 --> 00:05:51.680 +If we put a hundred of them between two + +00:05:51.680 --> 00:05:53.759 +other characters, you can see there's + +00:05:53.759 --> 00:05:54.880 +space there, + +00:05:54.880 --> 00:05:56.240 +and I think what's happening is, the + +00:05:56.240 --> 00:05:58.160 +space is zero width + +00:05:58.160 --> 00:06:01.360 +but then Emacs `put` uses one pixel between + +00:06:01.360 --> 00:06:02.800 +each pair of characters + +00:06:02.800 --> 00:06:08.080 +for the cursor, so it's almost zero width. + +00:06:08.080 --> 00:06:09.919 +Some ways to play sound that don't quite + +00:06:09.919 --> 00:06:12.960 +work! `play-sound` plays music, + +00:06:12.960 --> 00:06:14.800 +but it blocks, you can't do things like, + +00:06:14.800 --> 00:06:17.280 +set other notes or even pause the music. + +00:06:17.280 --> 00:06:19.600 +And if you throw it into async.el, it's + +00:06:19.600 --> 00:06:21.600 +silent, and I don't know why. + +00:06:21.600 --> 00:06:24.479 +So, the solution I went with is taking + +00:06:24.479 --> 00:06:25.440 +that WAVE file, + +00:06:25.440 --> 00:06:27.039 +ran into the file system, and then + +00:06:27.039 --> 00:06:29.199 +shelling out to a native executable to + +00:06:29.199 --> 00:06:30.639 +play the sound. + +00:06:30.639 --> 00:06:32.880 +And that works fine as long as you only + +00:06:32.880 --> 00:06:34.240 +do it once, + +00:06:34.240 --> 00:06:36.080 +because if you do it a couple of times at + +00:06:36.080 --> 00:06:37.600 +the same time like if you have a chord, + +00:06:37.600 --> 00:06:38.639 +and you want to play three notes + +00:06:38.639 --> 00:06:40.000 +simultaneously, + +00:06:40.000 --> 00:06:42.319 +you get this weird interference, and + +00:06:42.319 --> 00:06:43.680 +that's actually why the keyboard from + +00:06:43.680 --> 00:06:46.319 +before didn't work. + +00:06:46.319 --> 00:06:49.199 +Also, side effects have this unexpected + +00:06:49.199 --> 00:06:50.240 +impact, + +00:06:50.240 --> 00:06:53.039 +when you saw the demo it was running + +00:06:53.039 --> 00:06:55.120 +pretty smoothly, + +00:06:55.120 --> 00:06:57.680 +but if I just add one message statement + +00:06:57.680 --> 00:06:58.479 +every beat for + +00:06:58.479 --> 00:07:00.960 +debugging purposes, I was getting lag and + +00:07:00.960 --> 00:07:03.759 +jitter. + +00:07:03.759 --> 00:07:05.440 +Here's the one thing I learned about + +00:07:05.440 --> 00:07:08.319 +music theory, music theory + +00:07:08.319 --> 00:07:11.599 +is not easy to program. + +00:07:11.599 --> 00:07:12.880 +I was looking around to see what + +00:07:12.880 --> 00:07:15.440 +concepts we can use to code the scales, + +00:07:15.440 --> 00:07:16.933 +to code the notes, + +00:07:16.933 --> 00:07:18.160 +the first thing that I saw is + +00:07:18.160 --> 00:07:20.240 +scale degrees, + +00:07:20.240 --> 00:07:23.360 +and this when I looked into it, you don't + +00:07:23.360 --> 00:07:26.319 +want to program in scale degrees. + +00:07:26.319 --> 00:07:28.240 +So, you see we have the first, second, + +00:07:28.240 --> 00:07:29.759 +third, fourth, fifth, sixth, seventh but + +00:07:29.759 --> 00:07:32.080 +then it wraps around. That octave up + +00:07:32.080 --> 00:07:33.919 +is also a first, and that's because both + +00:07:33.919 --> 00:07:36.000 +of those notes are C, + +00:07:36.000 --> 00:07:38.479 +so that didn't work, and also you + +00:07:38.479 --> 00:07:39.759 +couldn't really easily + +00:07:39.759 --> 00:07:43.599 +specify a flat or sharp. You could say + +00:07:43.599 --> 00:07:47.680 +a sharp third or + +00:07:47.680 --> 00:07:50.879 +you know, a flat seventh or whatever, but + +00:07:50.879 --> 00:07:52.319 +then you kind of have these two pieces + +00:07:52.319 --> 00:07:53.759 +of data that indicate the note, and I + +00:07:53.759 --> 00:07:55.840 +didn't love that. + +00:07:55.840 --> 00:07:57.440 +So, I looked again, and I + +00:07:57.440 --> 00:07:59.280 +found intervals, + +00:07:59.280 --> 00:08:01.120 +and then I thought about it, and you + +00:08:01.120 --> 00:08:02.080 +don't really want to program in + +00:08:02.080 --> 00:08:03.440 +intervals either. + +00:08:03.440 --> 00:08:05.520 +It fixes some of the problems with scale + +00:08:05.520 --> 00:08:07.039 +degrees, you see, + +00:08:07.039 --> 00:08:08.319 +all the way on the right you have an + +00:08:08.319 --> 00:08:10.319 +octave, so you wrap to 8, and you + +00:08:10.319 --> 00:08:13.039 +go 9, 10 and that works. But you solve the + +00:08:13.039 --> 00:08:14.319 +same problem, you see you have a major + +00:08:14.319 --> 00:08:16.400 +third but below we also have a minor + +00:08:16.400 --> 00:08:18.080 +third, so you saw that problem of having + +00:08:18.080 --> 00:08:20.160 +two pieces of information. + +00:08:20.160 --> 00:08:23.360 +So, I thought about it. Music is really + +00:08:23.360 --> 00:08:27.120 +frequencies. Like an A is 440 hertz. + +00:08:27.120 --> 00:08:28.400 +So, at a low level that's what we're + +00:08:28.400 --> 00:08:29.360 +going to do, we're just going to use + +00:08:29.360 --> 00:08:30.560 +frequencies. + +00:08:30.560 --> 00:08:32.800 +And then at the one level above that, + +00:08:32.800 --> 00:08:34.159 +that's a little bit easier for humans to + +00:08:34.159 --> 00:08:35.360 +think about, + +00:08:35.360 --> 00:08:37.039 +we're going to use semitones up from the + +00:08:37.039 --> 00:08:39.519 +root, which is kind of like scale degrees, + +00:08:39.519 --> 00:08:40.959 +but instead of just counting each note + +00:08:40.959 --> 00:08:42.880 +as one more, we're going to say how many + +00:08:42.880 --> 00:08:44.560 +semitones up it is. + +00:08:44.560 --> 00:08:47.200 +So, if there's a sharp between two notes, + +00:08:47.200 --> 00:08:48.480 +that's going to be two steps up instead + +00:08:48.480 --> 00:08:50.000 +of just one. + +00:08:50.000 --> 00:08:51.279 +And then we translate those two + +00:08:51.279 --> 00:08:54.160 +frequencies, so your A is 440 hertz, + +00:08:54.160 --> 00:08:56.920 +another note might be + +00:08:56.920 --> 00:08:58.480 +613.5, + +00:08:58.480 --> 00:09:00.720 +or whatever, and that's we use the low + +00:09:00.720 --> 00:09:02.959 +level to play. + +00:09:02.959 --> 00:09:05.200 +Some future work I have, I want to add + +00:09:05.200 --> 00:09:06.480 +some drums. + +00:09:06.480 --> 00:09:08.240 +I want to make that keyboard actually + +00:09:08.240 --> 00:09:09.680 +work, + +00:09:09.680 --> 00:09:12.399 +and computers and synthesizers are + +00:09:12.399 --> 00:09:14.320 +the only place you hear a pure sine wave + +00:09:14.320 --> 00:09:16.000 +like the one we have here, + +00:09:16.000 --> 00:09:17.680 +so I want to add overtones or other + +00:09:17.680 --> 00:09:19.440 +octaves above it just to make it + +00:09:19.440 --> 00:09:23.120 +sound a little bit more realistic. + +00:09:23.120 --> 00:09:25.360 +I've put notes references and the source + +00:09:25.360 --> 00:09:26.000 +code up + +00:09:26.000 --> 00:09:30.067 +at zck.org/emacsconf2020 [updated]. + +00:09:30.067 --> 00:09:33.040 +I'm one of the organizers of EmacsNYC + +00:09:33.040 --> 00:09:36.080 +check that out. And if you take a look + +00:09:36.080 --> 00:09:38.240 +or have any thoughts, I'd love to hear + +00:09:38.240 --> 00:09:39.839 +them, and + +00:09:39.839 --> 00:09:46.160 +thanks so much for coming to my talk. -- cgit v1.2.3