sigmund~ peaks @npeak 1
unpack i f f (gives you index number, frequency, amplitude of that peak)
cycle~ (resynthesizes as sine tone)
*~ (adjusts gain) (multiply two floats from unpack)
can add tapin~/tapout~ pair with an argument of the delay time in ms, before the dac
then, change to 10 peaks instead of 1 in sigmund~
cycle~ object switches among the 10 peaks really fast, sounds kind of swarmy
ENTER poly patcher
MAKE SUBPATCHER:
in 1 AND in 2
2 flonum boxes, one into cycle~ and one directly into R inlet of *~
cycle~
*~
out~1
Inlets are frequency and amplitude information, out~ gives you a signal.
IN ORIGINAL PATCH:
poly~ subpatcherfilename Poly
Insert this where cycle~ and *~ were before. Now you have a nice 1-voice poly.
How do you do this with 10 peaks/voices rather than just one?
input message into poly~ that's voices $1, connect to left inlet, can put numbox and input however many voices you want
you can put open $1 message into same left inlet, and whichever integer you put into the number box, it'll open the sub patcher for that voice
**this is like a vocoder, you can understand his voice repeat back even with cycle~ and 10 voices!**
**just for fun, throw a spectroscope on the incoming signal and on the re-synthesized signal**
You can also change number of peaks coming out of sigmund~.
target$1 message is third important message into poly~--tells poly~ to send frequency to whichever voice--target 0 sends to every voice, target 1 sends just to voice 1--all the other voices will remain static on their last perceived frequency
To map multiple peaks into multiple voices:
in sigmund~, make it 2 peaks, and have 2 voices in poly~
make + 1, to make sure the index number matches with the voice number
place + 1 between index number (coming out of unpack) and target
NOW you need to re-order the patch cords to make sure peak 1 is mapped to voice 1--instead of unpack i f f, make it unpack f f i, put message above it that's $2 $3 $1--so that you get frequency, amplitude, and then index coming out of unpack, and you can put the index number through the +1, so now the target # is changed first before new amplitude and frequency inputted
now, can put input menu into sigmund~ for peak, and you can feed it integers to determine the number of peaks it finds--NO MORE than 20, probably a good idea to set limits on number input for number of voices, or else it will likely crash (note: today it was crashing on 7 or 8 voices)--if you make an integer box and feed it into the npeak menu and the number of voices, you can change them both at the same time
**poly~ is also set up to receive MIDI notes**
It's meant for replicating, so all the sub patches of the voices will be the same, but you can have them set up to randomly choose various pathways, so each voice will select different pathways. You could feed a saw~ and a cycle~ each into a *~ object and then into a selector~ 2 object, and it will choose between those--add a third inlet, directly into the selector~ 2, and you can put a numbox in there (0 means nothing gets selected, 1 means the first, 2 means the second UGen). That way, you can manually select each voice for target $1 and the kind of wave you want coming out, and it will be predetermined.
Tracks object tries to keep track of which partial is which, instead of putting whatever's loudest in voice 1 and next loudest in voice 2, etc.
Wednesday, May 20, 2015
Wednesday, May 13, 2015
SpQ15 Arithmetic & Logical Operators
jit.op help is great place for list of arithmetic operators
make jit.matrix my_matrix 1 float32 2 2
Creates a 2x2 jit.matrix object containing floats.
float32 vs. char (which yields integers in Max)
! means not, generally, in computer programming
wrap is like the floating-point modulo (modulo likes integers)
expr $i1 will give you result of arithmetic calculation
! not operator gives you a zero unless it receives a zero, in which case it outputs something--it's about zero vs. non zeros
&& is "and"
|| is "or"
make jit.matrix my_matrix 1 float32 2 2
Creates a 2x2 jit.matrix object containing floats.
float32 vs. char (which yields integers in Max)
! means not, generally, in computer programming
wrap is like the floating-point modulo (modulo likes integers)
expr $i1 will give you result of arithmetic calculation
! not operator gives you a zero unless it receives a zero, in which case it outputs something--it's about zero vs. non zeros
&& is "and"
|| is "or"
Wednesday, April 29, 2015
SpQ15 OSC
OSC (late '90s) is an alternative to MIDI (1983), hasn't caught on super quickly yet
Yamaha DX7-first MIDI keyboard--we have one down in the classic lab--FM synthesis based
MIDI is designed to handle 8-bit samples, not a lot of data or very rich data. OSC is designed to handle 32-bit numbers.
Here's the OSC specification site:
http://opensoundcontrol.org/spec-1_0
transport-independent message system--the OSC message is the content, but what's the container it travels in? There's 2 basic transport protocols, UDP and TCP/IP. The internet uses those guys. In the case of the internet, the messages are HTTP messages traveling over a TCP/IP connection. OSC typically uses UDP. Main distinction between UDP and TCP/IP is that UDP just sends the data, doesn't care if the other side receives it, whereas TCP/IP waits for acknowledgement that data was received. A little bit of overhead/latency with TCP/IP, but it ensures both sides know the message was sent and received. You can send OSC messages on TCP/IP, or USB, or MIDI, but if you want quicker response you can use UDP.
In Max, there's an object udpsend and udpreceive that defaults to sending/looking for OSC messages.
MIDI has a message structure and a hardware specification. OSC doesn't have a hardware specification.
Data types: In memory, zeros and ones could mean anything. The computer has to know what it's looking at/for.
float32 tells it to look for a floating point number--first byte tells it where the decimal point is, next three bytes tell it the value
int32 looks for an integer--signed & unsigned (uint32), signed being negative and positive, unsigned being zero on up
char 8-bit, typically unsigned--in Jitter, often used for RGBA, with each component being a char
big-endian is where the largest, most significant digits are on the "left" and the least are on the "right"--Motorola uses this, whereas Intel does little-endian--for OSC, it has to decide to interpret as big-endian or little-endian, it prefers big-endian
in a string, the null ASCII character let's it know the string is done, literally a value of 0--the null character as typed for OSC is \0
the OSC-blob allows you to package another file, say a TIFF, or a PNG, or a JPG, or any file, you enter the size of the blob in bytes using the data type int32--then the blob is some arbitrary number of bytes, but the OSC-blob message tells you how big the blob is--you can use an OSC message to carry anything, using a blob--he doesn't know if Max supports blobs
OSC Packet consists of message and size.
OSC Packet can be either a Message or a Bundle. The first byte tells it which of those it is.
OSC Message consists of: Address Pattern, Type Tag String, 0+ Arguments--Address, Type Tags, Args
Address Pattern and Type Tags are both OSC Strings
Args could be whatever, however many of them
Address identifies what kind of message it is. For example, in Jordan's program, /faster. You could have more slashes and create subcategories of messages, too. In MIDI, there are fixed message types, like "noteon," but in OSC you have to create the message types yourself, and they can be anything.
Type Tags are a comma "," followed by a sequence of characters corresponding exactly to the arguments to follow. If there are no arguments, you still need a type tag string: ",\0\0\0". There are four possibilities: i => int32, f => float32, s => OSC-string, b => OSC-blob. There are also, less standard possibilities, listed in the specifications.
In Max, it's taken care of automatically. In programming X-code yourself, you have to include it.
Yamaha DX7-first MIDI keyboard--we have one down in the classic lab--FM synthesis based
MIDI is designed to handle 8-bit samples, not a lot of data or very rich data. OSC is designed to handle 32-bit numbers.
Here's the OSC specification site:
http://opensoundcontrol.org/spec-1_0
transport-independent message system--the OSC message is the content, but what's the container it travels in? There's 2 basic transport protocols, UDP and TCP/IP. The internet uses those guys. In the case of the internet, the messages are HTTP messages traveling over a TCP/IP connection. OSC typically uses UDP. Main distinction between UDP and TCP/IP is that UDP just sends the data, doesn't care if the other side receives it, whereas TCP/IP waits for acknowledgement that data was received. A little bit of overhead/latency with TCP/IP, but it ensures both sides know the message was sent and received. You can send OSC messages on TCP/IP, or USB, or MIDI, but if you want quicker response you can use UDP.
In Max, there's an object udpsend and udpreceive that defaults to sending/looking for OSC messages.
MIDI has a message structure and a hardware specification. OSC doesn't have a hardware specification.
Data types: In memory, zeros and ones could mean anything. The computer has to know what it's looking at/for.
float32 tells it to look for a floating point number--first byte tells it where the decimal point is, next three bytes tell it the value
int32 looks for an integer--signed & unsigned (uint32), signed being negative and positive, unsigned being zero on up
char 8-bit, typically unsigned--in Jitter, often used for RGBA, with each component being a char
big-endian is where the largest, most significant digits are on the "left" and the least are on the "right"--Motorola uses this, whereas Intel does little-endian--for OSC, it has to decide to interpret as big-endian or little-endian, it prefers big-endian
in a string, the null ASCII character let's it know the string is done, literally a value of 0--the null character as typed for OSC is \0
the OSC-blob allows you to package another file, say a TIFF, or a PNG, or a JPG, or any file, you enter the size of the blob in bytes using the data type int32--then the blob is some arbitrary number of bytes, but the OSC-blob message tells you how big the blob is--you can use an OSC message to carry anything, using a blob--he doesn't know if Max supports blobs
OSC Packet consists of message and size.
OSC Packet can be either a Message or a Bundle. The first byte tells it which of those it is.
OSC Message consists of: Address Pattern, Type Tag String, 0+ Arguments--Address, Type Tags, Args
Address Pattern and Type Tags are both OSC Strings
Args could be whatever, however many of them
Address identifies what kind of message it is. For example, in Jordan's program, /faster. You could have more slashes and create subcategories of messages, too. In MIDI, there are fixed message types, like "noteon," but in OSC you have to create the message types yourself, and they can be anything.
Type Tags are a comma "," followed by a sequence of characters corresponding exactly to the arguments to follow. If there are no arguments, you still need a type tag string: ",\0\0\0". There are four possibilities: i => int32, f => float32, s => OSC-string, b => OSC-blob. There are also, less standard possibilities, listed in the specifications.
In Max, it's taken care of automatically. In programming X-code yourself, you have to include it.
Wednesday, April 22, 2015
SpQ15 FFT's & Spectra
FFT relies on groups of samples that are 2^n in size-in Max, default are 512 and 1024, as well as 2048 and 4096 (FFT window)
For each sample/data point, you'll get a frequency and amplitude in the spectrum--a graph of amplitude over time (waveform) becomes a graph of frequency versus amplitude--an integral
divide sample rate (48000, for ex) by FT size (1024, for ex)--> 46.875 Hz between points in frequency on the resulting graph--a harmonic series on the bin frequency
when you get up to half the sample rate, you get a mirror image
pfft~ object--needs to load in another patch, so name it: pfft~ my_pfft--then add argument for FFT size: pfft~ my_pfft 1024--next argument is overlap factor, 2 means overlap by 1/2, 4 means overlap by 1/4, etc.--pfft~ my_pfft 1024 2--input and output objects are fftin~ 1 and fftout~ 1--connect first two outlets of fftin to first two inlets of fftout
fft~ in 1 has far right outlet that's bin index, other two outlets are real and imaginary parts of it--they're graphed as x and y--if you take the same Cartesian coordinates and convert to polar, the r (radius) value gives you the amplitude of the sound, and the angle theta gives you the phase of the wave--a key element of phase vocoders--put a cartopol~ object between them, to convert Cartesian to polar coordinates
you can do inverse FFT to go from frequency domain into time domain, as well--works as a filter
spectral gate, only louder (for ex) components make it through--maximum amplitude you can get is window size divided by two or four or something--just need two objects, a > object (which sends a 1 if true and a 0 if false) and a multiply object--that gives you cool effects that only pass frequencies louder than a certain amount--basically produces a sinusoidal result--re-synthesizing based on frequency spectrum
For each sample/data point, you'll get a frequency and amplitude in the spectrum--a graph of amplitude over time (waveform) becomes a graph of frequency versus amplitude--an integral
divide sample rate (48000, for ex) by FT size (1024, for ex)--> 46.875 Hz between points in frequency on the resulting graph--a harmonic series on the bin frequency
when you get up to half the sample rate, you get a mirror image
pfft~ object--needs to load in another patch, so name it: pfft~ my_pfft--then add argument for FFT size: pfft~ my_pfft 1024--next argument is overlap factor, 2 means overlap by 1/2, 4 means overlap by 1/4, etc.--pfft~ my_pfft 1024 2--input and output objects are fftin~ 1 and fftout~ 1--connect first two outlets of fftin to first two inlets of fftout
fft~ in 1 has far right outlet that's bin index, other two outlets are real and imaginary parts of it--they're graphed as x and y--if you take the same Cartesian coordinates and convert to polar, the r (radius) value gives you the amplitude of the sound, and the angle theta gives you the phase of the wave--a key element of phase vocoders--put a cartopol~ object between them, to convert Cartesian to polar coordinates
you can do inverse FFT to go from frequency domain into time domain, as well--works as a filter
spectral gate, only louder (for ex) components make it through--maximum amplitude you can get is window size divided by two or four or something--just need two objects, a > object (which sends a 1 if true and a 0 if false) and a multiply object--that gives you cool effects that only pass frequencies louder than a certain amount--basically produces a sinusoidal result--re-synthesizing based on frequency spectrum
ChucK questions 2
What's up with the word "now" and the component of a shred where you have to advance time? How does ChucK conceive of time passing? How do you run shreds in parallel with the miniAudicle? Still command-line thing? What is meant by suspending a current shred to let time pass?
How to get ChucK to reference outside itself? That is, read audio files, write to audio files, and also produce MIDI mappable into Live or Max, and also recognize/interact with a MIDI foot controller?
How to create a random note order? Where to type Math.random2f object?
How to chuck an LFO to blackhole properly so it modulates frequency and/or amplitude?
How to get ChucK to reference outside itself? That is, read audio files, write to audio files, and also produce MIDI mappable into Live or Max, and also recognize/interact with a MIDI foot controller?
How to create a random note order? Where to type Math.random2f object?
How to chuck an LFO to blackhole properly so it modulates frequency and/or amplitude?
Monday, April 20, 2015
ChucK Beginnings
Question: How to run multiple shreds in parallel through miniAudicle?
Answer:
Time units: ms, second, minute, hour day, week, samp(le)
Oscillators: SinOsc, SawOsc, SqrOsc, PulseOsc
Standard effects: gain, PRCRev (reverb)
Can have ChucK read a value and then chuck it back to itself. Add parentheses after the name of the parameter, like s1.freq()
Question: How to read a sound file in ChucK?
Answer: WvIn reads file (can change rate), WaveLoop loops file (change # of loops/sec, phase offset), WvOut (writes samples to an audio file),
Question: How to record an entire ChucK session?
Answer:
Time units: ms, second, minute, hour day, week, samp(le)
Oscillators: SinOsc, SawOsc, SqrOsc, PulseOsc
Standard effects: gain, PRCRev (reverb)
Can have ChucK read a value and then chuck it back to itself. Add parentheses after the name of the parameter, like s1.freq()
Question: How to read a sound file in ChucK?
Answer: WvIn reads file (can change rate), WaveLoop loops file (change # of loops/sec, phase offset), WvOut (writes samples to an audio file),
Question: How to record an entire ChucK session?
Wednesday, April 8, 2015
SpQ15 Project Update 3
I would like to learn to amplitude modulate clips, reverse clips, and speed up/slow down during performance, with sound that's recorded live, without the performer touching anything. Obstacles to this: Ableton won't MIDI/keyboard map these things because they take time to process. The lag time isn't so much a problem for me, because I wouldn't necessarily want them playing back as soon as they're recorded, but sometime later. It could be I can record the clips directly into tracks that already have the speed and reverse set already, but there's not an obvious way to pre-set those things, since the sample box only appears after something's been recorded into the clip.
Possibilities include: 1) writing Max patchers that reverse, change speed automatically, and force samples to amplitude modulate, 2) figuring out how to control automation live for the envelope part, although this sounds just about as complicated as the previous option, maybe more.
To write these Max patchers: record clip in Live, transfer audio into buffer in Max, play audio back out in processed form to a NEW clip or track in Ableton to create a new audio file--this must be a pretty common thing to do, right?
As for amplitude modulation, I really need to explore exactly what that means, sounds like, go back to Chris' Max examples and see how he does it.
Possibilities include: 1) writing Max patchers that reverse, change speed automatically, and force samples to amplitude modulate, 2) figuring out how to control automation live for the envelope part, although this sounds just about as complicated as the previous option, maybe more.
To write these Max patchers: record clip in Live, transfer audio into buffer in Max, play audio back out in processed form to a NEW clip or track in Ableton to create a new audio file--this must be a pretty common thing to do, right?
As for amplitude modulation, I really need to explore exactly what that means, sounds like, go back to Chris' Max examples and see how he does it.
Monday, April 6, 2015
SpQ15 Project Update 2
Crunchiness:
I put Tetsu Inoue's piece into Live to check out the waveform.
The piece pans drastically. Each sound has a unique place in the stereo field. At some places (~:50), the waveform is the same in L and R channels but delayed by small fractions of a second.
The envelopes are very crisp, with one section being individual blips of sound evenly spaced--almost as if the L and R channels were given different algorithms for reproducing a blip of some kind at different rates. *On frequency spectrum, these blips seem to be fairly even white noise.
Some sounds where the amplitude is vertically displaced in strange ways, so it looks like a wave (~41 seconds).
Starting at ~80 seconds, that amplitude vertical displacement thing is happening, but I can catch snippets of a voice, so I think it's a sample that's been put into some kind of weird envelope.
Fairly broad frequency spectrum whole time, but certain sounds high frequencies are definitely emphasized. Some sounds look synthesized, as their frequency spectra have very evenly repeating or distributed shapes (~1:30).
I'm thinking, other than synthesizing some sounds, a lot of the piece is interesting samples time-shifted and fit to within very specific envelopes with rapid changes in amplitude.
As for Shlohmo's Teeth, the panning isn't so much present. That's probably not a core part of the crunchy sound. There are abrupt switches between higher frequency, digital "glass-breaking" sounds and bass sounds, almost like there's some extreme compression on there. Side-chain?
What I should try:
Modulating incoming sound to achieve clipping and distortion.
Check out some weird compression.
Specifying repeating sets of high frequencies to be brought out in sound.
Figuring out how to change speed without use of multi-bar looper device. -In sample view, you can change the speed either at increments of 2 or else gradually with a mouse drag. Unfortunately, this isn't something MIDI or keyboard mappable.
Figuring out how to force an envelope onto a sample.* *It seems like this might require making Max for Live objects which take the content of a clip and put it into a buffer, and then feed the audio back out to a track in Live.
I put Tetsu Inoue's piece into Live to check out the waveform.
The piece pans drastically. Each sound has a unique place in the stereo field. At some places (~:50), the waveform is the same in L and R channels but delayed by small fractions of a second.
The envelopes are very crisp, with one section being individual blips of sound evenly spaced--almost as if the L and R channels were given different algorithms for reproducing a blip of some kind at different rates. *On frequency spectrum, these blips seem to be fairly even white noise.
Some sounds where the amplitude is vertically displaced in strange ways, so it looks like a wave (~41 seconds).
Starting at ~80 seconds, that amplitude vertical displacement thing is happening, but I can catch snippets of a voice, so I think it's a sample that's been put into some kind of weird envelope.
Fairly broad frequency spectrum whole time, but certain sounds high frequencies are definitely emphasized. Some sounds look synthesized, as their frequency spectra have very evenly repeating or distributed shapes (~1:30).
I'm thinking, other than synthesizing some sounds, a lot of the piece is interesting samples time-shifted and fit to within very specific envelopes with rapid changes in amplitude.
As for Shlohmo's Teeth, the panning isn't so much present. That's probably not a core part of the crunchy sound. There are abrupt switches between higher frequency, digital "glass-breaking" sounds and bass sounds, almost like there's some extreme compression on there. Side-chain?
What I should try:
Modulating incoming sound to achieve clipping and distortion.
Check out some weird compression.
Specifying repeating sets of high frequencies to be brought out in sound.
Figuring out how to change speed without use of multi-bar looper device. -In sample view, you can change the speed either at increments of 2 or else gradually with a mouse drag. Unfortunately, this isn't something MIDI or keyboard mappable.
Figuring out how to force an envelope onto a sample.* *It seems like this might require making Max for Live objects which take the content of a clip and put it into a buffer, and then feed the audio back out to a track in Live.
Saturday, April 4, 2015
SpQ15 Project Update 1
First week goals: 1) figure out looping in Live, and looping at different speeds
2) define some things that make a crunchy, crisp digital sound
Questions:
-Do I want warping on or off? There will be some clips I'd like quantized, but there will also be clips I'd like to start playing immediately when I hit play. Is there any way to individualize this by track, or something?
Here's an informative article on warping in Live: http://www.soundonsound.com/sos/dec06/articles/livetech_1206.htm
-If I turn warping off completely for this piece, what is the lag when I press record to when it actually starts recording? If I want to have a rhythmic section, timing everything precisely will be important, like with a traditional loop station.
Observations:
-I'm trying out a looper instead of recording directly into a clip. That seems to start recording more quickly, but when it plays back, audio doesn't seem to come through to Audio 1 or the master.
-The looper seems to have features that allow speed changes (a knob, but can also jump up/down by intervals), doubling the loop length, halving the loop length, and reversing samples. There's also a "drag me" feature that lets the audio from a looper be dragged as a complete audio loop. These built-in features could come in very handy, if I can figure out how to get the audio to come through.
2) define some things that make a crunchy, crisp digital sound
Questions:
-Do I want warping on or off? There will be some clips I'd like quantized, but there will also be clips I'd like to start playing immediately when I hit play. Is there any way to individualize this by track, or something?
Here's an informative article on warping in Live: http://www.soundonsound.com/sos/dec06/articles/livetech_1206.htm
-If I turn warping off completely for this piece, what is the lag when I press record to when it actually starts recording? If I want to have a rhythmic section, timing everything precisely will be important, like with a traditional loop station.
Observations:
-I'm trying out a looper instead of recording directly into a clip. That seems to start recording more quickly, but when it plays back, audio doesn't seem to come through to Audio 1 or the master.
-The looper seems to have features that allow speed changes (a knob, but can also jump up/down by intervals), doubling the loop length, halving the loop length, and reversing samples. There's also a "drag me" feature that lets the audio from a looper be dragged as a complete audio loop. These built-in features could come in very handy, if I can figure out how to get the audio to come through.
Wednesday, April 1, 2015
Live class 4/1
NAME everything.
convolution reverb-fingerprint of a space
can freeze audio & have it play back, incl live instruments--either control click and Flatten, or make another audio track & drag it over after freezing it
instrument rack--new MIDI track, open Instruments-->Sampler --throw sample in there, it makes it into an instrument!--you can layer as many samplers as you want into an instrument rack, limited only by CPU--play in unison or in different configurations as you choose
can limit certain layers according to velocity--create a more complex sound
can pan each of them
Plugins-->Serum (synthesizer), a wave table synthesizer
can manipulate oscillators in real time
can scan through an audio file, will take chosen section of audio file as shape of oscillator
Then, when you're done designing an instrument, save it as a unique instrument, stored in Live forever. Yay!
Can choose to add effects to part of a rack, not whole rack, or whole thing, or everything.
Granulator-->granular synthesis, drop sample in--file position determines where granulator will start playing it back--grain size determines size of grains--can scrub through file at any speed--make new sounds out of audio files--spray option gets it to jump around in audio file, introduces more randomness
Collect All and save, will save things all in the same folder
Groove Pool--picks up rhythmic signature of a beat, will quantize your MIDI to match it, so it can swing--you can alter little gray triangles to change rhythmic signature manually--then can split into MIDI, so it'll put a beat into a drum rack for you, or a beat into a kit, so you can play it on a keyboard
convolution reverb-fingerprint of a space
can freeze audio & have it play back, incl live instruments--either control click and Flatten, or make another audio track & drag it over after freezing it
instrument rack--new MIDI track, open Instruments-->Sampler --throw sample in there, it makes it into an instrument!--you can layer as many samplers as you want into an instrument rack, limited only by CPU--play in unison or in different configurations as you choose
can limit certain layers according to velocity--create a more complex sound
can pan each of them
Plugins-->Serum (synthesizer), a wave table synthesizer
can manipulate oscillators in real time
can scan through an audio file, will take chosen section of audio file as shape of oscillator
Then, when you're done designing an instrument, save it as a unique instrument, stored in Live forever. Yay!
Can choose to add effects to part of a rack, not whole rack, or whole thing, or everything.
Granulator-->granular synthesis, drop sample in--file position determines where granulator will start playing it back--grain size determines size of grains--can scrub through file at any speed--make new sounds out of audio files--spray option gets it to jump around in audio file, introduces more randomness
Collect All and save, will save things all in the same folder
Groove Pool--picks up rhythmic signature of a beat, will quantize your MIDI to match it, so it can swing--you can alter little gray triangles to change rhythmic signature manually--then can split into MIDI, so it'll put a beat into a drum rack for you, or a beat into a kit, so you can play it on a keyboard
SpQ15 4/1: intro
monger/munger object: granular synthesis object
extremes! of dynamics, density, and speed
computers are really good at making hundreds and thousands and millions of copies of things--something humans struggle to do--a good way to address extremes perhaps
murmur--third party iOS software, turns your iPhone into like a remote
Jen/Gen is SuperCollider-like feature in Max
extremes! of dynamics, density, and speed
computers are really good at making hundreds and thousands and millions of copies of things--something humans struggle to do--a good way to address extremes perhaps
murmur--third party iOS software, turns your iPhone into like a remote
Jen/Gen is SuperCollider-like feature in Max
Friday, March 13, 2015
Final project update 3
It seems I've been missing the entire set of Max objects that are part of the Live API. This has the potential to make everything a lot easier, except I now have to remake my patch. I hope, if I put in the time, that it will work, and not just be a lot of time wasted.
Tuesday, March 10, 2015
Class notes 3/10: buffers, delays, filtering
allocate some body of memory, a table capable of holding x samples, with an index at each location
that's what delay~ object does--its argument should be how many samples of memory to set aside--really, it works in chunks of audio, not individual samples
I/O buffer tells you what size chunk of audio it will get from operating system before bringing it into Max--probably default 512
signal vector size--not same as I/O vector size, how many samples are calculated at one time and sent out to DAC--there's always a small delay
to find out what happened 3 samples ago--subtract 3 from current index number, find out what's there--but have to make sure it's within the appropriate range (0-x)--when you get beyond end of buffer, subtract 44,100 from it, so it puts you back to zero--circular buffer--not literally circular, but cycles back to beginning of buffer once it reaches the end--this is how delay works
tapin, tapout objects work with a buffer to access different indices at random (?)
click~ object--when you bang it, it sends out 1--otherwise sends out a 0--so, if you do that with an audio signal, it sounds like a click
as two sine waves of the same frequency are delayed over the length of a phase, you get an amplitude-scaled sine wave of the same frequency--that's how a filter works usually, is by suppressing or boosting certain frequencies
tapin~ object--creates a place in memory that can hold a certain amount of time in sound--specify in ms--must be connected to tap out~
tapout~ object--tell it how many ms of delay you want it to look in the past, translates from ms to samples for you
can use tap out~'s output to feed back into tap in~ to generate feedback--generally this kind of feedback doesn't work in MSP, but this is a rare exception, works b/c tapout~ will never let you go back more than a signal vector's worth of time in the past--this allows you to do repeated echoes, like a "delay" function on a pedal or in a DAW
matrix delay~ (or something like that) object, for video--stores a number of matrices, can ask it to look back in the past a certain number of index #'s back
can also specify time value for delay in a tempo-related way, with translate object
in pop music, subliminal delay of like a half note, at an extremely low level--builds mysterious harmonic complexity b/c of suspensions--check out any Enya song, or Prince uses it a lot even with guitar
chorusing is a slight randomization of delay time, like passing a changing filter through sound, to emulate slight out-of-tuneness, or a bit like a flanger
there's an example that uses a rand~ object with tapin~ and tapout~ objects to give somewhat of a chorus-y effect
*good idea: use loop $1 message into sfplay~ object to loop it, put a toggle into the loop $1 message
play a version of a sound that's delayed exactly 1 sample, will interfere at half the sampling rate destructively, will create a kind of low-pass filtering effect
comb~ object--allows feedback delays internally, feedbacks less than one vector size, can specify milliseconds of delay, how much of the feedback and feedforward signals do you want
delay snare drum by 1 ms, get a pitchy sound
reson~ object--choose center frequency to be emphasized, and Q factor (how sharply to emphasize sound)--did Chris make this? or does it come with Max? not sure
table object--can specify frequencies, amplitudes, etc.
biquad~ object--all-purpose filter object in Max, often used alongside filtergraph~ object which allows you to send info into biquad~--help file shows you the formula it uses, you could input the scaling factors yourself, but filtergraph takes care of that for you--left inlet of filtergraph object lets you put in menu and set mode of filter--allows one cutoff or center frequency, basically
*filtering is delay--it's just really short delay
you can chain biquad~ objects, there may even be an object called cascade~ which would do this for you
Reason is a cool DAW that mimics hardware setups in electronic music studios, complete with cables and all
Sunday, March 8, 2015
Final project update #2
I'm having trouble mapping dials in Max for Live to actual dials on the Live interface. Specifically, I want these dials to control the proportion of the signal being sent through reverb and delay, and the selected audio track in Live has built-in send dials for this purpose. I want the dials to run through Max, because I want the motion of the dials to be automated very gradually. I suppose there may be some way automate this in Live itself, but I was hoping to have Max time everything.
I already had to download one external object, aka.keyboard, to get Max to communicate with Live. I made a bunch of keyboard shortcuts in Live, and I'm having this object in Max automatically press certain keys at certain triggers. I thought mapping Max objects to Live controls directly would be super easy, because that's what I thought Max for Live was for. It doesn't seem that way, though.
Thursday, March 5, 2015
Class notes 3/5: 3D animation and OpenGL
can do "moderately interesting" things with 3D animation in Max
there's a center point (0,0,0) around which everything is measured
OpenGL has lighting capabilities to determine direction of incoming light
reminder: use qmetro instead of metro, since it's ok if a frame of video gets dropped
jit.gl.render object --> render means turn something into a usable output, so it draws whatever it thinks it should draw and puts it out
send a message "erase, bang" to jit.gl.render to clear the previous information and give us the new information
give jit.gl.render object @erase_color 0. 0. 0. 1.--which means no red, no green, no blue, full opacity--when it erases, it's black--RGBalpha for this object (not the same order in every object)
jit.gl.gridshape object --> makes lots of tiny triangle drawings and stitches them together to make your picture--@shape attribute: sphere, cube, taurus, all kinds of things--put in pak position object 0. 0. 0. so initial position is at origin--if you give it no size information, it will pretty much fill up screen
to automate something moving through space, have program running to continually change x, y, and z values--can use line objects or any algorithm you can dream up
check jit.gl.gridshape's attributes in inspector window--there's a lot--also check OB3D attributes, which are all available to any GL object
attrui object--type in gl_color, it gives you a menu--when you make an attrui object, it gives you the options to change that attribute in selectable form, either a menu or a continuum
@lighting_enable --> turns on lighting capabilities, otherwise looks like light is coming from all directions
jit.gl.texture object --> whatever you send into this can be referred to with the @texture attribute of jit.gl.gridshape--texture can be an image or a movie that will play in that shape
depth enable attribute--> can decide which objects are in front of & behind other objects
can also put a movie on a plane to put it in 3D space--> jit.gl.videoplane
to change name of a string of jit objects, send message drawto [new name]
pak camera object--> tells where your camera is coming from, position can be controlled just like a gridshape
nurbs is a cool concept--you have a 3D shape, and you have points that protrude or intrude to distort it--can put an image or video on the shape to see the image or video distorted
jit.gl.physics or jit.gl.physdraw (or something like that) object--> should emulate some natural physical movements, like a ball bouncing against a wall
jit.gl.multiple object --> if you want a whole bunch of the same thing, instead of adding shapes or whatever individually--once it reaches the maximum number you specify, it'll stop
*from reading: wireframe mode allows you to see 3D shapes as a grid
there's a center point (0,0,0) around which everything is measured
OpenGL has lighting capabilities to determine direction of incoming light
reminder: use qmetro instead of metro, since it's ok if a frame of video gets dropped
jit.gl.render object --> render means turn something into a usable output, so it draws whatever it thinks it should draw and puts it out
send a message "erase, bang" to jit.gl.render to clear the previous information and give us the new information
give jit.gl.render object @erase_color 0. 0. 0. 1.--which means no red, no green, no blue, full opacity--when it erases, it's black--RGBalpha for this object (not the same order in every object)
jit.gl.gridshape object --> makes lots of tiny triangle drawings and stitches them together to make your picture--@shape attribute: sphere, cube, taurus, all kinds of things--put in pak position object 0. 0. 0. so initial position is at origin--if you give it no size information, it will pretty much fill up screen
to automate something moving through space, have program running to continually change x, y, and z values--can use line objects or any algorithm you can dream up
check jit.gl.gridshape's attributes in inspector window--there's a lot--also check OB3D attributes, which are all available to any GL object
attrui object--type in gl_color, it gives you a menu--when you make an attrui object, it gives you the options to change that attribute in selectable form, either a menu or a continuum
@lighting_enable --> turns on lighting capabilities, otherwise looks like light is coming from all directions
jit.gl.texture object --> whatever you send into this can be referred to with the @texture attribute of jit.gl.gridshape--texture can be an image or a movie that will play in that shape
depth enable attribute--> can decide which objects are in front of & behind other objects
can also put a movie on a plane to put it in 3D space--> jit.gl.videoplane
to change name of a string of jit objects, send message drawto [new name]
pak camera object--> tells where your camera is coming from, position can be controlled just like a gridshape
nurbs is a cool concept--you have a 3D shape, and you have points that protrude or intrude to distort it--can put an image or video on the shape to see the image or video distorted
jit.gl.physics or jit.gl.physdraw (or something like that) object--> should emulate some natural physical movements, like a ball bouncing against a wall
jit.gl.multiple object --> if you want a whole bunch of the same thing, instead of adding shapes or whatever individually--once it reaches the maximum number you specify, it'll stop
*from reading: wireframe mode allows you to see 3D shapes as a grid
Tuesday, March 3, 2015
Class notes 3/3: JS for Max
JavaScript is object-oriented programming. That means it has properties and methods.
Start by specifying "inlets = " and "outlets = " properties.
function name(1,2,3) {
method();
method();
}
A function can have arguments. Above, 1,2, and 3 are arguments.
Useful method in Max: outlet(1, "bang");--this will send out the outlet on the right, whereas outlet(0) sends out the left outlet--try to keep right-to-left order as is typical for Max.
function anything() {
This means, if anything comes in other than what's already defined, do this.
A function can call another function within it.
In JS, no distinction between ints and floats. In Max, yes.
At beginning of script, set variables. In JS, equals sign means "set this to this." A double equals sign == means is it equal to? Testing if the logical expression is true or false.
var x = 0;
Any variable you set outside of a function is considered a global variable. That means it's accessible from any part of the program, but that doesn't mean it can't be changed in a function. A local variable only exists within a function, and it ceases to exist after that.
Set up script so if people put the wrong things into the object, sends out an error message--can do this function-by-function.
function msg_int( incoming) {
That's a function that allows an integer to be input, can set that to a variable to store it, and/or can send it out immediately.
A function in a JS script is a potential incoming message from Max. So you might have function msg_int, or function msg_float, or whatever other message might come in.
isNaN means "is not a number"--so if incoming isn't a number, can send an error, or whatever
Arrays:
thearray = new Array(1);
array name = new Array(# of arguments);
myfavoritearray = [32, 76, 95.3, "chris"];
Very much like a coll object, numbered automatically with index numbers
while loop-->set an initial condition, keep testing condition, if it's this, do this--have to also set a stop condition
Start by specifying "inlets = " and "outlets = " properties.
function name(1,2,3) {
method();
method();
}
A function can have arguments. Above, 1,2, and 3 are arguments.
Useful method in Max: outlet(1, "bang");--this will send out the outlet on the right, whereas outlet(0) sends out the left outlet--try to keep right-to-left order as is typical for Max.
function anything() {
This means, if anything comes in other than what's already defined, do this.
A function can call another function within it.
In JS, no distinction between ints and floats. In Max, yes.
At beginning of script, set variables. In JS, equals sign means "set this to this." A double equals sign == means is it equal to? Testing if the logical expression is true or false.
var x = 0;
Any variable you set outside of a function is considered a global variable. That means it's accessible from any part of the program, but that doesn't mean it can't be changed in a function. A local variable only exists within a function, and it ceases to exist after that.
Set up script so if people put the wrong things into the object, sends out an error message--can do this function-by-function.
function msg_int( incoming) {
That's a function that allows an integer to be input, can set that to a variable to store it, and/or can send it out immediately.
A function in a JS script is a potential incoming message from Max. So you might have function msg_int, or function msg_float, or whatever other message might come in.
isNaN means "is not a number"--so if incoming isn't a number, can send an error, or whatever
Arrays:
thearray = new Array(1);
array name = new Array(# of arguments);
myfavoritearray = [32, 76, 95.3, "chris"];
Very much like a coll object, numbered automatically with index numbers
while loop-->set an initial condition, keep testing condition, if it's this, do this--have to also set a stop condition
Sunday, March 1, 2015
JavaScript in Max article
js object
JS is for scripts within web pages. Uses core JS, not client-side JS. Save as a text file with a .js extension somewhere in Max file search path, then type filename as argument in js object.
Default 1 inlet, 1 outlet; specify this at start of script.
Create a function()
JS is for scripts within web pages. Uses core JS, not client-side JS. Save as a text file with a .js extension somewhere in Max file search path, then type filename as argument in js object.
Default 1 inlet, 1 outlet; specify this at start of script.
Create a function()
Friday, February 27, 2015
Final project update #1
I'll use Live for the looping portion of the piece. I'll have three loops be recorded live, automatically, and played back with effects. Each section of the piece will start with recording a loop, so that the same trigger used to start recording a loop will be used to move on to the next scene, with appropriate effects added to that scene.
Things to do in Max:
Figure out what objects can be used to control specific functions/buttons in Live
Set up triggers for each of 3 loops/scenes that interact with Live
Set up how long each loop will record, play back; the first loop will stop at a predetermined time, probably when the trigger for the second loop happens, but the second and third loops will go on through most of the rest of the piece
Set ending time for loops
Things to do in Live:
Set scenes corresponding to sections of the piece
Add effects to each loop section
Add effects to each overall scene
Things to do in Max:
Figure out what objects can be used to control specific functions/buttons in Live
Set up triggers for each of 3 loops/scenes that interact with Live
Set up how long each loop will record, play back; the first loop will stop at a predetermined time, probably when the trigger for the second loop happens, but the second and third loops will go on through most of the rest of the piece
Set ending time for loops
Things to do in Live:
Set scenes corresponding to sections of the piece
Add effects to each loop section
Add effects to each overall scene
Thursday, February 26, 2015
Class notes 2/26: Panning in stereo, languages that interface with Max
Sound travels ~1 ms/foot. Less than a ms of time difference from one ear to the other, but we can hear that.
Head-related transfer functions HRTF's: head-related filtering, sound will have a slightly different frequency content coming from different locations. Useful for headphones.
Straight linear crossfade results in it seeming sound is farther away when it's right in the middle--have to compensate for inverse square law. There's a perceived 3 dB drop in the middle, because there's a 6 dB amplitude drop in the middle. To account for that, take sqrt of left and right speaker values, and you'd get a more natural sound. A more efficient way is to look up value in a quarter of a cycle of a cosine wave and assign that to L channel, from sine wave to R channel. That way, 0-->1 is L to R. You can use the phase offset inlet (R inlet) of the cycle~ object to achieve that. Make sure you use a line~ object or rampsmooth~ object to interpolate between different dial settings, if you want to make a panning dial, or else you might get a bunch of clicks.
In real life, panning should result in a Doppler effect.
Within Max, there are a couple ways to use text based programming. (Max itself is written in C.)
js object--a JavaScript object, but internally you write it in a text-based program.
gen~ object--there's a language called Gen that lets you manipulate every single pixel of a video signal or every single sample of an audio signal
mgraphics--a way to use JavaScript to control graphics
Processing--a Java-like interface for doing 2D graphics
Next week: Jitter & 3D animation, an introduction
Head-related transfer functions HRTF's: head-related filtering, sound will have a slightly different frequency content coming from different locations. Useful for headphones.
Straight linear crossfade results in it seeming sound is farther away when it's right in the middle--have to compensate for inverse square law. There's a perceived 3 dB drop in the middle, because there's a 6 dB amplitude drop in the middle. To account for that, take sqrt of left and right speaker values, and you'd get a more natural sound. A more efficient way is to look up value in a quarter of a cycle of a cosine wave and assign that to L channel, from sine wave to R channel. That way, 0-->1 is L to R. You can use the phase offset inlet (R inlet) of the cycle~ object to achieve that. Make sure you use a line~ object or rampsmooth~ object to interpolate between different dial settings, if you want to make a panning dial, or else you might get a bunch of clicks.
In real life, panning should result in a Doppler effect.
Within Max, there are a couple ways to use text based programming. (Max itself is written in C.)
js object--a JavaScript object, but internally you write it in a text-based program.
gen~ object--there's a language called Gen that lets you manipulate every single pixel of a video signal or every single sample of an audio signal
mgraphics--a way to use JavaScript to control graphics
Processing--a Java-like interface for doing 2D graphics
Next week: Jitter & 3D animation, an introduction
Tuesday, February 24, 2015
Class notes 2/24: re-synthesizing acoustic sounds, forward object, buffer~, groove~ and play~, things to think about when writing a Max piece
peakamp~ object--can send continuous amplitude information, by banging it with a metro, or have it report peak amplitude for some segment of time
sigmund~ object can also send out continuous amplitude information
sigmund~ object can also send out continuous frequency information, not just pitch information--you can have, for example, a sine wave recreate that frequency shape--put it into a buffer, graph it--this is a non-real-time process, although you could do the same thing in real time with an ezadc~ object
"stealing the expressivity of the player"
jit.poke~ object--takes value of a signal and puts it into a matrix where it can be displayed
sfplay~ object-->sigmund~-->buffer~ objects off to the side with record~ object for each
can then use those curves to control synthesized sound/re-synthesize sound--allows you to change pitch or speed independently
When you write a Max piece:
Make list of things that need to be checked before a piece starts
Make version of score that lists the triggering actions/notes to remind yourself
He's made an object called ducker~ that tells computer to ignore input that's below a certain threshold. It looks really handy, see if it's in the examples section.
scheduler in audio interrupt--set any scheduled events along with audio scheduler
CPU meter--can tell you how much of the processing power you're using
Timer--can run a timer that counts up, so you can see how long the piece has been going on
Check Audio--opens Audio Status window
Can create a sub patch that determines threshold automatically, by using peakamp~ object.
change object--filters out repetitions of the same thing
forward object--sends what comes in to the appropriate objects within the patch--looks like a send object, but it doesn't have to know in advance where to send stuff--like a send object where you can change the name of where you want to send it
Check out Chris' *main* patch, which demonstrates the forward object and forwarding.
If you're thinking about how to make a Max structure for a piece, think about how a fellow player or improviser would react to what you play.
buffer~ object--makes a space in RAM, whereas sfplay~ object creates a small "personal" buffer but reads from hard drive--because it's Random Access Memory, can go to any part of it randomly at any moment--a whole bunch of objects can access the buffer--see his objectsthataccessbuffer~ example
**once you create a buffer with a name, all the objects pertaining to that buffer should contain the buffer name
replace message--resizes buffer and puts new thing in it--when it's done loading a file, it sends a bang out its right outlet
info~ object--gets information from buffer~ object, like channel and duration information
read message--like replace, loads something into the buffer, but doesn't set size of buffer--if you use this, you need to have set the size of the buffer already, and it'll play through that amount of time regardless of how long the sound file is
cycle~ object--reads cyclically through 512 samples of the sound and treat it like a waveform, any 512 samples you choose, and you can tell it to do that many times per second, so it creates some kind of tone out of that
index~ object--looks up what's in the buffer at any given moment, esp. when paired with count~
play~ object--plays the sound in the buffer--can give it arguments with starting and stopping points in ms--can also get it to scroll through buffer--can send start and stop messages, or pause and resume messages (?) probably, or "start 0 420" to start at the beginning and read through .42 seconds--can also say "start 420 0" to play part of the file backwards--can say "start 1000 2000 1200" to read from 1 second to 2 second, but do it in 1.2 seconds--can use a line~ object to move through buffer in certain ways, sending a 3-part message in to it--"0, 1000 2000" for example--can feed cycle~ in to it to set a speed for moving through it, usually a really low number like 0.025, it's like a sinusoidal scrubber moving forward & backward through buffer, sort of like scratching a record back & forth, can add number boxes for depth (how much of sample to scrub), rate (how fast), and center (frequency around which pitch will scrub)
Yes, this can work for video, but you have to process video parallel and just send them the same information
record~ object--allows you to record into buffer
poke~ object
peak~ object
wave~ object
groove~ object--you can set loop points within sound, change speed, and tell starting point in sound--very similar to play~, but defines things differently--in order to play, needs an msp signal that tells it the rate at which it will play (sig~) and needs startloop message--can continuously change rate at which it plays, positive and negative values--can also set loop spots within groove, have to send 1 into loop message into groove~ in order to activate loop features--right outlet sends out numbers 0-1 as it reads through loop--could send that into buffer that contains trapezoid to make window that fades it in and out with each loop, to avoid clicks--can also have it loop to a specific moment by sending in a numerical message--can also send it "set soundA" messages to change sound file it's reading through
sig~ object--passes on rate to send in to groove~
sigmund~ object can also send out continuous amplitude information
sigmund~ object can also send out continuous frequency information, not just pitch information--you can have, for example, a sine wave recreate that frequency shape--put it into a buffer, graph it--this is a non-real-time process, although you could do the same thing in real time with an ezadc~ object
"stealing the expressivity of the player"
jit.poke~ object--takes value of a signal and puts it into a matrix where it can be displayed
sfplay~ object-->sigmund~-->buffer~ objects off to the side with record~ object for each
can then use those curves to control synthesized sound/re-synthesize sound--allows you to change pitch or speed independently
When you write a Max piece:
Make list of things that need to be checked before a piece starts
Make version of score that lists the triggering actions/notes to remind yourself
He's made an object called ducker~ that tells computer to ignore input that's below a certain threshold. It looks really handy, see if it's in the examples section.
scheduler in audio interrupt--set any scheduled events along with audio scheduler
CPU meter--can tell you how much of the processing power you're using
Timer--can run a timer that counts up, so you can see how long the piece has been going on
Check Audio--opens Audio Status window
Can create a sub patch that determines threshold automatically, by using peakamp~ object.
change object--filters out repetitions of the same thing
forward object--sends what comes in to the appropriate objects within the patch--looks like a send object, but it doesn't have to know in advance where to send stuff--like a send object where you can change the name of where you want to send it
Check out Chris' *main* patch, which demonstrates the forward object and forwarding.
If you're thinking about how to make a Max structure for a piece, think about how a fellow player or improviser would react to what you play.
buffer~ object--makes a space in RAM, whereas sfplay~ object creates a small "personal" buffer but reads from hard drive--because it's Random Access Memory, can go to any part of it randomly at any moment--a whole bunch of objects can access the buffer--see his objectsthataccessbuffer~ example
**once you create a buffer with a name, all the objects pertaining to that buffer should contain the buffer name
replace message--resizes buffer and puts new thing in it--when it's done loading a file, it sends a bang out its right outlet
info~ object--gets information from buffer~ object, like channel and duration information
read message--like replace, loads something into the buffer, but doesn't set size of buffer--if you use this, you need to have set the size of the buffer already, and it'll play through that amount of time regardless of how long the sound file is
cycle~ object--reads cyclically through 512 samples of the sound and treat it like a waveform, any 512 samples you choose, and you can tell it to do that many times per second, so it creates some kind of tone out of that
index~ object--looks up what's in the buffer at any given moment, esp. when paired with count~
play~ object--plays the sound in the buffer--can give it arguments with starting and stopping points in ms--can also get it to scroll through buffer--can send start and stop messages, or pause and resume messages (?) probably, or "start 0 420" to start at the beginning and read through .42 seconds--can also say "start 420 0" to play part of the file backwards--can say "start 1000 2000 1200" to read from 1 second to 2 second, but do it in 1.2 seconds--can use a line~ object to move through buffer in certain ways, sending a 3-part message in to it--"0, 1000 2000" for example--can feed cycle~ in to it to set a speed for moving through it, usually a really low number like 0.025, it's like a sinusoidal scrubber moving forward & backward through buffer, sort of like scratching a record back & forth, can add number boxes for depth (how much of sample to scrub), rate (how fast), and center (frequency around which pitch will scrub)
Yes, this can work for video, but you have to process video parallel and just send them the same information
record~ object--allows you to record into buffer
poke~ object
peak~ object
wave~ object
groove~ object--you can set loop points within sound, change speed, and tell starting point in sound--very similar to play~, but defines things differently--in order to play, needs an msp signal that tells it the rate at which it will play (sig~) and needs startloop message--can continuously change rate at which it plays, positive and negative values--can also set loop spots within groove, have to send 1 into loop message into groove~ in order to activate loop features--right outlet sends out numbers 0-1 as it reads through loop--could send that into buffer that contains trapezoid to make window that fades it in and out with each loop, to avoid clicks--can also have it loop to a specific moment by sending in a numerical message--can also send it "set soundA" messages to change sound file it's reading through
sig~ object--passes on rate to send in to groove~
Subscribe to:
Posts (Atom)