How can I get a Clip object for a ClipLauncherSlot? - bitwig-api

I have a ClipLauncherSlot in Bitwig API, and I'd like to get ahold of the Clip within it so I can transpose it on user input.
The docs aren't online that I know of, so I can't link to them. But extensive searching has yielding absolutely no way of getting ahold of Clip objects in general.

I think you're supposed to work with a CursorClip.
Instead of directly accessing the clip, you access it through a CursorClip. The CursorClip will follow your selection and always represent the currently selected clip.
Something like this:
CursorClip cursorClip = host.createLauncherCursorClip()
clipLauncherSlot.select()
// Now your cursorClips represents the desired clip.
cursorClip.transpose()
Not entirely sure about the exact implementation, maybe you have to do some additonal steps for the cursor to correctly follow, but something like this should work.
See also here: https://www.kvraudio.com/forum/viewtopic.php?t=550738 for a similar problem. They had some problems with execution time, keep that in mind if you run into unexpected behaviour.

Related

Damaging QR Codes to Create Circles: Are Corners Necessary?

I am trying to create a circular QR Code. I understand that the typical circular codes require customer readers (Facebook, Kik, TikTok, ShotCode, etc.), but I would like this code to be able to be read by standard devices (ex.: the built-in reader in iOS devices).
I have looked at a stack of reference materials, including:
How can I generate a circular qr-code like a messenger or a kik code?
Generate circular qr-code like a messenger or a kik code using Python
Generate QR codes missing the corner
I've also dug into the (really in-depth) tutorial at thonky.com, and tried to create my own:
From what I can tell, I've kept the finder patterns, the alignment pattern, the timing patterns, the separators, and the dark module intact (see details here). But still no love when I try to read it.
Admittedly, I've taken an existing code (it contains the URL 'https://www.stackoverflow.com') and just chopped off the corners to make it fit. So my assumption is that I've damaged the code enough that the error correction isn't working.
But, would this work at all anyway? If I figured out how to encode it correctly, would it work without the corners? Or is this a useless endeavor to start with?
There is a basic structure for QR codes with specific elements that take part in the decoding process. Some of them are the alignment, the timing pattern, and the finder pattern. One of the elements which seems to be missing is the quiet zone. It's used to separate the code from other objects and surrounds all the data including structuring elements in the code. Have a look on the outer side of codes here and notice the difference. Also, if you look at the points that represent your data cells, some of them partially exist. In other words, some half and quarter circles exist and others are unknown behind the outer frame of your code design. How would it be figured out if it's black or white to be used for decoding? This is the problem. Please check this image to see how data look missing when you crop it with the circle.
Also, if you use any regular QR coder reading application, you will notice that circular QR codes require custom readers. So, the answer to your question is yes. The corners are necessary if you don't use a custom reader and if data exists on them.
If you are interested in academic research details, see this. I hope my answer helps you. :)

Getting odd color pattern while implementing ESRGAN

I'm implementing ESRGAN on PyTorch. However, I'm getting some weird color pattern, and the result does not seem better than the low-resolution picture. What could possibly be the cause of this? Thanks in advance.
Without seeing the code of the network my first thought is that you should check the post-processing of the image. Maybe values are getting clipped somewhere, or denormalized incorrectly.
Also look at images over different checkpoints of training. Is the artifact consistent? When did it appear?

Quartz 2D substitude for graphicsPort in SDK 10.10

The scenario:
I'm editing some CGImages and strangely enough until now I was first creating NSImages from those CGImages before drawing them. So I tried to change the code so that I would draw the CGImages directly in into NSGraphicsContext.currentContext().graphicsPort. As you see I'm using Swing here but the same problem goes for Objective-C I presume.
Having a look into the documentation I saw that graphicsPort will be deprecated in 10.10, but I couldn't find another way to the current CGContext from NSGraphicsContext nor is there a way to create the CGContext from an NSGraphicsContext.
The Question:
Does anybody know what the proper way to retrieve the context would be? If not - Is there a way to cast the graphicsPort's COpaquePointer, which apparently is an initialized NSPipeObject, to a CGContextRef? Although using code that has already been marked deprecated would be quite unsatisfactory I would consider it until there is a better solution.
After spending a half hour digging around for information on this, I realized I should just check out the header file for NSGraphicsContext. Turns out there's a new property on NSGraphicsContext that's apparently not documented yet: CGContext. The header also notes that this should be used instead of graphicsPort.

Different "clickable" log items in Chorome Dev Tools console

When I console.log a javascript object or array in Chrome Dev Tools I get a nice and clickable "drilldown" tree representation where I can inspect the various values, their keys and values with all the syntax highlighting, (i) icon, .length shown etc.
Is there some extension API for doing/changing this behaviour so it is different for some other classes/instances? My idea was to format Clojure data structures so one can inspect them the same way.
EDIT: I know I can do a simple formatting in console.log via %c etc., but that is only a tiny fraction of what I want to do.
So far I wasn't successful with googling. If you know where is the correct Chrome extension API written, can you please point me to the right direction?
There are no current extension APIs for customizing console output. https://code.google.com/p/chromium/issues/detail?id=142783 tracks that item. The team is open to a patch for this, if you'd like to look into tackling the implementation.
What you can do is to override console.log and, when object you are interested in is being printed out, use own function for printing it. To achieve something similar to the default object output you should probably use console.group and console text formatting (shown bellow).
See the official docs for more tips on using the Console.

How to discover the abap development objects' properties?

I'm comming from the java world, and i'd like to know if there's anything that can help me understand the properties of abap development objects.... something like reflection.
Knowing that everything that goes on in ABAP is persisted somewhere inside a database, i'd like to know how would i go about finding out HOW and WHERE an object is saved.
For instance, i'd like to know if there are any functions that enumerate the fields of a structure, or enumerate the properties of an object, or if there's no such thing (but the properties still exist obviously), then what table would be holding those (so that i can create my own functions, or classes)
Also any other discoverability tricks that you know are good... I know this question is a little generic, but since i'm new to abap, i don't really know what to ask :P
Thx, you guys rule.
If you're looking for something like reflection, take a look at RTTI. This cvers the runtime structure of most of the stuff you'll come across. If you want to find out what's going on underneath the surface of the cevelopment tools, just turn on the SQL trace (ST05), open the object in question in an editor and check what tables are accessed...
It is hard to answer your question, maybe it would be easier, if you split it up in multiple questions with some specific task you want.
Some topics I remember (please verify it, I can't check it in the moment if I remember correct):
DDIC-objects are stored in tables with DD*.
Tables (and there properties) are stored in dd02l, dd02t includes the texts. dd03l contains the fields. dd04tl contains the texts of data element.
But it will not help you, if you add something to this tables. The database in background will not get the definitions.
If you want to create some dynmaic magic you may take a look to the field-symbols and assign-command.

Resources