-
Balwyn
@atux I refer you to this thread
https://forum.pdpatchrepo.info/topic/14831/soundfont2-sf2-preset-reader/20
and the second last post where I uploaded sf2-toy.zip.
Mod-Env-Pitch(7) slider allows pitch change of the playing notes
you may need to extend release times and shorten the other envelope parameters.
however I had omitted some files, so here it is again with all the bits
toy.zip -
Balwyn
@impression
Sending the polyphonic note data directly to clone via send a receives to clone and receiving from the right node (rejected) of route in the synth works ok, So yes its possible.
testPage-updated.zip
-
Balwyn
give testSynthClone a unique argument $0-three
in testSynthClone put [r in-$1]
in testPD put
[ s in-$0-three]
|
[all cutoff $1(
|
[clone testSynth 4] -
Balwyn
You can prefix the number of the cloned synth in a message to that synth eg 2 cutoff $1 then within the cloned synth and route the cutoff value and pass it on polyphonically with all cutoff $1
clone-project.zip
-
Balwyn
I never found a way to change the number of voices in the poly object other than changing the creation argument. eg [poly 8 1] to [poly 1 1]
Here is an abstraction to address thispoly-dynamic.zip updated
-
Balwyn
if you mean pitch shifting with constant duration
3.audio.examples/I07.phase.vocoder.pd explains how to do this:
The [pd read-windows] sub patch within [pd fft-analysis] sub patch explains it more
here is a sample recording from a project I'm currently making using this
puredata.mp3 -
Balwyn
Here is way to get a bit more out of the soundfont generators using NRPN to address them. I've had this info for a very long time and can't seem to find where it came from.
You will need to change the path to your soundfont in [else/sfont~] and use the sf2-presets-reader.pd to create soundfont.txt if you want to use choose-sf2.pd.
Probably not that useful, just a bit of funEdit: I found the source of this info in the soundfont 2.04 spec
sf2-toy.zip
Edit: I updated the above zip with some missing patches 24th June 2025
-
Balwyn
I've just updated choose-sf2-example.pd in the zip in the original post because it was incorrectly wired and triggered, causing the previous index and current bank to be sent immediately before the current index and current bank often causing an error. I noticed it when I connected a print object to else/sfont~ right outlet
choose-sf2-example.pd -
Balwyn
@oid
I really should have explained about the $0 for those who may be following:The abstraction choose-sf2.pd is a dynamic patching patch that generates a bang connected to a message containing an index number of the lines of soundfont,txt and then connected to a send $0-result, this is the line number to read in soundfont.txt when the item bang is clicked, this is passed to $0-chosen
The format of the items in soundfont.txt was for simplicity in sorting the preset index and bank together with the name following. (the presets in a soundfont2 file are often very unsorted)
choose-sf2-example.pd shows how to retrieve the index, bank & nameThe abstraction choose-sf2.pd is instantiated on the choose-sf2-example.pd with one argument $0, this offers a link back from choose-sf2 to choose-sf2-example. The send $0-chosen in choose-sf2 can then be received by the $0-chosen in choose-sf2-example.
This already seems too wordy and now I'm confused
-
Balwyn
15 or so years ago I came across a vb script to extract a presets list from a soundfont2 file, which I adapted to use in various VB.net Fluidsynth projects.
Now that Pure Data has the file handle object to read binary files I decided to give it a go in Pd on Windows 10.
I have also tried it using linux and it seems to work with the latest portable version.
Edit: Thursday 22nd August 2024, I've just updated choose-sf2-example.pd in the zip because it was incorrectly wired an triggered
sf2-presets-reader.zip
contains:
sf2-presets-reader.pd to create soundfont.txt
choose-sf2-example.pd to launch choose-sf2.pd and show index, bank and name extraction from [r $0-chosen]
choose-sf2.pd
soundfont,txt contains the presets from a soundfont I use SGM-V2.01.sf2 (236MB), this will be overwritten with your choice.My preferred soundfont player to use with Pure Data is RGC-Audio SFZ.dll or SFZ+.dll loaded in @spacechild1 very excellent vstplugin~
Other options are Qsynth via midiout
Fluidsynth,exe via midiout launched with motex/systemWarning Purr-Data will not open sf2-presets-reader.pd because it does not have the file object.
Method;
open the soundfont2 file;
then look for phdr by searching backwards;
one byte at a time from the end of the file and look for p;
then see if the remainder from route is hdr;
then forwards 38 bytes for each instrument preset;
to retrieve bank, index and name until EOP tag;
send to text: (bank as integer, index / 1000 added to bank) and name as symbol;
;
then sort in order:- text define [sort(;
;
next write the text to soundfont, txt;Cheers
Balwyn -
Balwyn
Here is the way I did it using key and keyup
However filtering key numbers may vary with different keyboard layouts
computer-keys-to-notes.zip -
Balwyn
@weuoimi apparently the [adsr] has been altered for the tutorial, there are direct connections instead of send and receives
see below
I recreated pm-osc from the tutorial and used this adsr and your dx7 works
-
-
Balwyn
you need to have the note-off value 0 to turn off the note, >0 is filtering it out
I do it this way.
and rather than -1 the poly index, set the clone index to start at 1 with the -s flag