Presentation is loading. Please wait.

Presentation is loading. Please wait.

Akinori Ito, *Kengo Watanabe Genki Kuroda, Ken’ichiro Ito

Similar presentations


Presentation on theme: "Akinori Ito, *Kengo Watanabe Genki Kuroda, Ken’ichiro Ito"— Presentation transcript:

1 iSuperColliderKit: A Toolkit for iOS using an internal SuperCollider Server as a Sound Engine
Akinori Ito, *Kengo Watanabe Genki Kuroda, Ken’ichiro Ito Tokyo University of Technology *Watanabe DENKI Inc. We are very honerd to qualify and present today.

2 https://github.com/wdkk/iSuperColliderKit

3 Motivation We've already enjoyed "Live Coding" with SuperCollider. But NOT enough We want to ... enjoy ganerative music on our palm make artistic apps. with gradually changing music, not sound apply SC genarative music resources to the latest game sound demanding

4 Concept Embedded SC code fragments to iOS native apps.
Not "Live Coding" Generate sound on palm Not "Remote Controller"

5 Assumed Use Case Building a native iOS application
Building visual objects used by native iOS API Embedding some SuperCollider code fragment as a text Sending code fragments from iOS UI object including the embedded SuperCollider code fragments Changing musical elements, perticuraly scales in real-time

6 Overview of our system

7 pilot study ~Jul,2014 adaptation to modern programming
architecture in iOS

8 original version of Supercollider for iOS
git://supercollider.git.sourceforge.net/gitroot/supercollider/supercollider isc overwrite externals/yaml/src to external_libraries/yaml-cpp-0.3.0/src add a search path "../../external_libraries/yaml-cpp-0.3.0/include" not the latest environment ... Build Success on Xcode 4.6.2, LLVM GCC4.2 iOS 6.1.5, iPod 4th gen.

9 Target Environment to jump the "wall of architecture" original target
GCC to Apple LLVM 32bit to 64bit memory management (ARC) original target IDE Xcode 4.6.2 Xcode 6.0 Compiler LLVM GCC4.2 Apple LLVM 6.0 iOS version iOS 6.1.5 iOS 7 or later Hardware iPod Touch 4th gen. iPod Touch 5th gen.

10 Challenge Compiler issue MVC architecture issue UI Programming issue
main contributer : Kengo WATANABE tons of errors occured

11 1.Compiler issue changing 32bit ARM NEON code to simple array
integrating "libsndfile" to build from source Adapting to ARC

12 Switch NEON 32bit to Simple Array
SC_VFP11.h, IOUGen.cpp, SC_CoreAudio.cpp "vIn_next_a()" is the 32bit version NEON code of standard "In_next_a()" NEON code usage: for (int i=0; i<numChannels; ++i, in += bufLength) { ACQUIRE_BUS_AUDIO_SHARED((int32)fbusChannel + i); float *out = OUT(i); if (touched[i] == bufCounter) { vcopy(out, in, inNumSamples); } else { vfill(out, 0.f, inNumSamples); } RELEASE_BUS_AUDIO_SHARED((int32)fbusChannel + i); }

13 Before: After: for (int i=0; i<numChannels; ++i, in += bufLength) {
ACQUIRE_BUS_AUDIO_SHARED((int32)fbusChannel + i); float *out = OUT(i); if (touched[i] == bufCounter) { vcopy(out, in, inNumSamples); } else { vfill(out, 0.f, inNumSamples); } RELEASE_BUS_AUDIO_SHARED((int32)fbusChannel + i); } After: for (int i=0; i<numChannels; ++i, in += bufLength) { ACQUIRE_BUS_AUDIO_SHARED((int32)fbusChannel + i); float *out = OUT(i); if (touched[i] == bufCounter) Copy(inNumSamples, out, in); else Fill(inNumSamples, out, 0.f); RELEASE_BUS_AUDIO_SHARED((int32)fbusChannel + i); }

14 Automatic Ref. Counter "AutoReleasePool" became deprecated
We just deleted... "autorelease" 51 "retain" 47 "release" 116 correspondent "dealloc" bunch of ... ex.) SCGraphView* view = [[SCGraphView alloc] initWithFrame: bounds]; [view autorelease];

15 libsoundfile unsuitable for build environment
The latest source code on Csound repo. was suitable.

