Cabbage Logo
Back to Cabbage Site

Backgroundcolour not working

I’m just trying to use a signaldisplay, and when I type backgroundcolour it doesn’t turn red like colour does. The display also doesn’t show up when I run the instrument, and I think this might be why.

Looks there is an issue there, I can’t seem to get the background colour to work here either. I’ll take a look. But I was able to get the signaldisplay widget to show up and display some signals. Did you try the example in the Misc example menu?

Hi @arcanom. I fixed the background colour issue. Were you able to get this widget to work? Let me know if not and I will post a simple example.

If you click the artifacts link on the following page you will get new installers for both OSX and Windows. Let me know if they work Ok for you.

Thank you for your help, I’ll make sure to try again soon! However, I won’t be trying again until I figure out how to load samples for a wavetable.

Loads samples into a wavetable, or simply play them back from a wavetable? Did you try teh SampleLoadAndPlayback.csd from the Misc examples? It might be a good start. It loads a bunch of samples to a list of wavetables using the ftsamplebank opcode. It could be done manually too. You can also have a read of this short tutorial.

I’m trying to laod .wav files and use them as wavetables. The problems I’m running into are numbering the tables (I get the message “Invalid ftable no. 1000.000000” when I press a key), playing back single cycles, changing wavetable position and accounting for different lengths, pitches, and pitch changes in the wav files. So far I only know how to load the files, and set up a phasor and a table opcode.

Can you post the code that’s giving you the problems?

giwt1 chnget “wt1”

giFTNL = 1000
giFTNR = 2000

ginumtabL ftsamplebank “C:/Program Files/Csound6_x64/mysamples”, giFTNL, 0, 0, 1
ginumtabR ftsamplebank “C:/Program Files/Csound6_x64/mysamples”, giFTNR, 0, 0, 2

This is supposed to load all the wavetables, and giwt1 should get the number of each file from a combobox. This will be used to select a wavetable later.

iWt1L = giFTNL + giwt1
iWt1R = giFTNR + giwt1

This should set iWt1L and iWt1R to the number of the function table that should be used.

aphase phasor 1, 0

awavL tab aphase, iWt1L, 1
awavR tab aphase, iWt1R, 1

This is supposed to output left and right channel audio signals by reading the table with a phasor. I’m not sure how to get it to read only a specific cycle, but I wanted to figure out the function table number problem first.
I’d also like to know if there is a way to remove pitch changes when loading in a WAV file, or to account for them when reading the function table.

Sorry I took so long to reply.

I think you meant to post this to another thread? Would you mind reposting to the relevant thread?

Actually this is the right thread. You asked for the code that was giving me problems. Sorry for any confusion, but that was the code you asked for.

:joy::joy: My apologies, too many messages and not enough beer makes Rory go :crazy_face: Honestly, I was certain this discussion was part of another thread.

Anyhow, is there any way you could post a complete example? There are many factors that could be preventing this from working correctly, but its hard to tell what it is from the little snippets of code you posted.

vslider bounds (170, 10, 40, 100) channel ("oct"), text("Oct") range(-4, 4, 0, 1, 1)
vslider bounds (200, 10, 40, 100) channel ("semis") text("Semis") range(-12, 12, 0, 1, 1)
vslider bounds (230, 10, 40, 100) channel ("cents") text("Fine") range(-100, 100, 0, 1, 1)
hslider bounds (10, 130, 150, 20) channel ("wtp")  range(0, 1, 0, 1, .001)
combobox bounds (10, 100, 150, 30) channel ("wt1") populate ("*.wav", "C:/Program Files/Csound6_x64/mysamples")
;display


;labels
label bounds (10, 10, 150, 20) align("centre") text("Oscillator 1")

That was all the widgets other than the keyboard and form.

-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5 --displays

That was everything under CsOptions.

giwt1 chnget “wt1”

giFTNL = 1000
giFTNR = 2000

ginumtabL ftsamplebank “C:/Program Files/Csound6_x64/mysamples”, giFTNL, 0, 0, 1
ginumtabR ftsamplebank “C:/Program Files/Csound6_x64/mysamples”, giFTNR, 0, 0, 2

That was how I tried to load my samples.

instr 1 ;oscillator 1
;get info from sliders
koct chnget “oct”
ksem chnget “semis”
kcen chnget “cents”

;set variables
iFreq = p4
iAmp = p5
kOct = octave(koct)
kSemis = semitone(ksem)
kFine = cent(kcen)

iWt1L = giFTNL + giwt1
iWt1R = giFTNR + giwt1 ; table numbers for the selected wavetable

isize = ftlen(iWt1L)

isecs = 44100/isize ;length of table in seconds

;sound generation

aphase phasor 1, 0 ; phasor for table reading

awavL tab aphase, iWt1L, 1
awavR tab aphase, iWt1R, 1 ; table reading

;mixing voices
aOscL = awavLiAmp
aOscR = awavR
iAmp

;output
outs aOscL, aOscR
endin

That was the instrument in which I tried to play back the samples. Sorry if the code’s hard to read, I’m pretty new at this. Also sorry that it’s so long.

By the way, if you have too many messages, you could take breaks from replying right? For example, you keep replying to this thread surprisingly fast.