exponential ADSR envelope using LP filter
Hi. I've played with this method before a bit. A real 1-pole lowpass filter with an impulse passed in is equivalent to multiplying every previous sample by a constant factor to get the next sample, which is also equivalent to an exponential envelope. But you can also add a constant factor for every sample in order to make a linear envelope. So it turns out you can make a variable-slope filter by combining: multiply and add on the previous sample by 2 different factors. If you are interested I have further details in this blog post:
https://sshader.wordpress.com/2014/09/05/programming-an-adsr-envelope/?iframe=true&theme_preview=true
It's not that cpu friendly when you change the settings because you have to take the sample-length-of-the-stageth root or something like that, I haven't looked into it in a while though. However, afterward it simplifies to an add and multiply at every sample
here are the codes: http://forum.pdpatchrepo.info/topic/8490/examp-exponential-envelopes-with-exponential-linear-curve-control
Ewolverine 4 U
New version 7 (currently testing)
- added automatic loosening of minimum fitness limit for the case that a population of sounds gets stuck in a local maximum in the fitness landscape (really nerdy jabbering, but trust me, it's useful ^^)
- added automatic "jumping" out of local maximums after a certain number of fruitless climbing-trials
EWOLVERINE v.7 by Henry Dalcke.pd
plans:
• bugfix: prevent a newly audible sound from being selected after manually stopping the target drive
• simulated annealing in target drive mode: span "temperature" value onto fitnesslandscape and decrease step length (modwheel) and probability value in the splice-pattern-generator the closer the fitness gets to optimal fitness value
• interactive mode: automatic narrowing of the range of generated parameter values around a mean value that's derived from the repeated selection of similar values of individual parameters throughout the generations (increases the number of similar sounds per generation that are located around a certain coordinate in parameter space; increases the likelihood of the generation of the desired sound in a smaller amount of time)
• stop-condition for automatic stopping of target drive
• make default settings for modwheel-position, splice-pattern-generator's probability, anti-stuck and allowed minimum fitness value in target drive adjustable from GUI
• adjustable MIDI output message blocker (useful for instruments with a fixed MIDI implementation, for instance: If you want to breed a bass drum in a drum synth with multiple instruments, you may not want to ruin the parameter adjustments of the snare drum meanwhile you're selecting for good bass drums)
• storage for self-created splicer patterns (maybe in connection to the MIDI output message blocker)
• low-value-weighted probability for the generation of MIDI-CC-values in new populations; switchable per MIDI-CC either manually or randomly (increases the probability for the generation of short attack and decay values in synth's envelopes)
• bigger populations for each sound-set: 4 more random sounds per set (A/B) to select from
• discontinuous MIDI messaging interrupted by assignment switching CC events (special build for FM-Heaven) - low priority
• possibility to interpolate between new random population's sounds to smoothly re-direct the modwheel-morphing path while morphing
• selection-history recorder that one can use to re-load the selected sounds of each past generation
• a visualizer that generates a "tree of life" from directions (keys C,D,E,F) and steplengths (modwheel) of formerly selected individuals and their respective distances to their parent sounds
Please help: Random sampling gets more complicated
@whale-av Thank you, I tried and read everything but unfortunately this algorithm is probably more complicated that I needed...I am not able to update it...However I made new version, that suits my project even better and I hope it will be easier since I am a beginner and need to manage finishing this project in only 3 days ...Yet I still cant figure out some (probably basic) problems.
New project description:
I have 4 folders, that have each different number of sounds in each folder.
1st step: I want to make the main "random" pick that will "randomly" chose 1 of the folders.
2st step: from this chosen folder it will "randomly" play all sounds that are in this folder...
3rd step: the process go back to 1st point, but will now choose from 2 remaining folders.
4st step: when all the folder were played, than the process starts again.
Problems:
Unfortunately I am still stuck in these obstacles that I have been trying to solve all day:
-
how to make the generator only use numbers once?
--- For example instead of: 1,1,2,5,4 to make him generate 1,3,5,2,4 - where all the numbers are used once and not repeatedly? -
after this, how than make the generator stop and not continue in the process of "random" generation?
-
after this, how than make the algorithm go back and generate new folder?
This is one of the "folders" with for now only 5 sounds...I want to connect this "folder" to remaining 3 after solving problems 1 and 2.
Snímek obrazovky 2016-06-15 v 20.52.05.png
If you could recommend me anything I would be really glad!
I tried everything I could find on the internet but with no success.
Do you know of any good Envelope Patches?
So I've made this module to allow for stochastic variation of dynamic envelopes. It allows you to choose between three envelope types or determine the probability of each occuring. With the "ran"(dom) setting, the envelope lengths can be determined autonomously, or you can input a bang (third inlet) to coordinate the envelopes with other modules.
Depending on the length of the envelope, I can sometimes hear the low "resolution" of the "moderate" and particularly the "sharp" envelope, as they are only a four-point approximation of a curve. I can add more points of course, though, ideally, I should probably add a mechanism that takes the length of the envelope into consideration when determining the amount of points and the proportions of the envelope. Of course, if there are already excellent abstractions out there of which I'm unaware, I'd be happy if you could share them with me, so that I can avoid (further) re-inventing the wheel.
N.B: Open demo.pd to test the module.
P.S. It's possible that I've re-invented the wheel in multiple ways in this module, e.g. in the probability determination found in [dynamics]>[pd envelope_type]>[pd envelope_type_pool_and probability]. Any advice regarding pre-existing objects is appreciated.
EDIT: re-uploaded without [gate] and in .zip format.
envelope.zip
true random..............?
Is there such a thing as "truly" random?
@LiamG is right, that trick of using CPU time or something like that does not output true random numbers: even with a randomly selected seed, there is still a deterministic formula behind the number generation. In some contexts (particularly people doing some computational physics) the aspects of a poor pseudo-number generator can be observed in the data (that is, they do not even look random to the trained eye).
If you want true randomness, you can use random.org, which uses atmospheric noise to generate numbers. Some Mr. smart-pants could still point out that weather, though very complicated, is still deterministic. And that would be true, though this type of system is so dependent on initial states that it soon turns into a chaotic system. And given that the "formula" behind the weather system of the planet Earth is incomparably more complicated than any pseudo-number generator we can think of, we basically can assume that it's as random as it gets.
I have also seen some people generating true random numbers using some crazy experiments such as radioactive decay time.
Anyway, I digress.
Cheers!
Gilberto
Beatmaker Abstract
http://www.2shared.com/photo/mA24_LPF/820_am_July_26th_13_window_con.html
I conceptualized this the other day. The main reason I wanted to make this is because I'm a little tired of complicated ableton live. I wanted to just be able to right click parameters and tell them to follow midi tracks.
The big feature in this abstract is a "Midi CC Module Window" That contains an unlimited (or potentially very large)number of Midi CC Envelope Modules. In each Midi CC Envelope Module are Midi CC Envelope Clips. These clips hold a waveform that is plotted on a tempo divided graph. The waveform is played in a loop and synced to the tempo according to how long the loop is. Only one clip can be playing per module. If a parameter is right clicked, you can choose "Follow Midi CC Envelope Module 1" and the parameter will then be following the envelope that is looping in "Midi CC Envelope Module 1".
Midi note clips function in the same way. Every instrument will be able to select one Midi Notes Module. If you right clicked "Instrument Module 2" in the "Instrument Module Window" and selected "Midi input from Midi Notes Module 1", then the notes coming out of "Midi Notes Module 1" would be playing through the single virtual instrument you placed in "Instrument Module 2".
If you want the sound to come out of your speakers, then navigate to the "Bus" window. Select "Instrument Module 2" with a drop-down check off menu by right-clicking "Inputs". While still in the "Bus" window look at the "Output" window and check the box that says "Audio Output". Now the sound is coming through your speakers. Check off more Instrument Modules or Audio Track Modules to get more sound coming through the same bus.
Turn the "Aux" on to put all audio through effects.
Work in "Bounce" by selecting inputs like "Input Module 3" by right clicking and checking off Input Modules. Then press record and stop. Copy and paste your clip to an Audio Track Module, the "Sampler" or a Side Chain Audio Track Module.
Work in "Master Bounce" to produce audio clips by recording whatever is coming through the system for everyone to hear.
Chop and screw your audio in the sampler with highlight and right click processing effects. Glue your sample together and put it in an Audio Track Module or a Side Chain Audio Track Module.
Use the "Threshold Setter" to perform long linear modulation. Right click any parameter and select "Adjust to Threshold". The parameter will then adjust its minimum and maximum values over the length of time described in the "Threshold Setter".
The "Execution Engine" is used to make sure all changes happen in sync with the music.
IE>If you selected a subdivision of 2, and a length of 2, then it would take four quarter beats(starting from the next quarter beat) for the change to take place. So if you're somewhere in the a (1e+a) then you will have to wait for 2, 3, 4, 5, to pass and your change would happen on 6.
IE>If you selected a subdivision of 1 and a length of 3, you would have to wait 12 beats starting on the next quater beat.
IE>If you selected a subdivision of 8 and a length of 3, you would have to wait one and a half quarter beats starting on the next 8th note.
http://www.pdpatchrepo.info/hurleur/820_am,_July_26th_13_window_conception.png
Low pass filter for smooth fade
@Maelstorm said:
I fairly recently was trying to make one of those smoothed-out sample-and-hold LFOs and discovered that [lop~] generates asymmetric curves: logarithmic going up and exponential going down.
Well, it's actually exponential both ways, but it's always exponentially decaying toward the destination value. So going up it's an inverted exponential decay.
But if you're considering something like an amplitude envelope, you may want the rising portions to be an exponential decay (most analog envelope generators work this way, moving to the next stage at a preset threshold). A DX7 has a true exponentially increasing attack (since it's a linear function passed through an exponential lookup table), but it sounds strange and sort of unmusical, like a sound played in reverse.
As suggested in the tutorials, quartic envelopes are a nice compromise. The curves are exponential-like, but they reach the destination values in a finite amount of time.
MIDI activated envelopes
Sorry to repost about this, but there is something I'm not getting.
In Csound and SuperCollider (as in any VST instrument, etc.), there are standard, built-in mechanisms for MIDI-activated envelopes -- meaning playing synths from a keyboard.
In Csound, it's the 'r' family of line and envelope opcodes. In SuperCollider, it's the 'gate' parameter of the EnvGen UGen.
What these do is:
- start the envelope when you press a keyboard key,
- keep the sustain level as long as you hold the key,
- engage the release segment of the envelope when you release the key (ie Note Off MIDI message).
When I posted about this ealier, someone kindly pointed me to the [c_adsr] object in RjLib. But RjLib is part of neither Pd vanilla nor Pd extended.
Leading me to ask:
-
Is playing synths from a keyboard something that Pd people just do not do? Those who need this use Csound or SC?
-
Or do all Pd users immediately install the RjLib after installing Pd, and use RjLib all the time?
-
Or does Pd have another mechanism for MIDI-driven envelopes that I'm unaware of and that everybody uses?
Thanks very much.
I'd be very curious to know if other Pd users have asked themselves the same question.
Workshop: Xth Sense - Biophysical generation and control of music
April 6, 7, 8 2011
11:00-19:00
Xth Sense – biophysical generation and control of music
@NK
Elsenstr. 52/
2.Hinterhaus Etage 2
12059 Berlin Neukölln
FULL PROGRAM: http://www.nkprojekt.de/xth-sense-%E2%80%93-biophysical-generation-and-control-of-music/
~ What
The workshop offers an hands-on experience and both theoretical and practical training in gestural control of music and bodily musical performance, deploying the brand-new biosensing technology Xth Sense.
Developed by the workshop teacher Marco Donnarumma within a research project at The University of Edinburgh, Xth Sense is a framework for the application of muscle sounds to the biophysical generation and control of music. It consists of a low cost, DIY biosensing wearable device and an Open Source based software for capture, analysis and audio processing of biological sounds of the body (Pure Data-based).
Muscle sounds are captured in real time and used both as sonic source material and control values for sound effects, enabling the performer to control music simply with his body and kinetic energy. Forget your mice, MIDI controllers, you will not even need to look at your laptop anymore.
The Xth Sense biosensor was designed to be easily implemented by anyone, no previous experience in
electronics is required.
The applications of the Xth Sense technology are manifold: from complex gestural control of samples and audio synthesis, through biophysical generation of music and sounds, to kinetic control of real time digital processing of traditional musical instruments, and more.
~ How
Firstly, participants will be introduced to the Xth Sense Technology by its author and led through the assembling of their own biosensing wearable hardware using the materials provided.
Next, they will become proficient with the Xth Sense software framework: all the features of the framework will be unleashed through practical exercises.
Theoretical background on the state of art of gestural control of music and new musical instruments will be developed by means of an audiovisual review and participatory critical analysis of relevant projects selected by the instructor.
Eventually, participants will combine hardware and software to implement a solo or group performance to be presented during the closing event. At the end of the workshop, participants will be free to keep the Xth Sense biosensors they built and the related software for their own use.
~ Perspective participants
The workshop is open to anyone passionate about sound and music. Musical background and education does not matter as long as you are ready to challenge your usual perspective on musical performance. Composers, producers, sound designers, musicians, field recordists are all welcome to join our team for an innovative and highly creative experience. No previous experience in electronics or programming is required, however participants should be familiar with digital music creation.
Participation is limited to 10 candidates.
Preregistration is required and can be done by sending an email to info@nkprojekt.de
Requirements and further info
Participants need to provide their own headphones, soundcards and laptops with Pd-extended already installed.
Musicians interested in augmenting their favourite musical instrument by means of body gestures are encouraged to bring their instrument along. More information about the Xth Sense and a video of a live performance can be viewed on-line at
http://res.marcodonnarumma.com/projects/xth-sense/
http://marcodonnarumma.com/works/music-for-flesh-ii/
http://marcodonnarumma.com/teaching/
Dates
6-7-8 April, 11.00-19.00 daily (6 hours sessions + 1 hour break)
Fee
EUR 90 including materials (EUR 15).
Contact
Marco Donnarumma
m[at]marcodonnarumma.com
http://marcodonnarumma.com
Bandlimited oscillators
This is a collection of abstractions that generate bandlimited oscillators. They include:
[bl-saw.mmb~] - bandlimited sawtooth waveform
[bl-pulse.mmb~] - bandlimited pulse wave with PWM
[bl-tri.mmb~] - bandlimited triangle wave
[bl-asymtri.mmb~] - bandlimited asymmetrical triangle wave (sort of...see below)
There is also an object called [bl-init.mmb]. This is the object that initializes all the waveforms and at least one instance MUST be included in order for the others to work.
There are also help patches included.
IMPORTANT!
Before you can use these, you must do the following steps.
1. Open [bl-init.mmb]
2. There is a message box that says [44100(. This is the maximum sampling rate that these will work at (running at lower sampling rates will be fine). If you plan on using higher sampling rates, change this message box and click it. Technically, it will still work at a higher sampling rate, but it won't generate harmonics above the sampling rate in this box.
3. Click the [bang( to fill the wave tables. This patch actually creates a wavetable for EVERY harmonic between 30Hz and the Nyquist frequency. So it will take a few minutes. Be patient! You will get a message in the Pd window when it is done.
4. Save the patch.
Once you do this, [bl-init.mmb] will simply load with the tables already generated, so you don't have to wait every time you instantiate it. I didn't have this already done for you in order to keep the upload small, and so you can see how to adjust it if you need to.
So, I guess I'll go ahead and try to explain how these work. As stated above, every harmonic is generated in [bl-init.mmb] for the oscillators. It doesn't create a table for each set of harmonics however (e.g., there isn't a saw table with two harmonics, a saw table with three harmonics, etc.). Instead, each of these individual tables are tacked on to the end of each other to create one long wave table. So, for each set of 1027 samples in the sawtooth wavetable, there is one cycle with a set amount of harmonics.
When the oscillators read the frequency input, it is divided into the Nyquist frequency to determine how many harmonics are needed. It then uses this (* 1027) as the offset for the table. This is how I got around the problem of table switching at block boundaries. By doing this way, the "switching" is done at audio rate.
There are actually two [tabread4~]s. One has one less harmonic than the other. As the frequency changes it crossfades between these tables. When one table goes completely silent, that's when it "switches." Below 30Hz, they switch to geometrically perfect waveforms.
[bl-saw.mmb~] and [bl-tri.mmb~] just read through the tables. Nothing really interesting about them.
[bl-pulse.mmb~] is actually the difference between to sawtooths. In other words, there are two bandlimited sawtooth oscillators inside of it. Adjusting the pulse width cause the phase of one of the sawtooths to shift. When you subtract this phase-shifted sawtooth from the other, it creates a bandlimited pulse wave...without oversampling! This is the same Phase Offset Modulation method used in Reason's SubTractor.
[bl-asymtri.mmb~] uses the same technique as [bl-pulse.mmb~], except it uses bandlimited parabola waves instead of sawtooths. Adjust the phase offset sets where the top vertex is. This doesn't really generate true triangle or saw waves, though. They still have the parabolic curve in them, so the harmonics seem to come out a little more. It's more of a "reasonable approximation." But, it is bandlimited, and it does sound pretty cool to modulate the shape. I don't have the scaling quite right yet, but I'll get to it later...maybe.
I should also mention that these use my [vphasor.mmb~] abstraction, so the phase reset is sample accurate.
I'll eventually set these up to allow frequency and pulse-width arguments, but I'm currently in the process of moving to another country, so it may be a little bit before I get around to it.
Didn't any of that make any sense?