Permalink
Browse files

adding loopy simulator and loopy over midi

  • Loading branch information...
1 parent 6e90471 commit 5c641882535c9b86852265906a3d7191a9d061b1 @heuermh committed Oct 23, 2012
Showing with 316 additions and 7 deletions.
  1. +136 −0 Loopy.ck
  2. +171 −0 LoopyMidi.ck
  3. +9 −7 import.ck
View
136 Loopy.ck
@@ -0,0 +1,136 @@
+/*
+
+ LiCK Library for ChucK.
+ Copyright (c) 2007-2012 held jointly by the individual authors.
+
+ This file is part of LiCK.
+
+ LiCK is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LiCK is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LiCK. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+// emulates the Loopy iOS app
+public class Loopy
+{
+
+ fun void selectNextTrack()
+ {
+ <<<"select next track">>>;
+ }
+
+ fun void selectPreviousTrack()
+ {
+ <<<"select previous track">>>;
+ }
+
+ fun void toggleMute()
+ {
+ <<<"toggle mute">>>;
+ }
+
+ fun void toggleRecord()
+ {
+ <<<"toggle record">>>;
+ }
+
+ fun void toggleRecordSelectNextTrack()
+ {
+ <<<"toggle record select next track">>>;
+ }
+
+ fun void toggleRecordOverdub()
+ {
+ <<<"toggle record overdub">>>;
+ }
+
+ fun void toggleRecordWithoutCountIn()
+ {
+ <<<"toggle record without count in/out">>>;
+ }
+
+ fun void clearTrack()
+ {
+ <<<"clear track">>>;
+ }
+
+ fun void rerecordTrack()
+ {
+ <<<"rerecord track">>>;
+ }
+
+ fun void soloTrack()
+ {
+ <<<"solo track">>>;
+ }
+
+ fun void toggleMuteAllTracks()
+ {
+ <<<"toggle mute all tracks">>>;
+ }
+
+ fun void clearAllTracks()
+ {
+ <<<"clear all tracks">>>;
+ }
+
+ fun void selectTrack()
+ {
+ <<<"select track">>>;
+ }
+
+ fun void tapTempo()
+ {
+ <<<"tap tempo">>>;
+ }
+
+ fun void doubleClockLength()
+ {
+ <<<"double clock length">>>;
+ }
+
+ fun void halveClockLength()
+ {
+ <<<"halve clock length">>>;
+ }
+
+ fun void toggleSessionPause()
+ {
+ <<<"toggle session pause">>>;
+ }
+
+ fun void toggleSessionPauseRestart()
+ {
+ <<<"toggle session pause restart">>>;
+ }
+
+ fun void restartSession()
+ {
+ <<<"restart session">>>;
+ }
+
+ fun void resetSession()
+ {
+ <<<"reset session">>>;
+ }
+
+ fun void toggleTrackSync()
+ {
+ <<<"toggle track sync">>>;
+ }
+
+ fun void cancelPendingActions()
+ {
+ <<<"cancel pending actions">>>;
+ }
+}
View
@@ -0,0 +1,171 @@
+/*
+
+ LiCK Library for ChucK.
+ Copyright (c) 2007-2012 held jointly by the individual authors.
+
+ This file is part of LiCK.
+
+ LiCK is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LiCK is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LiCK. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+// interacts with the Loopy iOS app over MIDI
+public class LoopyMidi extends Loopy
+{
+ MidiOut out;
+ ControlChangeMidiMsg ccMsg;
+
+ // map CC number to Loopy action
+ 0 => int SELECT_NEXT_TRACK;
+ 1 => int SELECT_PREVIOUS_TRACK;
+ 2 => int TOGGLE_MUTE;
+ 3 => int TOGGLE_RECORD;
+ 4 => int TOGGLE_RECORD_SELECT_NEXT_TRACK;
+ 5 => int TOGGLE_RECORD_OVERDUB;
+ 6 => int TOGGLE_RECORD_WITHOUT_COUNT_IN;
+ 7 => int CLEAR_TRACK;
+ 8 => int RERECORD_TRACK;
+ 9 => int SOLO_TRACK;
+ 10 => int TOGGLE_MUTE_ALL_TRACKS;
+ 11 => int CLEAR_ALL_TRACKS;
+ 12 => int SELECT_TRACK;
+ 13 => int TAP_TEMPO;
+ 14 => int DOUBLE_CLOCK_LENGTH;
+ 15 => int HALVE_CLOCK_LENGTH;
+ 16 => int TOGGLE_SESSION_PAUSE;
+ 17 => int TOGGLE_SESSION_PAUSE_RESTART;
+ 18 => int RESTART_SESSION;
+ 19 => int RESET_SESSION;
+ 20 => int TOGGLE_TRACK_SYNC;
+ 21 => int CANCEL_PENDING_ACTIONS;
+ // CC value to trigger Loopy action
+ 65 => int CC_VALUE;
+
+ fun void _cc(int number)
+ {
+ ccMsg.number(number);
+ ccMsg.value(CC_VALUE);
+ out.send(ccMsg);
+ }
+
+ fun void selectNextTrack()
+ {
+ _cc(SELECT_NEXT_TRACK);
+ }
+
+ fun void selectPreviousTrack()
+ {
+ _cc(SELECT_PREVIOUS_TRACK);
+ }
+
+ fun void toggleMute()
+ {
+ _cc(TOGGLE_MUTE);
+ }
+
+ fun void toggleRecord()
+ {
+ _cc(TOGGLE_RECORD);
+ }
+
+ fun void toggleRecordSelectNextTrack()
+ {
+ _cc(TOGGLE_RECORD_SELECT_NEXT_TRACK);
+ }
+
+ fun void toggleRecordOverdub()
+ {
+ _cc(TOGGLE_RECORD_OVERDUB);
+ }
+
+ fun void toggleRecordWithoutCountIn()
+ {
+ _cc(TOGGLE_RECORD_WITHOUT_COUNT_IN);
+ }
+
+ fun void clearTrack()
+ {
+ _cc(CLEAR_TRACK);
+ }
+
+ fun void rerecordTrack()
+ {
+ _cc(RERECORD_TRACK);
+ }
+
+ fun void soloTrack()
+ {
+ _cc(SOLO_TRACK);
+ }
+
+ fun void toggleMuteAllTracks()
+ {
+ _cc(TOGGLE_MUTE_ALL_TRACKS);
+ }
+
+ fun void clearAllTracks()
+ {
+ _cc(CLEAR_ALL_TRACKS);
+ }
+
+ fun void selectTrack()
+ {
+ _cc(SELECT_TRACK);
+ }
+
+ fun void tapTempo()
+ {
+ _cc(TAP_TEMPO);
+ }
+
+ fun void doubleClockLength()
+ {
+ _cc(DOUBLE_CLOCK_LENGTH);
+ }
+
+ fun void halveClockLength()
+ {
+ _cc(HALVE_CLOCK_LENGTH);
+ }
+
+ fun void toggleSessionPause()
+ {
+ _cc(TOGGLE_SESSION_PAUSE);
+ }
+
+ fun void toggleSessionPauseRestart()
+ {
+ _cc(TOGGLE_SESSION_PAUSE_RESTART);
+ }
+
+ fun void restartSession()
+ {
+ _cc(RESTART_SESSION);
+ }
+
+ fun void resetSession()
+ {
+ _cc(RESET_SESSION);
+ }
+
+ fun void toggleTrackSync()
+ {
+ _cc(TOGGLE_TRACK_SYNC);
+ }
+
+ fun void cancelPendingActions()
+ {
+ _cc(CANCEL_PENDING_ACTIONS);
+ }
+}
View
@@ -193,12 +193,21 @@ Machine.add("Arpeggiators.ck");
// unit test, package test
Machine.add("Assert.ck");
+// simulators, package simulator
+Machine.add("Animoog.ck");
+Machine.add("GarageBand.ck");
+Machine.add("Loopy.ck");
+Machine.add("MeeBlip.ck");
+// Machine.add("DroneLab.ck");
+Machine.add("VoiceOfSaturn.ck");
+
// midi, package midi
Machine.add("ControlChangeMidiMsg.ck");
Machine.add("NoteOffMidiMsg.ck");
Machine.add("NoteOnMidiMsg.ck");
Machine.add("AnimoogMidi.ck");
Machine.add("GarageBandMidi.ck");
+Machine.add("LoopyMidi.ck");
Machine.add("MeeBlipMidi.ck");
Machine.add("EuclidMidi.ck");
@@ -218,13 +227,6 @@ Machine.add("IanniXOsc.ck");
//Machine.add("SooperLooper.ck");
Machine.add("TouchOscServer.ck");
-// simulators, package simulator
-Machine.add("Animoog.ck");
-Machine.add("GarageBand.ck");
-Machine.add("MeeBlip.ck");
-// Machine.add("DroneLab.ck");
-Machine.add("VoiceOfSaturn.ck");
-
// sample-based drum machines, package sample
Machine.add("Sample.ck");
Machine.add("CompositeSample.ck");

0 comments on commit 5c64188

Please sign in to comment.