Inspecting a soundfont on iOS - ios

It is possible using AudioUnits on iOS to create samplers that load and play soundfont (or SF2) files. This is a really great feature. The problem is that I don't see any interface for inspecting a soundfont to see: a) how many presets it contains and b) the names of the presets it contains.
It is possible to obtain the current preset name by first loading the soundfont into the sampler using AudioUnitSetProperty with kAUSamplerProperty_LoadInstrument and then calling AudioUnitGetProperty with kAudioUnitProperty_ClassInfo on the sampler. This is not very efficient however, and only tells you the name of the currently loaded preset. It also does not seem to tell you how many presets are contained in the soundfont.
How does one do these things without using 3rd party code (surely it is natively supported)?

Another option is a soundfont editor for OSX called polyphone

This is a very old question, but I do have another solution: my SoundFonts
application. It is available on the AppStore for a small fee, or you can use the source to build what you want.
The repo contains an SF2 parser in C++ that I reworked from some code I found online. The repo also contains a catalog.py Python script that generates listing from a SF2 file. It uses the sf2utils Python package.

Related

How to link metal utility shaders with local executable metal library using SPM

The bounty expires in 3 days. Answers to this question are eligible for a +50 reputation bounty.
Affinity wants to draw more attention to this question.
The idea is having a Utilities.metal shader with helper functions (let's say converting color: rgb2hsv(), ... ) that I want to reuse in many projects. I'd like to access from the local project's metal shader files those helper functions while sharing it as a swift package.
Goals:
Having a Utilities.metal shader file or files in a swift package that I can add to other projects.
Calling that rgb2hsv() function from local shaders. I want to access the functions on that Utilities.metal file from a local executable metal library's (the one that you create in the local project with MTLDevice.makeDefaultLibrary() shaders (doing #include "Utilities.h" in local metal shaders?).
I want the package to contain the .metal files so I can update and commit them from any project (as local package in tandem with the app) not just the metallib.
What I don't want:
Making the bundle library MTLDevice.makeDefaultLibrary(bundle:) to use it inside the package or locally as a stand alone library. I want to link the functions and have access to them.
Avoid if possible hacky things like converting the shaders files to strings and using MTLDevide.makeLibrary(source: source options: nil).
Do I need to use MTLDynamicLibrary? The problem is it's not supported on many devices. Any help is welcome.

Load glTF model into RealityKit scene?

I'd like to load a glTF file generated by another program into RealityKit. I get the impression that the only way to load models into RealityKit is via USD or Reality files.
Anyone know a way to get some other model into RealityKit? Not necessarily as a file -- I'd be happy to be able to generate a MeshResource and array of Materials myself and load them in that way.
Reality Converter
Apple discussed this in the WWDC20 video "The artist’s AR toolkit".(link)
They show how to convert FBX, OBJ, USD and GLTF files to USDZs for use in Reality Composer.
Reality Converter is still in beta and needs to be downloaded from the Apple Developer website. I used it and it is quite nice.
There is also other tools you can use on the command line if this is more your thing. At WWDC 2019, Apple announced the USDZ Tools or also called USD Python Tools.
USDZ Tools is a pre-compiled Python library containing binaries of Pixar’s USD library for macOS. This is the link. You will need to download and install the library.
I would give a try to the Reality Converter first. I think it is here to stay since probably Apple has no intention to add support for glTF files in Reality Composer in the future, since they love USBZ!
I ended up using GLTFKit, an open source library by Warren Moore. It does exactly what I want -- lets me load a glTF file into SceneKit/RealityKit.
https://github.com/warrenm/GLTFKit
Alas, as you said, at the moment the only way to load your .gltf model in RealityKit scene – is firstly to convert it into .usdz model via Xcode command line tools. Also in RealityKit you can use .reality format (use it for a much faster uploading time) and .rcproject format that can be exported from Reality Composer app. These two file formats allow you store not only PBR shaders and animation but also a dynamics.
Please, read this post for further details.

Dynamic 3DObject use in ARKit-SceneKit

I want to download the 3D Object-dae(collada) file from server and want to display on surface dynamically so can please share how can I achieve this in ARKit via SceneKit or else?
You can check this link: https://the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/ it is old post but I don't think something is changed since that
According to this (see the Discussion section): https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension?language=objc
dae is not supported at runtime (ModelIO).
Additionally I'm working on a library called AssetKit (In Progress) and it will full support COLLADA and glTF, it is too early to say that but after initial release, you will be able to load dae files dynamically. It is written with C99 but I'll optimize it for Swift (by writing wrappers or integration with SceneKit...). Since it is still in progress I suggest that follow the first link

Validate resources and generate getter code for iOS app in Xcode

I’m looking for a tool that can validate my images and fonts in a iOS application.
Problem:
We have a lot of different images and fonts in our application. Sometimes some of those files are replaced or renamed. We don’t get compile warnings or errors just missing images scattered around the app.
I guess this is part of Objective C dynamic nature but I would really like some static check here.
Does there exist any tools that can validate content or autogenerate getter code? (preferable open source)
Thanks!
warning: Shameless self promovation ahead:
We have created a tool, IDAssetManager, (not open source, however), that creates a static interface to resources.
This tool integrates heavily with Xcode. It manages and organizes resources, and generates a class with getter code for images, font and colors.
It also comes with a Xcode plugin that allow you to preview images directly from the Xcode codeview:
The tool will also register fonts in the info.plist file.
To get the kind of validation you are looking for you will have to:
Add all images to IDAsssetManager
Use the getter code generated by the tool
Hit the refresh button on the tool.
You will now get compile warnings for all missing resources.
You can try it here: https://itunes.apple.com/us/app/idassetmanager-lite-for-xcode/id830464758?mt=12
Edit
You can see a video of the tool in action here

Convert Flash to iOS app

For the record, I am an iOS developer, and have absolutely no background on how flash programs work/run/developed...etc.
I have a Flash program that is mostly a collection of SWF files. It does, however, contain some Actionscript, Javascript and other integrated languages here and there..
I would like to convert this project/program to an iPad application. Is it possible?
What I got from searching the net:
Converting Actionscript to LUA script
Using Corona SDK to port the program to iOS
Starting a new iOS project in flash and moving the code somehow..
Other tedious ways which are not feasible at all....
The above mostly handles the actionscript part .. what about the SWF files?
As a last resort, one could at least guide me to a developer/company who can handle this task, or provide training to accomplish this.
Additional details
The flash program app file is already generated, and the program works on desktops perfectly. The program is somehow an interactive e-book, and it has some linked XML files to index the table of contents and other sections...
I've not done a lot of iOS development yet, but here are my experiences so far; maybe they help you form a better idea.
Only the main SWF can contain actionscript code.
I'm not sure how far assets (Sounds, Fonts, MovieClips) in other SWFs which are exported for actionscript are accessible to the main SWF.
It is possible to include additional XML files (and other types) which can be loaded via the normal loader classes.
Recently I came acrosshe tool which allows you to convert and play swf to some cross-platform frameworks. Now they support only Cocos2d-x, Unity 3d and Starling. But I saw the logo of Corona on their homepage. You can go there and ask them. I don't remember the right name of the site, but tool is called GAF converter

Resources