16 2.MVC arichtecture issue
separating SCEngine and Editor The previous iOS version is a "perfect clone" of SuperCollider as a "Live Coding" environment. But...

17 3.UI Programming issue avoiding to use the IB
Programmers had to UIView object on SC Editor In the previous version, UI Elements (windows, menus) are built by IB.

18 additional repair Build Success ! Bunch of casting all of the projects
due to 64 bit Build Success !

19 Sending SC code fragments test from Objective-C
supercollider_ios Our 1st version of adaptation "iSCController" Class C in MVC model "interpret" method a member of iSCController Class iSCController *scc=(iSCController*)(self.target); [scc = {SinOsc.ar()}.play"];

20 at that time... Each object needed each delegator
Each object still on the SC Editor NOT intuitive programming "Engine Editor separation" was imperfect

21 iSuperColliderKit ~ Dec., 2014

22 Improvements Re-organizing the code structure Adaptation to Swift
to separate SC Engine and Editor completely preparation to build without IB adjustment the build settings Adaptation to Swift

23 https://github.com/wdkk/iSuperColliderKit

24 Folder Hierachy iSCKit:for building SC Engine
iSCApp:Template project for Obj-C iSCAppSwift: Temp. for Swift "project" the KEY folder top directory

25 iSCKit makes 3 libraries libiSCKit.a libscsynth.a libsndfile.a
Build for Device ONLY. Do not select any simulator. iSuperColliderKit-master/lib/ on the lib folder. Tha file path is important for building your own application.

26 iSCApp An example and template for Obj-C

27 build settings (search path)
it refers the "master" folder you can change the location to any place

28 10 frameworks need for your own apps. from scratch

29 Booting SC server on the init. process in your apps.
symple initialization #import "iSCAppDelegate.h" @implementation iSCAppDelegate @synthesize window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [iSCController *scc = [iSCController sharedInstance];]; [scc (snip) Obj-C example Simple Setup

30 Booting SC server on the init. process in your apps.
embed the UI action triggers - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSString* message = [NSString 440*%d, 0, EnvGen.ar(Env.new([0, 1, 0], [0.01, 0.5]), doneAction:2))}.play; %d;]; [scc interpret:message]; (snip) Obj-C example SC code fragments as a NSString

31 Booting SC server on the init. process in your apps.
symple initialization func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) // Setup iSCKit engine. let scc = iSCController.sharedInstance() scc.setup() scc.interpret("s.boot") (snip) Swift example

32 Booting SC server on the init. process in your apps.
embed the UI action triggers Swift example func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { scc.interpretC("a = {SinOsc.ar()}.play") } (snip)

33 Result Build success on iOS7 Adapt to Swift Build more easily
Separating Engine to Editor Simple messaging Build your own apps. with any iOS native API

34 on going improvement Jun., 2015 ~ now

35 more easy coding "iSCController" to "iSC"
singleton need not to write "singleInstance" classmethod need not instantiate not need to get pointer on obj-c more simple sending the SC code

36 no need to instantiation Obj-C
After: [iSC setup]; [iSC [iSC = {SinOsc.ar()}.play"] Before: [iSCController *scc = [iSCController sharedInstance];]; [scc not included the proceedings ...

37 no need to instantiation Swift
After: iSC.setup() iSC.interpret("s.boot"); iSC.interpret("a = {SinOsc.ar()}.play") Before: let scc = iSCController.sharedInstance() scc.setup() scc.interpret("s.boot") not included the proceedings ...

38 not included the proceedings ...
FileReading useful for initializing iSC.setup() iSC.interpret("s.boot"); iSC.interpretFile("mainTrack.sc") not included the proceedings ...

39 Now iSuperColliderKit is ...
Swift 2.0 ready iOS9 ready Xcode7 ready

40 we hope we will be back to ICMC2016
Future Work Documentation of the latest version and submitting to ICMC2016 Research on adaptive music and interaction Building the music apps. Performance Test Finally, we want say that We respect all of SuperCollider developers and Open Source Community. We appriciate the great works. We would like to contribute to the community with our product. Thank you for your attention. Is there any questions and comments? we hope we will be back to ICMC2016

41 Thank you

42 Q & A Akinori Ito Kengo Watanabe @tonalab
Kengo Watanabe @kengolab main programmer


Download ppt "Akinori Ito, *Kengo Watanabe Genki Kuroda, Ken’ichiro Ito"

Similar presentations


Ads by Google