- http://technogems.blogspot.com http://a-touch-of-music.blogspot.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySide6.QtSvg | |
import PySide6.QtGui | |
import PySide6.QtCore | |
import moviepy.video.VideoClip | |
import moviepy.editor | |
import numpy as np | |
from moviepy.editor import * | |
from vectortween.PointAnimation import PointAnimation | |
from vectortween.SequentialAnimation import SequentialAnimation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import everything needed to edit video clips | |
from moviepy.editor import * | |
from vectortween.PointAnimation import PointAnimation | |
fps = 25 | |
duration = 10 | |
W = 2000 | |
H = 500 | |
# Generate a text clip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import moviepy.editor as mpy | |
from vectortween.Mapping import Mapping | |
basename = 'video.mp4' | |
inputfile = basename + ".mp4" | |
outputfile = basename + ".new.mp4" | |
video_file = mpy.VideoFileClip(inputfile) | |
duration = video_file.duration # duration | |
video_width, video_height = video_file.size | |
textclip = mpy.TextClip("www.YouTube.com",fontsize=30,color="red") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
// functions: wrap up functionality in a neat name | |
// | |
( | |
var f = { | |
| a, b | | |
a + b; // last thing in function is what is returned | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// continuous | |
( | |
~stream = Pwhite(50, 70, 5).asStream; | |
) | |
( | |
~stream.next.debug("next value"); | |
) | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note: the trickiest part to getting scores to work is to | |
// properly escape all the quotes " and backslashes \ while creating the html string | |
// showing simple fragment | |
( | |
var webview = WebView().minSize_(300@600); | |
var browser = View(bounds:900@700).layout_(VLayout(webview)); | |
webview.setHtml(html:"<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv=\"content-type\" content=\"text/html\" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
var webview = WebView().minSize_(300@200); | |
var browser = View(bounds:900@700).layout_(VLayout(webview)); | |
webview.setHtml(html:" | |
<div id=\"myscore\"></div> | |
<script src=\"https://unpkg.com/vexflow/releases/vexflow-min.js\"> </script> | |
<script> | |
var vf = new Vex.Flow.Factory({ | |
renderer: {elementId: 'myscore', width: 500, height: 200} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
s.waitForBoot({ | |
var deg_to_bass = ( | |
1: "c3", | |
2: "d3", | |
3: "e3", | |
4: "f3", | |
5: "g3", | |
6: "a3", | |
7: "b3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
// By James McCartney | |
var w, h = 1080, v = 720, seed, run = true, phase = 0; | |
var text_radius = 300; // pixels | |
var text_angle_increment = 7.degrad; // 7 degrees converted to radians | |
var text_start_angle = 0; | |
var text_center_x = 0; | |
var text_center_y = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
s.waitForBoot({ | |
Ndef(\bits, { | |
var t = PulseCount.ar(Impulse.ar(8e3)); | |
var sig = HPF.ar( | |
( | |
((t * 15) & (t >> 5)) | | |
((t * 5) & (t >> [3, 4])) | | |
((t * 2) & (t >> 9)) | | |
((t * 8) & (t >> 11)) | |
NewerOlder