SPC q q- quitSPC w /- split window verticallySPC w- - split window horizontallySPC 1- switch to window 1SPC 2- switch to window 2SPC w c- delete current windowSPC TAB- switch to previous bufferSPC b b- switch buffers
| from pygame.math import Vector2 | |
| import util | |
| class Behavior: | |
| NONE = 0 | |
| SEEK = 1 | |
| ## id_map = {0:'NONE',1:'SEEK'} | |
| ## | |
| ## def __init__(self,entity,behavior_type): |
| LF="\n"; CR="\r" | |
| INVT="\033[7m"; NORM="\033[0m"; BOLD="\033[1m"; BLINK="\033[5m" | |
| #UNDR="\033[2m\033[4m"; EOL="\033[0K"; EOD="\033[0J" | |
| UNDR="\033[4m"; EOL="\033[0K"; EOD="\033[0J" | |
| SOD="\033[1;1f"; CUR_UP="\033[1A"; CUR_DN="\033[1B"; CUR_LEFT="\033[1D" | |
| CUR_RIGHT="\033[1C" | |
| #-- ANSI code | |
| SCR_HOME="\033[0;0H" #-- Home of the display |
| /* ports.js - Chrome 55.0.2883.95 (64-bit) | |
| It is assumed that "this.Elm" is set | |
| and valid for this IIFE (i.e. "Window.Elm.Shanghai" | |
| was set by Shanghai.js beforehand). | |
| */ | |
| ; (function() { | |
| function connectElmWorker(elm) { | |
| function logDockedCapacity (value) { |
When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.
I like to follow working example code so this is how the boilerplate will look like:
import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))
import Http| module RandomDemo where | |
| import Html exposing (..) | |
| import Html.Events exposing (onClick) | |
| import Random exposing (int, generate) | |
| import StartApp | |
| import Effects exposing (Effects) |
| /** | |
| * Lodash mixins for combinatorics | |
| * Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html | |
| * | |
| * Usage: | |
| * permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]] | |
| * combinations([0,1,2],2) // [[0,1],[0,2],[1,2]] | |
| * combinations_with_replacement([0,1,2],2)// [[0,0],[0,1],[0,2],[1,1],[1,2],[2,2]] | |
| * product([0,1,2],[0,1,2]) // [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]] | |
| * |
| ;;; as_keith_midi.xtm -- live performance | |
| ;; based on Andrew Sorensen "A Study in Keith" Impromptu performance | |
| ;; "A Study In Keith" is a work for solo piano (NI's Akoustik Piano) | |
| ;; by Andrew Sorensen inspired by Keith Jarrett's Sun Bear concerts. | |
| ;; Orginal code transposed to Extempore | |
| ;; http://extempore.moso.com.au | |
| ;; | |
| ;; Author: cv | |
| ;; Keywords: extempore, live-coding, impromptu, keith jarret |
| #Jazz Bach converted for Sonic Pi by Robin Newman Jan 2017 | |
| #requires to be used with run_file "path/to/filename/JazzBach.rb" | |
| #using Sonic Pi 2.11 or later | |
| use_synth :piano | |
| s=1;r=0.1 | |
| with_fx :reverb,room: 0.8,mix: 0.5 do | |
| with_fx :level,amp: 1.2 do #overall boost | |
| with_fx :level do |v| #dynamic control during the piece | |
| p=0.5;mp=0.7;mf=1;f=1.2;ff=1.5 | |
| in_thread do |
This is a summary of a talk given at Bett 2015 on Sonic Pi
I started by playing excerpts from two programs, Scott Joplin Maple Leaf Rag, and a Percussion Generator, to illustrate different things Sonic Pi can do, and gave a brief description of Sonic Pi and the user interface, similar to section 1.2 of the built in tutorial, which is accessed by clicking the Help button.
I also showed how one of the example programs "Idm Breakout" could be copied and played. Then I used the following program sections to develop a code to play the round Frere Jaques
##Making sounds