Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
naojitaniguchi / moog_scale.tidal
Created May 25, 2019
Making Scale with speed command by tidal cycles
View moog_scale.tidal
d1 $ sound "moog:1" |> speed "1"
--2 E flat
d2 $ sound "moog:1" |> speed (1 + (1/12) * 2)
--3 E
d3 $ sound "moog:1" |> speed (1 + (1/12) * 3)
--4 F
d3 $ sound "moog:1" |> speed (1 + (1/12) * 4)
--6 G
d4 $ sound "moog:1" |> speed (1 + (1/12) * 6)
--7 G#
@naojitaniguchi
naojitaniguchi / MoveByVelocity.cs
Created May 1, 2019
Script for move 2D character by setting velocity of Rigidbody2D
View MoveByVelocity.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
public class MoveByVelocity : MonoBehaviour
{
[Header("Input keys")]
public Enums.KeyGroups typeOfControl = Enums.KeyGroups.ArrowKeys;
@naojitaniguchi
naojitaniguchi / AnimChange.cs
Created May 1, 2019
Change Animation trigger script for 2D character in Unity
View AnimChange.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimChange : MonoBehaviour
{
Animator animator;
bool moving = false;
// Start is called before the first frame update
@naojitaniguchi
naojitaniguchi / catimage.bsh
Created Jul 31, 2018
making tile image by ffmpeg
View catimage.bsh
ffmpeg -start_number 0 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_0.png
ffmpeg -start_number 11 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_1.png
ffmpeg -start_number 22 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_2.png
ffmpeg -start_number 33 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_3.png
ffmpeg -start_number 44 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_4.png
ffmpeg -start_number 55 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_5.png
ffmpeg -i output_%0d.png -filter_complex tile=6x1:margin=10:padding=4 output.png
@naojitaniguchi
naojitaniguchi / gist:b293fd901071330cedb22fecff291fa1
Created Nov 4, 2017
Marge 2 movies into side by side movie by ffmpeg
View gist:b293fd901071330cedb22fecff291fa1
ffmpeg -i "Left.MOV" -vf "[in] scale=iw:ih, pad=2*iw:ih [left];movie=Right.MOV, scale=iw:ih [right]; [left][right] overlay=main_w/2:0 [out]" "SideBySide.MOV"
@naojitaniguchi
naojitaniguchi / KeyInput.cs
Created Sep 22, 2017
2D Character control sample for Unity
View KeyInput.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyInput : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
View SwitchObj.cs
using UnityEngine;
using System.Collections;
public class SwitchObj : MonoBehaviour {
public GameObject hart_0;
public GameObject hart_1;
public GameObject hart_2;
public GameObject hart_3;
public GameObject hart_4;
public GameObject hart_5;
@naojitaniguchi
naojitaniguchi / UniOSCSendMessageSample.cs
Created Nov 29, 2016
Message sending sample for UniOSC
View UniOSCSendMessageSample.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System;
using OSCsharp.Data;
namespace UniOSC{
@naojitaniguchi
naojitaniguchi / UniOSCGetMessageSample.cs
Created Nov 28, 2016
Get OSC message sample script for UniOSC
View UniOSCGetMessageSample.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
using System;
using OSCsharp.Data;
namespace UniOSC{
@naojitaniguchi
naojitaniguchi / Shuffle.cs
Created Oct 8, 2016
Shuffling array sample for Unity
View Shuffle.cs
using UnityEngine;
using System.Collections;
public class Shuffle : MonoBehaviour {
public int[] blockNums;
int[] blockIndexArray ;
// Use this for initialization
void setupArray(){
int total = 0 ;