Is there a way to use custom soundfonts/soundbanks with winmm? - midi

Is there a way to use custom soundfonts/soundbanks while playing MIDI files with winmm.dll or do I have to use something else to do that? (I'm trying to do it in FASM).

The default synthesizer, "Microsoft GS Wavetable SW Synth", uses the file gm.dls, which is a system file and should not be replaced. There is no programmatic way to choose another sound font.

Related

Houdini flipbook default output location

I would like to set a default output location for the Houdini flipbook so that all users have a standard path to save and look for their flipbook sequences rather than everyone inputting their own save locations from the gui. Is there an option or setting for that, preferably something I could set with an environment variable?
This script might help.
Just create a new tool and paste code into script tab.
Once you click on the tool, it will load up the flipbook and save jpg sequence to disk.
Also make sure to create "resx" and "resy" here, here, and here
PS: double check if folder you are outputing JPGs to exists.
import os
import toolutils
filename = "---YOURPATH---/$HIPNAME/$HIPNAME.$F4.jpg"
scene = toolutils.sceneViewer()
setting = scene.flipbookSettings().stash()
res = (int(hou.getenv("resx")), int(hou.getenv("resy")))
range = hou.playbar.playbackRange()
setting.frameRange(range)
setting.output(filename)
setting.useResolution(True)
setting.motionBlurSegments(10)
setting.resolution(res)
setting.useMotionBlur(False)
scene.flipbook(scene.curViewport(), settings)

Powershell script automation Visio: How to randomly more dynamic glue to another shape?

I am trying to automate Visio by using powershell script.
I have a visio shape "Start" --"x shape" pointing to "BeginX" and targeting to "PosX" (therefore having a dynamic end).
I do not manage to randomly move the dynamic.
$begin = $connect.CellsU("BeginX").GlueToPos($shape,1);
$end = $connect.CellsU("EndX").GlueToPos($rect,0);
Is there a way to randomly auto move the existing connector to the end of shape?
Please and thanks...
I prepared these simple vba macro and gif animation for display behavior of dynamic connectors
CJP!
Please read more about GlueToPos method in MS Visio Cell.GlueToPos Method (Visio)
You need use 3 arguments (Shape, x-coordinate, y-coordinate) in this method !
Dynamic connector is feature based on Visio application core, which generated this connector behavior ! If open Behavior window for dynamic connector
You can find there a lot of settings, such as Style, Reroute and Appearance. I did some experiments with dynamic connectors, connectors route unpredictable.

How to load "file like object", instead of filename, with kivy SoundLoader?

I need to play a mp3 file from gridfs in mongodb. I will get a file-like object instead filename (to the system disk).
I cannot find anyway to use SoundLoader to play the file like object directly. I checked the code here https://kivy.org/docs/_modules/kivy/core/audio.html. it seems that kivy audio does not suppot it. Am I right? I mean, like wave module, you can open it with file like object. I prefer not to use wave because it may has issues in different OSs.
wave.open(file[, mode])
If file is a string, open the file by that
name, otherwise treat it as a seekable file-like object.
Any other way to load the data to SouldLoader instead of filename? Many thanks.
This may not be a direct answer but could be an alternative for now. I can use GridFSBucket in GridFS to download the file in stream then save temp file to disk. Finally load by SoundLoader. With this way, it would solve the problem with large media file issue. This solution also works for image or video but require some disk storage of course.

ObjectScript file create from stream

how can I create file (PDF file for example) from binary stream I have stored in global? I have stream stored in caché global and I need to create and save the file created by the stream using ObjectScript.
Thanks :)
It is not so easy. There is only one official way to create pdf in Cache, and it is ZEN reports. With ZEN reports you could create not only pdf, also possible to make html, xlsx. ZEN Reports used Apache FOP for generating it, any other ways also possible, but you should do it only by yourself.
Or maybe I misunderstood you, and you mean that your binary stream already contains PDF, and you just want to save it to some file. If so, you just have to copy your globalstream to filestream, with code like this:
set fs=##class(%Stream.FileBinary).%New()
set fs.Filename="c:\temp.pdf"
set tSC=fs.CopyFrom(yourStream)
set tSC=fs.%Save()

Finding file icon given a MIME type using GTK

Is there a way to find out which icon to use for a given MIME type, using GTK/pygtk?
I know about gio.File(filename).query_info("standard::icon").get_icon(), but I need to find the icon without having to read the file.
Try gio.content_type_get_icon(). E.g.:
>>> gio.content_type_get_icon ('text/python')
<gio.ThemedIcon at 0xb7d0f734: text-python, gnome-mime-text-python, text-x-generic>